What I want to do is iterate through a set of classes and generate one set of text for classes that are stereotyped (for the sake of this discussion, let's call the stereotype name "Stereotype") and to generate another set of text for the classes that are not stereotyped.
I have an idea what my Q-language script should look like but I am still getting a Syntax Error. Can someone please explain how I should structure my script? I know it's not difficult but I'm missing something fundamental. Thanks.
This topic has been locked.
4 replies Latest Post - 2012-12-06T17:12:57Z by SystemAdmin
Pinned topic Setting Iteration Conditions - Q Language
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2012-12-06T17:12:57Z at 2012-12-06T17:12:57Z by SystemAdmin
Re: Setting Iteration Conditions - Q Language2010-05-18T10:29:26Z in response to briangDRSHello,
so, on the Class iteration, you add an expression:
if $name of stereotype = "stereotype" then "the text you want to display" else ""
You can also check the 'Use alternate text' when inserting the expression, and this will remove the <<no model data>> insert
Re: Setting Iteration Conditions - Q Language2012-12-05T13:43:41Z in response to briangDRSI have another question on iteration condition syntax.
What I would like to do is only print certain packages...not ones named "xx" and "yy".
What would the Q language condition look like in this case?
"print all packages who's names are NOT "xx" or "yy""
Re: Setting Iteration Conditions - Q Language2012-12-06T17:10:29Z in response to SystemAdminHi,
so I test this by right-clicking in the template window (bottom left),
Add New item and set the Iteration to Class, this generates a list of all elements
On the condition tab,I put the following:
$name "xx" and $name "yy"
The is not equals but the 'and', it's rather unusual but it seems to work.