Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
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 Go to next message
MinhTu TonThat is currently offline MinhTu TonThatFriend
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 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
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,
Re: OCL closure works properly with Interactive OCL, not Interactive Xtext OCL [message #1062939 is a reply to message #1062938] Tue, 11 June 2013 13:31 Go to previous messageGo to next message
MinhTu TonThat is currently offline MinhTu TonThatFriend
Messages: 38
Registered: February 2012
Member
It seems like what you detected in the bug, it stops getting deeper on the siblings of an already encountered node. I'm using Eclipse Juno with OCL Examples and Editors v.3.2.2.v20130130-1128. Should I get it updated?

Best regards,
Re: OCL closure works properly with Interactive OCL, not Interactive Xtext OCL [message #1062947 is a reply to message #1062939] Tue, 11 June 2013 14:03 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Kepler is officially released on June 26th, so you might just wait till
then.

However you should find that the Kepler milestones and release
candidates work on Juno so long as you update the dependencies too
(Xtext probably).

So if you're very brave just do Install New Software from
http://download.eclipse.org/releases/kepler and select Modeling OCL and
Xtext.

Regards

Ed Willink




On 11/06/2013 14:31, Capi Tali wrote:
> It seems like what you detected in the bug, it stops getting deeper on
> the siblings of an already encountered node. I'm using Eclipse Juno
> with OCL Examples and Editors v.3.2.2.v20130130-1128. Should I get it
> updated?
>
> Best regards,
Re: OCL closure works properly with Interactive OCL, not Interactive Xtext OCL [message #1062953 is a reply to message #1062947] Tue, 11 June 2013 14:13 Go to previous message
MinhTu TonThat is currently offline MinhTu TonThatFriend
Messages: 38
Registered: February 2012
Member
Hi,
Thanks for your suggestions. I think I'll just ... wait then Wink.

Many thanks.
Previous Topic:Setting up OCLInEcore and standalone junit
Next Topic:How to pass a java variable to OCL statement?
Goto Forum:
  


Current Time: Thu Mar 28 13:00:45 GMT 2024

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

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

Back to the top