Home » Modeling » Papyrus » Epsilon EVL & UML Profiles(Validating design models with Epsilon EVL which are applying a UML Profile)
| | |
Re: Epsilon EVL & UML Profiles [message #1716520 is a reply to message #1716487] |
Fri, 04 December 2015 14:03 |
Ed Willink Messages: 7670 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 |
|
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 |
Alireza Rouhi Messages: 148 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 & UML Profiles [message #1716847 is a reply to message #1716667] |
Tue, 08 December 2015 14:34 |
Alireza Rouhi Messages: 148 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 & UML Profiles [message #1716904 is a reply to message #1716847] |
Tue, 08 December 2015 23:39 |
|
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 & UML Profiles [message #1716973 is a reply to message #1716904] |
Wed, 09 December 2015 11:18 |
Alireza Rouhi Messages: 148 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 & UML Profiles [message #1717033 is a reply to message #1716984] |
Wed, 09 December 2015 17:05 |
|
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 134 times)
|
|
| |
Goto Forum:
Current Time: Thu Sep 26 08:50:06 GMT 2024
Powered by FUDForum. Page generated in 0.04924 seconds
|