Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: alexM on November 25, 2014, 01:35:40 am

Title: show  inherited tags in custom elements
Post by: alexM on November 25, 2014, 01:35:40 am
I'm realizing a custom profile and I'm writing a shape script for each stereotype , the my question is:  is there any function, to use in a  stereotype shape script, to show inherited tags (like "HasTag()" for 'simple' tag)?  

Thanks a lot !
Title: Re:  show  inherited tags in custom elements
Post by: qwerty on November 25, 2014, 03:49:12 am
The HasTag("<tv>") and HasTag("<tv>", "<value>") works only on TVs for the very element. It does not recognize inherited TVs. You might use the addin-escape like
Code: [Select]
hasproperty('addin:myAddIn,TVtest','TVname')to do that in an addin.

q.
Title: Re:  show  inherited tags in custom elements
Post by: alexM on November 25, 2014, 08:28:46 pm
Thank you very much for your answer.

I do not have much familiarity with the "add-in" topic,  can you give me any reference on which to go into that ?!

Title: Re:  show  inherited tags in custom elements
Post by: qwerty on November 25, 2014, 09:08:25 pm
I for myself had implemented it only once or twice to see it's working. YOu need to write an addin in the language of your choice and implement any method (in the example it's TVtest). EA will then can call this method and supply the parameters (in above example there are not parameters, you'd need to supply them comma-separated after the function name) to be processed. In return a string is expected which you can use in a print statement inside the shape script, e.g.
Code: [Select]
print("#addin:myAddIn,pFunc1#")Geert Bellekens has a blog about how to write an addin (in some Cxx) which is recommended by many people. Honestly I haven't read it since I made my way earlier on a very different path :D but even without reading I can recommend it.

q.
Title: Re:  show  inherited tags in custom elements
Post by: alexM on November 25, 2014, 09:22:45 pm
thank you so much for the advice!  :)