Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Papyrus for Real Time » RTFactory utility class for Papyrus-RT(An RSA RTE equivalent utility for Papyrus-RT)
RTFactory utility class for Papyrus-RT [message #1742720] Tue, 06 September 2016 21:22 Go to next message
reza ahmadi is currently offline reza ahmadiFriend
Messages: 47
Registered: September 2016
Member
Hi,
I am looking for RTFactory class (implemented in RSA RTE) in Papyrus-RT implementation or some class which could offer the same services. One scenario which I do need for now is this:

bool b = RTFactory.CapsuleFactory.isCapsule(obj);

Assuming obj is a Capsule, b is true.
Re: RTFactory utility class for Papyrus-RT [message #1742723 is a reply to message #1742720] Tue, 06 September 2016 22:23 Go to previous messageGo to next message
Ernesto Posse is currently offline Ernesto PosseFriend
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 Go to previous messageGo to next message
reza ahmadi is currently offline reza ahmadiFriend
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

Re: RTFactory utility class for Papyrus-RT [message #1747620 is a reply to message #1743171] Wed, 16 November 2016 14:37 Go to previous message
Patrik Nandorf is currently offline Patrik NandorfFriend
Messages: 195
Registered: January 2013
Location: Sweden
Senior Member
Hi Reza,

Maybe I'm missing what you're after but isn't getBase_Class() what you want?

/Patrik
Previous Topic:Papyrus-RT 0.8 is available!
Next Topic:Reuse/extend the UML-RT Capsule Structure Diagram
Goto Forum:
  


Current Time: Tue Oct 08 15:40:05 GMT 2024

Powered by FUDForum. Page generated in 0.06143 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top