Book a Demo

Author Topic: CTF - Connector in the Template  (Read 4750 times)

ToniPepperoni

  • EA Novice
  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
CTF - Connector in the Template
« on: August 28, 2013, 07:32:24 pm »
Hey guys,

I am still working on my code template for a specific language based on XML (actually, it is more a "meta-definition" of a language, which I can import into the IDE and so on - but not really relevant for the following question).

For that template I have created also a profile, diagram and toolbox, which contains a "Connector".

Here is a small example:
Class1 ------ <<virtual>> ------> Class2

My question is now, how can I achieve that Class1 knows about the connector "virtual"? In the above-mentioned case, "Class1" should have something like that in the Code-Template:

<class name="Class1">
....
     <virtualclass>Class2</virtualclass>
...

Thank you very much  :D

Best Regards,
Toni
« Last Edit: August 28, 2013, 11:23:32 pm by ToniPepperoni »

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: CTF - Connector in the Template
« Reply #1 on: August 29, 2013, 09:11:46 am »
The C++ templates include a line
Code: [Select]
%linkVirtualInheritance=="T" ? "virtual" : ""%
That macro is probably what you want.

ToniPepperoni

  • EA Novice
  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
Re: CTF - Connector in the Template
« Reply #2 on: August 29, 2013, 03:01:08 pm »
Thank you simon!

I did not know that there is an option in the properties dialog from generalizitation-connection. This is a good idea, but I would like to have rather a own connector for this "special" connection than this option.

Is it possible to get any information about a connector (source, destination, etc.)?

Regards,
Toni

Edit: By the way, which effects has the checkbox when checking?
« Last Edit: August 29, 2013, 07:03:47 pm by ToniPepperoni »

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: CTF - Connector in the Template
« Reply #3 on: August 30, 2013, 08:31:15 am »
Reasonably certain that it's only used for code engineering.

If you're not using that, you'll probably need to list over the connectors and find the one you're after.

ToniPepperoni

  • EA Novice
  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
Re: CTF - Connector in the Template
« Reply #4 on: August 30, 2013, 06:13:58 pm »
Hi simon,
sorry, but I didn't get that. How can I list the connectors?
And why do I need that? Is it not possible to get the destination-element of the class currently in scope?

Do you mean something like that? -->
%list="connectorDestElemName" @separator="\n\n" @indent=""%
(but this is of course not working)

Regards,
Toni

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: CTF - Connector in the Template
« Reply #5 on: September 02, 2013, 08:46:17 am »
Create a connector template (Add new Custom Template, select connector)

Code: [Select]
%connectorDestElemName%
List the connector from the class/class body template.

Code: [Select]
%list="Connector" @separator="\n\n" @indent=""%
You can also filter the connectors that are relevant. eg. Generalizations from the current element.

Code: [Select]
%list="Connector" @separator="\n\n" @indent=""connectorSourceElemGUID==classGUID and connectorType=="Generalization"%
« Last Edit: September 03, 2013, 08:23:52 am by simonm »