Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » EOL: Access to UML Papyrus Stereotypes and their tagged value through EOL
EOL: Access to UML Papyrus Stereotypes and their tagged value through EOL [message #1404588] Mon, 04 August 2014 10:41 Go to next message
Paraskevi Zerva is currently offline Paraskevi ZervaFriend
Messages: 2
Registered: August 2014
Junior Member
Hello,

I am new to EOL. I have a question with regards to accessing UML stereotypes and their tagged value through EOL. I have actually created a UML activity model by using Papyrus UML tools (based on the UML 2 standard) and also created a profile with a special type of stereotype that gets a tagged value of type string as a property. Then I apply the profile with the defined stereotype to the action model elements of my UML model.

My problem is that I would like to access all the possible action model elements in my UML model that have a stereotype and get their tagged value in order then to process this value accordingly, but the thing is that I am not sure whether sth like the following can be supported for Papyrus UML as it seems that UML!ModelElement can not be found and throws the following EXCEPTION: Type 'UML!ModelElement' not found

operation UML!ModelElement hasStereotype(name : String) : Boolean
{
return self . stereotype . exists ( st :UML2!Stereotype|st.name = name);
}

Do you have any other proposals of how I can access Papyrus UML stereotypes through EOL?

Thanks,
Paraskevi
Re: EOL: Access to UML Papyrus Stereotypes and their tagged value through EOL [message #1404708 is a reply to message #1404588] Tue, 05 August 2014 08:50 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

Hi Paraskeyi,

Off the top of my head, if the profile has been correctly applied, X.all should return all model elements stereotyped as X. If this doesn't work, please attach a minimal example [1] containing the profile and a sample model so that I can investigate further.

Cheers,
Dimitris

[1] https://www.eclipse.org/epsilon/doc/articles/minimal-examples/
Re: EOL: Access to UML Papyrus Stereotypes and their tagged value through EOL [message #1405101 is a reply to message #1404708] Wed, 06 August 2014 15:32 Go to previous messageGo to next message
Paraskevi Zerva is currently offline Paraskevi ZervaFriend
Messages: 2
Registered: August 2014
Junior Member
Hi Dimitris,

Thanks for your response. Here is the details for the minimal example you have asked for.

Epsilon/Papyrus version used

version of Epsilon: Epsilon Core 1.1.0.201309101707 org.eclipse.epsilon.core.feature.feature.group Eclipse.org
version of Papyrus: Papyrus UML (Incubation) 0.10.2.v201402191554 org.eclipse.papyrus.sdk.feature.feature.group Eclipse Modeling Project

Instructions for reproducing the problem:

Open the minExampleStereotype project and run launch.xml

(I was not able to recreate properly the launch file as requested in the minimal example instructions as there
is bug keep coming up like Undefined variable, type or model: 'ProvExD)

The project is composed of the following files:
1) ProvExD.uml that contains the minimal example of uml activity diagram with 2 stereotyped model elements
2) ProvExD.profile.uml that contains our applied profile with the stereotype action provRecording
3)ProvExDtoKati.eol that contains the eol code with three cases where we try to access the model elements of ProvExD.uml that have a stereotype provRecording
and their tagged value property ''provConcepts''

In case 1 the code will print all the possible model elements along with the model elements where there has been a stereotyped applied with the name ProvRecording.
Yet this is not enough:
1) in order to understand which model elements are the ones where a stereotype ProvRecording has been applied and
2) how we can get the tagged sting value, namely ''provConcepts'', associated with each stereotyped model element.

In case 2 the code identifies the stereotyped model elements by introducing an advanced classifier property ''Stereotype'' in the ProvExD.uml file
Therefore the following code will identify and print all the model elements with a classifier property since we can not find any operation hasStereotype in EOL.
Yet what would have been helpful is to identify a model element with a classifier property of type stereotype in order to be more specific.//


In case 3 the code identifies and prints the model elements with a provConcepts property value in our model. Yet, it is not possibly to associate this property value
of provConcepts with the corresponding stereotyped model element.

Ideally I would like to have an operation or a way to identify the stereotyped model elements in my Uml model and print for them the value of the tagged property provConceptsbut. Since no hasStereotype method exists in EOL I have not managed to find a work around to do this through EOL properly.

E.g. for the minimal uml example I would like to identify the stereotyped actions
i.e., Prov Service Execution and then print their tagged value i.e.,

A:AtomicServiceExecution serviceprov:executionOf :Service,
:Service serviceprov:serviceName :ServiceName,
A:AtomicServiceExecution prov:wasAssociatedWith :Server,
:Server serviceprov:hadPort ''PortValue'' ,
:Server serviceprov:hadIPaddress ''IPaddressValue'',
:Association prov:agent :Server,
:ServiceExecution prov:qualifiedAssociation :Association,
:Association prov:hadRole :Role,
:Role serviceprov:ServiceExecutionServer,
:AtomicServiceExecution prov:used :Message,
:Message prov:hadMember :Parameter,
:Message prov:wasGeneratedBy :AtomicServiceExecution,
:ServiceExecution serviceprov:hadNFP ''NFPvalue'',
:ServiceExecution prov:startedAtTime ''startValue'',
:ServiceExecution prov:endedAtTime ''stendValue''

Similarly, I would like to do the same for other stereotyped elements like the Prov Orchestration.

Do you have any proposals for how we can identify the elements with the stereotyped values and associate these to their tagged value property?


Thanks for your time,
Paraskevi
Re: EOL: Access to UML Papyrus Stereotypes and their tagged value through EOL [message #1405371 is a reply to message #1405101] Thu, 07 August 2014 07:48 Go to previous message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

Hi Paraskevi,

The following should do the trick:

for (pr in ProvRecording.all) {
pr.provConcepts.println();
}

Regarding the launch configuration, to make it work you'll need to add to it a reference to your model through the Models tab [1].

Cheers,
Dimitris

[1] https://dl.dropboxusercontent.com/u/5636547/provexd-configuration.png
Previous Topic:Can't delete nodes in compartment
Next Topic:The method of createInstances()
Goto Forum:
  


Current Time: Tue Apr 23 13:07:02 GMT 2024

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

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

Back to the top