Author Topic: list conditionals + stereotype @ code template?  (Read 38 times)

enteleform

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
list conditionals + stereotype @ code template?
« on: November 15, 2017, 07:19:25 am »
I'm trying to use the conditional parameter of the list macro to organize the attributes in "Class Body" by stereotype.

For example:
Code: [Select]
...

public class MyClass{

  //###  Stereotype_A  ###
  public int myVar_1;
  public int myVar_2;

  //###  Stereotype_B  ###
  public int myVar_3;
  public int myVar_4;
...
}

I've tried various permutations of
Code: [Select]
%list="Attribute" @separator="\n" @indent="\t" (%stereotype == "Stereotype_A")%but haven't gotten anything to work yet.

(tried stereotype/classStereotype, various arrangements of the % symbol, with/without %if...% & %endIf%, with/without parenthesis, etc.)
« Last Edit: November 15, 2017, 07:34:34 am by enteleform »

Simon M

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 6181
  • Karma: +45/-5
    • View Profile
Re: list conditionals + stereotype @ code template?
« Reply #1 on: November 15, 2017, 08:21:43 am »
Code: [Select]
%list="Attribute" @separator="\n" @indent="\t" attStereotype == "Stereotype_A")%
Simon

support@sparxsystems.com

enteleform

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: list conditionals + stereotype @ code template?
« Reply #2 on: November 15, 2017, 08:41:02 am »
Code: [Select]
%list="Attribute" @separator="\n" @indent="\t" attStereotype == "Stereotype_A")%

Awesome, thanks for your help!