Home » Modeling » OCL » OCL closure works properly with Interactive OCL, not Interactive Xtext OCL
OCL closure works properly with Interactive OCL, not Interactive Xtext OCL [message #1062936] |
Tue, 11 June 2013 13:09 |
MinhTu TonThat Messages: 38 Registered: February 2012 |
Member |
|
|
Hello everyone,
I encounter a strange problem with Interactive Xtext OCL editor. I attach here the UML model I used to evaluate a constraint using OCL closure operation. The OCL constraint is as follows:
self -> asSet() -> closure(v | v.class.oclAsType(Component).ownedAttribute
-> select(p : Property | v <> p and v.class.oclAsType(Component).ownedConnector -> exists(end.partWithPort -> includes(p) and end.partWithPort -> includes(v)))
-> asSet())
This constraint is evaluated at either 5 Properties (comp1, comp2, comp3, comp4, comp5) nested in the component MainComp (We can evaluate the mentioned constraint by simply clicking at one of 5 above properties and writing down the constraint in the Interactive Xtext OCL editor). To be clear, the constraint finds out the connected elements of self. It searches the properties in the containing components that share a common connector with self. Through the closure operation, it searches the connected properties, the connected properties of connected properties, ans so on...
The problem is:
1) Sometimes the Interactive Xtext OCL notifies "Evaluation failure". To get rid of this notification, I typed in another random constraint (e.g. self.name) and the editor works again normally.
2) Because 5 properties above are all connected to each other, the result for evaluating the constraint on each property should be all 5 properties. With Interactive OCL editor, I always get the wishing results. However, using Interactive Xtext OCL editor, for some properties among the 5, I only get 4 properties as result.
I'm sorry because I couldn't find another simpler example. I tried the one with parent->closure(children) but in this case both editors give the same results.
Any help would be appreciated.
Best regards,
|
|
|
Re: OCL closure works properly with Interactive OCL, not Interactive Xtext OCL [message #1062938 is a reply to message #1062936] |
Tue, 11 June 2013 13:22 |
Ed Willink Messages: 7655 Registered: July 2009 |
Senior Member |
|
|
Hi
What version are you using.
The problem seems rather like
https://bugs.eclipse.org/bugs/show_bug.cgi?id=401302 which was fixed in M6.
Regards
Ed Willink
On 11/06/2013 14:09, Capi Tali wrote:
> Hello everyone,
> I encounter a strange problem with Interactive Xtext OCL editor. I attach here the UML model I used to evaluate a constraint using OCL closure operation. The OCL constraint is as follows:
>
> self -> asSet() -> closure(v | v.class.oclAsType(Component).ownedAttribute
> -> select(p : Property | v <> p and v.class.oclAsType(Component).ownedConnector -> exists(end.partWithPort -> includes(p) and end.partWithPort -> includes(v)))
> -> asSet())
>
> This constraint is evaluated at either 5 Properties (comp1, comp2, comp3, comp4, comp5) nested in the component MainComp (We can evaluate the mentioned constraint by simply clicking at one of 5 above properties and writing down the constraint in the Interactive Xtext OCL editor). To be clear, the constraint finds out the connected elements of self. It searches the properties in the containing components that share a common connector with self. Through the closure operation, it searches the connected properties, the connected properties of connected properties, ans so on...
>
> The problem is:
> 1) Sometimes the Interactive Xtext OCL notifies "Evaluation failure". To get rid of this notification, I typed in another random constraint (e.g. self.name) and the editor works again normally.
> 2) Because 5 properties above are all connected to each other, the result for evaluating the constraint on each property should be all 5 properties. With Interactive OCL editor, I always get the wishing results. However, using Interactive Xtext OCL editor, for some properties among the 5, I only get 4 properties as result.
>
> I'm sorry because I couldn't find another simpler example. I tried the one with parent->closure(children) but in this case both editors give the same results.
>
> Any help would be appreciated.
> Best regards,
|
|
| | | |
Goto Forum:
Current Time: Thu Mar 28 13:00:45 GMT 2024
Powered by FUDForum. Page generated in 0.02931 seconds
|