Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Properties of applied stereotypes in UML model by EOL (properties of applied stereotypes in UML model by EOL)
Properties of applied stereotypes in UML model by EOL [message #1747445] Mon, 14 November 2016 19:27 Go to next message
Mojtaba Bagherzadeh is currently offline Mojtaba BagherzadehFriend
Messages: 32
Registered: April 2016
Member
Hi All,

I am a new user of Epsilon (EOL) and trying to use that to refactor UMLRT models. I have a question regarding reading the applied stereotypes and their detail properties and updating them.

Attached project is a sample that I could get the applied stereotypes, But I didn't know how to get the detail properties of the stereotypes. For Instance, in the context of the attached example, the stereotype "CapsuleProperties" has a property called headerPreface, I need to read the value of this property and update it.
<RTCppProperties:CapsuleProperties xmi:id="_G5QN4AdzEeadtKuU2t6fMg" headerPreface="#include &lt;iostream>&#xA;#include &lt;unistd.h>&#xA;#include &quot;Config.h&quot;&#xA;#include &quot;SharedMem.h&quot;&#xA;#include &lt;map>&#xA;using namespace Comms;&#xA;using namespace ConfigUtil;" implementationPreface="" base_Class="_XIyCcAdxEeadtKuU2t6fMg"/>

the sample model for running example is sampleModel.uml and required metamodels located at Metamodels folder.

Thanks a lot for your help and support.

Thanks
Moji

Re: Properties of applied stereotypes in UML model by EOL [message #1747554 is a reply to message #1747445] Tue, 15 November 2016 21:22 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 1583
Registered: July 2009
Location: York, UK
Senior Member

Hi Moji,

I'm not able to load the UML model provided in the tree-based UML editor due to pathmap://-related errors. Off the top of my head, you should be able to use .headerPreface to get/set the value of the property.

Cheers,
Dimitris
Re: Properties of applied stereotypes in UML model by EOL [message #1747567 is a reply to message #1747445] Wed, 16 November 2016 01:50 Go to previous messageGo to next message
Mojtaba Bagherzadeh is currently offline Mojtaba BagherzadehFriend
Messages: 32
Registered: April 2016
Member
Hi Dimitris,
Thanks for helping me. I had tried that(s.headerPreface.println(), s.HeaderPreface.println() and s.headerpreface.println() ) and It did not work, It gave "Property 'headerPreface' not found in object Stereotype" error.

I also have the pathmap error, but if you switch to detail tab, you can see the model elements. I attached the screenshots of the model that shows the detail properties of stereotype in UML tree view editor.
Also, you can find all required metamodel in the metamodel folder of the attached project.

Thanks
Moji
Re: Properties of applied stereotypes in UML model by EOL [message #1747596 is a reply to message #1747567] Wed, 16 November 2016 11:54 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 1583
Registered: July 2009
Location: York, UK
Senior Member

Hi Moji,

I'd need an error-free setup to try this I'm afraid. So again, off the top of my head you should not try to access .headerPreface on the Stereotype object, but on the model element to which the Stereotype is applied.

Cheers,
Dimitris
Re: Properties of applied stereotypes in UML model by EOL [message #1747813 is a reply to message #1747445] Wed, 16 November 2016 16:45 Go to previous messageGo to next message
Mojtaba Bagherzadeh is currently offline Mojtaba BagherzadehFriend
Messages: 32
Registered: April 2016
Member
Hi Dimitris,
Thanks for the help and support, I tried to access the model element but same error. Attached is an example with fixed model (the pathmap error is fixed).

Thanks
Mojtaba
Re: Properties of applied stereotypes in UML model by EOL [message #1747927 is a reply to message #1747813] Wed, 16 November 2016 20:55 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 1583
Registered: July 2009
Location: York, UK
Senior Member

The pathmap errors persist I'm afraid.

index.php/fa/27605/0/

Cheers,
Dimitris
Re: Properties of applied stereotypes in UML model by EOL [message #1747931 is a reply to message #1747927] Wed, 16 November 2016 21:44 Go to previous messageGo to next message
Mojtaba Bagherzadeh is currently offline Mojtaba BagherzadehFriend
Messages: 32
Registered: April 2016
Member
Hi Dimitris,

Sorry about that, I didn't notice that these pathmaps are defined by PapyrusRT, and you don't have those pathmaps in your eclipse setup. In new attached version, I changed all pathmap to the local path(Metamodels/..) and it should be loaded correctly now. In case if I miss updating any of them, please replace the pathmap with a local one. (e.g: href="pathmap::/UML_RT_PROFILE/uml-rt.profile.uml" --> href="MetaModels/uml-rt.profile.uml" ).

Thanks for the help and support.


Thanks
Mojtaba
Re: Properties of applied stereotypes in UML model by EOL [message #1747934 is a reply to message #1747931] Wed, 16 November 2016 22:54 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 1583
Registered: July 2009
Location: York, UK
Senior Member

Hi Moji,

When I set up my model in the EOL launch configuration as follows:

index.php/fa/27607/0/

the EOL program below almost works

CapsuleProperties.all.first.headerPreface = "foo";


In my setup I'm getting a ClassCastException when I'm trying to set the property but I suspect that this is due to the manual porting of the profiles, so it might work in your setup.

Cheers,
Dimitris
  • Attachment: uml-model.png
    (Size: 73.13KB, Downloaded 184 times)
Re: Properties of applied stereotypes in UML model by EOL [message #1747936 is a reply to message #1747934] Wed, 16 November 2016 23:45 Go to previous messageGo to next message
Mojtaba Bagherzadeh is currently offline Mojtaba BagherzadehFriend
Messages: 32
Registered: April 2016
Member
Hi Dimitris,

I appreciate your help. It worked.

To conclude this problem, getAppliedStereotypes only return a stereotype. Using that, we can't access or change the detail properties applied by that stereotypes. So, to access or change the detail properties, we need to read the stereotypes at the model level (not stereotype or element). Here is the EOL code that worked in the context of discussed example, using base_Class it relates each class to an applied stereotype.

for (c in allClasses){
appliedStreotypeDetail=CapsuleProperties.all.selectOne(p|p.base_Class=c );
appliedStreotypeDetail.println();
}

Thanks
Moji
Re: Properties of applied stereotypes in UML model by EOL [message #1747937 is a reply to message #1747936] Thu, 17 November 2016 00:07 Go to previous message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 1583
Registered: July 2009
Location: York, UK
Senior Member

Hi Moji,

Great - glad this helped!

Cheers,
Dimitris
Previous Topic:Provide getter for thrown object in EolUserException
Next Topic:Using EWL or EOL
Goto Forum:
  


Current Time: Tue Sep 18 17:28:10 GMT 2018

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

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

Back to the top