Book a Demo

Author Topic: How to get connector tagged value within a stereotyped code generation template?  (Read 3614 times)

camel2

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Hi there,

I've got a question on the EA code generation using code templates and stereotypes:

I've got two different custom stereotypes applicable to functions. One of them also has a connector tagged value which can be set to a function with the other stereotype.
What I mean:

<<Stereotype A>> connectorTaggedValue=function2()
function1()

<<Stereotype B>>
function2()

Now I created a stereotyped template for code generation, which handles Stereotype A. Is there any possibility to get the name of function2(), which is stored in the tagged value? I tried %opTag:"connectorTaggedValue"%, but it only returns some kind of reference, like {E744F61F-FABD-492f-892C-93A0AD6B4527}, and I'd like to have the string "function2" instead.

Any ideas? :-)

Ann

Nizam

  • Prolab Moderator
  • EA User
  • *
  • Posts: 320
  • Karma: +15/-2
  • Model Sharing - Simplified
    • View Profile
    • Professional Model Collaboration
You are using a REFGUID Tagged value, and the RefGUID stores the GUID of the referenced item as its value. which then requires another step to get the actual item.

When I used to work on this I used to have a addin which will return me the actual item (element, or attriabute or operation) based on the GUID i get from this, and use that in my code templates.

PS - Have to check if there is any other way that allows me to get the value from code templates

camel2

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Thank you very much, that already helps me a lot!  :D