Zurück zu Willert.de

Abstract interface

Abstract interface

Postby petya » September 27th, 2011, 3:51 pm

We know that abstract interfaces are the interfaces that has abstract operation, but when I want to put "Abstract" before the name of the class in ReporterPlus
<<if opnlsAbstract of [operation] = “true” then “Abstract” else “ ”>> <<$name >>
(My iteration is done through model->[project]->[containedPackages]->[classes])
the evaluation always returns false if my interface contains more than one operation. I think that it could be done with the expression “there_exists”, because I want the evaluation to become true if I have any abstract operation but I don’t know how exactly sintactically to write that. Can you give me some help? :?
petya
 
Posts: 2
Joined: September 14th, 2011, 4:39 pm

Re: Abstract interface

Postby simonmorrish » January 15th, 2012, 1:08 am

Hi Petya

I'm probably too late to help you - but maybe this will be useful to you in the future, or to someone else.

First, I'm not familiar with opnlsAbstract, and I don't have ReporterPLUS in front of me to check. I'll assume that it's a valid attribute of a class in ReporterPLUS.

What you tried,
Code: Select all
$opnlsAbstract of [operation]

will actually return the value of $opnlsAbstract for every operation on the class, combined into a single comma-delimited string. That's why it never worked for classes with more than one operation.

Your hunch was correct about there_exists. You could do this:
Code: Select all
if (
  there_exists OP in [operations] =>
  boolean $opnlsAbstract of OP = true
) then "Abstract"
else ""


If you wanted to mark the class abstract only if all operations are abstract, you could try this:
Code: Select all
if (
  for_all OP in [operations] =>
  boolean $opnlsAbstract of OP = true
) then "Abstract"
else ""


best regards,
Simon
simonmorrish
 
Posts: 3
Joined: January 27th, 2009, 2:27 pm
Location: South Wales, UK


Return to TestConductor, ATG, Gateway, ReporterPlus

Who is online

Users browsing this forum: No registered users and 2 guests