Book a Demo

Author Topic: Connector Template for different stereotypes  (Read 3617 times)

dannodj

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Connector Template for different stereotypes
« on: January 28, 2010, 10:18:36 pm »
Hi,

I am trying to split the code within the Connector template, dependent on the Stereotype applied to the source class.  I have tried the following code at the start of the template, but it doesn't correctly evaluate the connectorSourceStereotype, I'm wondering whether the stereotype of the source class is within scope of the connector template.  - How can I know which macros are in scope at any point in the code?


%if connectorSourceStereotype!="reference entity"%

%connectorType%
%PI="\n  "%


{

%TRANSFORM_CURRENT("Direction", "name")%
%TRANSFORM_REFERENCE("Connector",connectorGUID)%
name="Reference Association"
Source
{


Dan

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Connector Template for different stereotypes
« Reply #1 on: February 01, 2010, 10:51:20 am »
If I'm reading your question properly you want connectorSourceElemStereotype.

dannodj

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: Connector Template for different stereotypes
« Reply #2 on: February 01, 2010, 10:49:00 pm »
Apologies if I'm missing something, but in the prompt dropdown, the properties listed are connectorSourceStereotype and connectorDestStereotype, there isn't a connectorSourceElemStereotype.  When I type in connectorSourceElemStereotype, it isn't recognised.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Connector Template for different stereotypes
« Reply #3 on: February 02, 2010, 09:09:41 am »
Then it's missing from the autocomplete and syntax highlighting.

connectorSourceStereotype is the stereotype on the source end of an association.  (The association end is able to be stereotyped itself)

For ALL macros with the class prefix1 you are able to replace class with connectorSourceElem or connectorDestElem.

1. Note that this is not talking about macros with prefixes like classParam.

dannodj

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: Connector Template for different stereotypes
« Reply #4 on: February 02, 2010, 08:18:03 pm »
Thanks for the help, I'll give it a go