Author Topic: Source Code Generation Template  (Read 3593 times)

DanF

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Source Code Generation Template
« on: May 23, 2014, 06:33:42 pm »
Hey,

currently i am trying to create a source code generation template.

I have a Class composed of two sub Classes each sub Class with Ports.
Within the Composite Structure Diagram both ports are connected (via Information Flow).
Now i want to access the connector between these Ports.

I managed to find Ports as Property from Class, but thats it.
At the moment I struggle at getting any connections between Ports.

So my question is how can i archive this or is this even possible within a code generation template?

Any hint is helpful thank you in advance.

Greetings
Dan

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8066
  • Karma: +118/-20
    • View Profile
Re: Source Code Generation Template
« Reply #1 on: May 26, 2014, 09:22:40 am »
Code generation templates don't provide access to ports (or the connectors between them)

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Source Code Generation Template
« Reply #2 on: May 26, 2014, 03:31:43 pm »
Personally I prefer to generate code directly via the API, but IIRC you can use EXEC_ADD_IN to access things indirectly from the code gen macros.

q.

DanF

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Source Code Generation Template
« Reply #3 on: May 27, 2014, 10:20:04 pm »
Hello,

thank you for the fast replies. This saves me a lot of time searching something that is not possible.

Greetings
Dan

Nizam Mohamed

  • EA User
  • **
  • Posts: 193
  • Karma: +1/-0
    • View Profile
Re: Source Code Generation Template
« Reply #4 on: May 28, 2014, 01:38:14 pm »
Not possible off-the shelf, but as qwerty has mentioned, you can always try using the EXEC_ADDIN if the requirement is compelling, it shouldn't be hard to retrieve the information from an addin and pass it on to the template.

DanF

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Source Code Generation Template
« Reply #5 on: May 28, 2014, 06:32:42 pm »
Due to your suggestions to use an Add-In with EXEC_ADD_IN it would also be interesting to know how the code synchronization is affected.

Would it be possible to synchronize code generated in this way properly?
Or are there any side effects or something like that?