Book a Demo

Author Topic: Multiple Stereotypes in Transformation Template  (Read 4872 times)

Steve Shaw

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Multiple Stereotypes in Transformation Template
« on: January 11, 2011, 08:29:30 am »
I'm writing a UML to UML transformation - trying to select a subset of my model and add it to another model.  I want to select classes and attributes that have certain stereotypes.   This works fine if my class or attribute only has one stereotype but does not work if my class has multiple.   The script below will only work if the stereotype is the one that shows up in the class properties dialog box.  
Any help is appreciated.
Steve

%if elemType != "Class"%
%endTemplate%
%if classStereotype!="Telematics"%
%endTemplate%

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Multiple Stereotypes in Transformation Templat
« Reply #1 on: January 11, 2011, 09:21:02 am »
Code and transformation templates currently provide no support for multiple stereotypes.

Steve Shaw

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Multiple Stereotypes in Transformation Templat
« Reply #2 on: January 11, 2011, 11:43:20 am »
Thanks for the prompt reply.
Can you offer any kind of alternative?   I need to be able to "tag"  (multiple tags) and use model transformation to select them into a sub model.  This is functionality that was supported in RSA .

Thanks again.  Your help is really appreciated.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Multiple Stereotypes in Transformation Templat
« Reply #3 on: January 12, 2011, 08:30:59 am »
You could do it with a tagged value for each one.
« Last Edit: January 12, 2011, 08:31:18 am by simonm »

Steve Shaw

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Multiple Stereotypes in Transformation Templat
« Reply #4 on: January 12, 2011, 08:36:21 am »
Thanks
Can you give me an example of how that would work?  
What code what I need to write to determine if a specific tag exists on the class (assuming there are multiple tags out there)?

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Multiple Stereotypes in Transformation Templat
« Reply #5 on: January 12, 2011, 12:09:26 pm »
Code: [Select]
%if classTag:"Something" != ""%
...
%elseIf classTag:"Other" != ""%
...
%endIf%