|
Re: RTFactory utility class for Papyrus-RT [message #1742723 is a reply to message #1742720] |
Tue, 06 September 2016 22:23 |
Ernesto Posse Messages: 438 Registered: March 2011 |
Senior Member |
|
|
Hi Reza.
Our API doesn't match the RSA-RTE API literally.
The answer depends on what type of model you are working with: is your model a UML2 model (from a .uml file) or are you working with the intermediate representation (XtUML-RT) used for code-generation/analysis, etc.? Also, does your code need to work in stand-alone mode or can it assume that it is running on Eclipse with Papyrus running?
You can find a factory class in the o.e.prt.umlrt.profile plugin in the utils package, but this is an actual factory to create instances, not an API for querying whether an eObject is, e.g. a Capsule or not.
For such queries, the answer depends on whether your code needs to run in stand-alone or it runs on Eclipse with Papyrus running, and whether you are working with UML models or with the intermediate representation (XtUML-RT):
1) If you are working with UML models (from a .uml file):
a) If your code should run on Eclipse with Papyrus, look at the o.e.prt.umlrt.core plugin, in particular the 'utils' sub-package
b) If your code must run in stand-alone, look at: o.e.prt.xtumlrt.external: the 'UMLRTProfileUtil' class in the 'predefined' sub-package for working with UML models (also works in Eclipse/Papyrus)
2) If you are working with XtUML-RT models: o.e.prt.xtumlrt.util: the 'XTUMLRTUtil' class, for working with XtUML-RT models (works on both stand-alone and in Eclipse/Papyrus)
Hope this helps.
|
|
|
Re: RTFactory utility class for Papyrus-RT [message #1743171 is a reply to message #1742723] |
Mon, 12 September 2016 22:41 |
reza ahmadi Messages: 47 Registered: September 2016 |
Member |
|
|
Hi Ernesto,
Thank you very much for the reply. That class was very useful.
In fact I am using Papyrus-RT in Eclipse, and for model analysis.
Now I have one more question:
I wonder how to get UML2 object of a Papyrus-RT's capsule object? For example, getUML2Class() does that in IBM RSA-RTE, as below:
NamedElement ne = capsule.getUML2Class();
I found UML2Util.getUMLClass(model, name), which seems suitable, but still not sure how to obtain model object to use this utility.
Thanks!
Reza
[Updated on: Tue, 13 September 2016 19:43] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.06143 seconds