Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Epsilon EVL & UML Profiles(Validating design models with Epsilon EVL which are applying a UML Profile)
icon5.gif  Epsilon EVL & UML Profiles [message #1716487] Fri, 04 December 2015 10:40 Go to next message
Alireza Rouhi is currently offline Alireza RouhiFriend
Messages: 126
Registered: December 2015
Senior Member
Hi,

I have a serious problem on the usage of the Epsilon EVL language. I would like to validate my UML design model. I'm using the Papyrus Modeler together with the recent release of the Eclipse Mars to model a Pattern Language profile (currently, it is a sample model which I attached to this post).
I want to use the EVL to validate the applied patterns of the mentioned pattern language profile on my design model. But, the problem occurs on the applied stereotypes like Broker in the model.uml. The metamodel of the Pattern Language UML Profile is unknown for the Epsilon. Please, if it is possible for you, give me directions on resolving this problem.

Thank you very much,
Alireza
Re: Epsilon EVL & UML Profiles [message #1716515 is a reply to message #1716487] Fri, 04 December 2015 13:58 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 935
Registered: February 2011
Senior Member
No Message Body

Camille Letavernier
Re: Epsilon EVL & UML Profiles [message #1716518 is a reply to message #1716515] Fri, 04 December 2015 14:01 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 935
Registered: February 2011
Senior Member
Hi,

When registering your profile, you have 3 extension points to populate:

- EMF Dynamic Package: so that EMF knows about your metamodel (Profile)
- UML Dynamic Package: so that UML knows where to find your profile
- Papyrus UMLProfile: to register your profile in the Papyrus UI

So you need to add the org.eclipse.emf.ecore.dynamic_package and org.eclipse.uml2.uml.dynamic_package extension points

HTH,
Camille


Camille Letavernier
Re: Epsilon EVL & UML Profiles [message #1716520 is a reply to message #1716487] Fri, 04 December 2015 14:03 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6990
Registered: July 2009
Senior Member
Hi

I'm not aware of anyone doing this. Papyrus has support for OCL and, I
think, ALF constraints.

A number of users are successfully using the OCL support, but the number
of bugs raised demonstrates that this is not a trivial integration.
Unless you find that EVL is inherently supported, I recommend that you
use OCL.

Regards

Ed Willink


On 04/12/2015 13:55, Alireza Rouhi wrote:
> Hi,
>
> I have a serious problem on the usage of the Epsilon EVL language. I would like to validate my UML design model. I'm using the Papyrus Modeler together with the recent release of the Eclipse Mars to model a Pattern Language profile (currently, it is a sample model which I attached to this post).
> I want to use the EVL to validate the applied patterns of the mentioned pattern language profile on my design model. But, the problem occurs on the applied stereotypes like Broker in the model.uml. The metamodel of the Pattern Language UML Profile is unknown for the Epsilon. Please, if it is possible for you, give me directions on resolving this problem.
>
> Thank you very much,
> Alireza
Re: Epsilon EVL & UML Profiles [message #1716529 is a reply to message #1716520] Fri, 04 December 2015 15:26 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 1814
Registered: July 2009
Location: York, UK
Senior Member

Hi Alireza,

To make this work, you'll need to remove the profile URI from your UML model configuration in the Models tab of the EVL run configuration and rewrite your constraint as follows:

context Broker {
  constraint DefinesFindServer {
    check : self.base_Class.ownedOperation.
      exists(o: Operation | o.name = "find_server")
  }
}


Cheers,
Dimitris
Re: Epsilon EVL & UML Profiles [message #1716657 is a reply to message #1716529] Mon, 07 December 2015 10:17 Go to previous messageGo to next message
Alireza Rouhi is currently offline Alireza RouhiFriend
Messages: 126
Registered: December 2015
Senior Member
Dear Dimitris,
Thanks a lot for your helping comment and solution for my first problem.

Now, I like to check the existence of some operations like <<find_server>> stereotyped operation in my Broker stereotyped class definition. However, the stereotype property is not known for the EVL parser. Of course, I have defined the <<find_server>> stereotype in my patterns' profile which includes the Broker stereotype too. My used source code is as follows:

context Broker {
  constraint DefinesFindServer {  	
    check : self.base_Class.ownedOperation.stereotype.exists(s: Stereotype | s = "find_server")	
		message : "In Pattern " + self + ", Broker class, here " + 
			self.base_Class.name + ", must define a <<find_server>> stereotyped operation."
		fix {
			title : "Add a Find Server operation, stereotyped with <<find_server>>, to " + self.name
			do {
					var newOp : new Operation;
					newOp.name = "find_server";
					newOp.stereotype.add("find_server");
					newOp.class = self.base_Class;
			}
		}
	}
}


Kind regards,
Alireza
Re: Epsilon EVL &amp; UML Profiles [message #1716667 is a reply to message #1716657] Mon, 07 December 2015 11:35 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 1814
Registered: July 2009
Location: York, UK
Senior Member

Hi Alireza,

Off the top of my head, to apply a stereotype to newOp you'll probably need to call newOp.applyStereotype(...) and pass it a Stereotype instance as a parameter instead.

Cheers,
Dimitris
Re: Epsilon EVL &amp; UML Profiles [message #1716669 is a reply to message #1716667] Mon, 07 December 2015 12:30 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 935
Registered: February 2011
Senior Member
Hi,

I don't know about EVL, but in OCL (and UML in general), stereotypes can be accessed via the extension_S property (Where S is the name of the stereotype). For example:

self.base_Class.ownedOperation.extension_find_server

Element::extension_S is the opposite reference to Stereotype::base_E, but since it is a uml "Navigable property owned by the assocation", it doesn't need to exist in the actual metamodel. The tooling just needs to make it available/easily navigable (Concrete implementation is undefined). So it really depends on how EVL supports this specific UML concept.

You could also use the more standard (From the Ecore's point of view) getAppliedStereotypes() operation (And applyStereotype() to actually apply it, as mentioned by Dimitris)

HTH,
Camille


Camille Letavernier
Re: Epsilon EVL &amp; UML Profiles [message #1716847 is a reply to message #1716667] Tue, 08 December 2015 14:34 Go to previous messageGo to next message
Alireza Rouhi is currently offline Alireza RouhiFriend
Messages: 126
Registered: December 2015
Senior Member
Dear Dimitris,

I applied your suggestion as the following code:
context Broker {
  constraint DefinesFindServer {  	
    check : self.base_Class.ownedOperation.stereotype.exists(s: Stereotype | s = "find_server")	
		message : "In Pattern " + self + ", Broker class, here " + 
			self.base_Class.name + ", must define a <<find_server>> stereotyped operation."
		fix {
			title : "Add a Find Server operation, stereotyped with <<find_server>>, to " + self.base_Class.name
			do {
					var newOp : new Operation;
					newOp.name = "find_server";
					var stereotype = new Stereotype(PatternLanguage::BrokerPL::BrokerPattern::find_server);
					newOp.applyStereotype(stereotype);
					newOp.class = self.base_Class;
			}
		}
	}
}


But, as I said before, there is a problem on my profile metamodel registration (We removed it on the UML model configure wizard).
So, I switched to the UML Designer 5.0 to develop and register my pattern language profile as a plug-in.

Now, the following error message is displayed when I run the above EVL script:

Line: 1, Reason: mismatched input: '<'



Kind regards,
Alireza

[Updated on: Tue, 08 December 2015 14:52]

Report message to a moderator

Re: Epsilon EVL &amp; UML Profiles [message #1716904 is a reply to message #1716847] Tue, 08 December 2015 23:39 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 1814
Registered: July 2009
Location: York, UK
Senior Member

Hi Alireza,

There's no "find_server" stereotype as far as I can see in your profile so I'm not sure what you're trying to achieve with this code. Off the top of my head, the error message you're getting is probably because instead of pointing your run configuration to a .evl file you're pointing it to an XMI file.

Cheers,
Dimitris
Re: Epsilon EVL &amp; UML Profiles [message #1716973 is a reply to message #1716904] Wed, 09 December 2015 11:18 Go to previous messageGo to next message
Alireza Rouhi is currently offline Alireza RouhiFriend
Messages: 126
Registered: December 2015
Senior Member
Hi Dimitris,

Thanks a lot for your invaluable comments.
Please, see the attached plug-in. I want to verify a Broker stereotyped class which must have operations like find_server stereotyped operations along with other operations (if any).
To specify the must-have operations, I have defined the stereotyped operations like find_server here. Also, the applyStereotype() method has problem with the operation newOp in the following code too (error message: Method 'applyStereotype' not found for: Operation ...):

context Broker {
  constraint DefinesFindServer {  	
    check : self.base_Class.ownedOperation.exists(o: Operation | o.getAppliedStereotypes().includes(find_server))
		message : "In Pattern " + self + ", Broker class, here " + 
			self.base_Class.name + ", must define a <<find_server>> stereotyped operation."
		fix {
			title : "Add a Find Server operation, stereotyped with <<find_server>>, to " + self.base_Class.name
			do {
					var newOp : new Operation;
					newOp.name = "find_server";
					var stereotype = new find_server;
					newOp.class = self.base_Class;
					newOp.applyStereotype(stereotype);					
			}
		}
	}
}


Kind regards,
Alireza

[Updated on: Wed, 09 December 2015 11:42]

Report message to a moderator

Re: Epsilon EVL &amp; UML Profiles [message #1716977 is a reply to message #1716973] Wed, 09 December 2015 12:16 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 1814
Registered: July 2009
Location: York, UK
Senior Member

Hi Alireza,

The attached project doesn't include a .project file, an EVL file, a launch configuration or a sample UML model. Please see [1].

Cheers,
Dimitris

[1] http://www.eclipse.org/epsilon/doc/articles/minimal-examples/
Re: Epsilon EVL &amp; UML Profiles [message #1716984 is a reply to message #1716977] Wed, 09 December 2015 13:13 Go to previous messageGo to next message
Alireza Rouhi is currently offline Alireza RouhiFriend
Messages: 126
Registered: December 2015
Senior Member
Hi Dimitris,

Excuse me. Please, check the attached minExample.

Kind regards,
Alireza
Re: Epsilon EVL &amp; UML Profiles [message #1717033 is a reply to message #1716984] Wed, 09 December 2015 17:05 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 1814
Registered: July 2009
Location: York, UK
Senior Member

Hi Alireza,

Formulating your constraint as follows seems to be doing the trick.

pre {
	var findServerStereotype = Stereotype.all.selectOne(s|s.name = "find_server");
}

context Broker {
  constraint DefinesFindServer {  	
    check : self.base_Class.ownedOperation.exists(o: Operation | o.getAppliedStereotypes().includes(findServerStereotype))
		message : "In Pattern " + self + ", Broker class, here " + 
			self.base_Class.name + ", must define a <<find_server>> stereotyped operation."
		fix {
			title : "Add a Find Server operation, stereotyped with <<find_server>>, to " + self.base_Class.name
			do {
				var operationsProfile = Profile.all.selectOne(p|p.name = "Operations");
				Model.all.first.applyProfile(operationsProfile);
				
				var newOp = new Operation;
				newOp.name = "find_server";
				newOp.class = self.base_Class;
				newOp.applyStereotype(findServerStereotype);					
			}
		}
	}
}


I've also attached a copy of the project I had to put together to investigate this as an example of what I mean by "minimal" (for future reference).

Cheers,
Dimitris
  • Attachment: alireza.zip
    (Size: 3.88KB, Downloaded 82 times)
Re: Epsilon EVL &amp; UML Profiles [message #1717300 is a reply to message #1717033] Fri, 11 December 2015 13:34 Go to previous message
Alireza Rouhi is currently offline Alireza RouhiFriend
Messages: 126
Registered: December 2015
Senior Member
Dear Dimitris,

This is great. Thanks a lot for your invaluable comments and solution.

Kind regards,
Alireza

[Updated on: Fri, 11 December 2015 13:37]

Report message to a moderator

Previous Topic:Reusing Papyrus Sequence Diagram Editor
Next Topic:UML Profiles
Goto Forum:
  


Current Time: Fri Jan 22 04:27:24 GMT 2021

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

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

Back to the top