Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » OCL Classic vs OCL Pivot: IllegalArgumentException:(Same projects but in Pivot invariant name == null)
OCL Classic vs OCL Pivot: IllegalArgumentException: [message #1810373] Thu, 08 August 2019 22:40 Go to next message
Daniel San Martín is currently offline Daniel San MartínFriend
Messages: 45
Registered: October 2012
Member
Hello,


I attached two projects that verify one constraint. One of them was developed with OCL classic and the other one with Pivot (both standalone). With classic the restriction can be check but with pivot, it raises IllegalArgumentException and the name of the invariant is null.

Why does it happen? What do I am doing wrong?. Constraint folder holds constraint.ocl and Model folder holds the model instance.

Regards,

Daniel.

[Updated on: Thu, 08 August 2019 22:43]

Report message to a moderator

Re: OCL Classic vs OCL Pivot: IllegalArgumentException: [message #1810374 is a reply to message #1810373] Fri, 09 August 2019 01:59 Go to previous messageGo to next message
Daniel San Martín is currently offline Daniel San MartínFriend
Messages: 45
Registered: October 2012
Member
[UPDATE]

When I change the OCL method "check" by "evaluate" it returns an object which is a boolean and the validation executes without problems. but still I do not understand why check method raises the error.
Re: OCL Classic vs OCL Pivot: IllegalArgumentException: [message #1810416 is a reply to message #1810374] Fri, 09 August 2019 21:03 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Thanks for the repros which unfortunately requires Modisco that is now hard to install. The project documentation is over four years out if date and has not been updated since Modisco stopped contributing to the regular Eclipse release. Attempting to install the latest update fails since EMF Facet has also vanished and I have no desire to install EMF Facet in my workspace.

The check() API was re-instated in the Pivot OCL to 'ease' Classic OCL migration / compatibility, however I find the old facade methods unhelpful and so never use more than evaluate which is able to exploit the much improved ExpressionInOCL.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=549949 raised to investigate.

Regards

Ed Willink
Re: OCL Classic vs OCL Pivot: IllegalArgumentException: [message #1814152 is a reply to message #1810416] Wed, 04 September 2019 20:32 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Ed Willink wrote on Fri, 09 August 2019 17:03
Hi
The check() API was re-instated in the Pivot OCL to 'ease' Classic OCL migration / compatibility, however I find the old facade methods unhelpful and so never use more than evaluate which is able to exploit the much improved ExpressionInOCL.


The old API took an OCLExpression argument (unsuitable since no context/parameters available) or a Constraint (too detailed since Constraints not always in use).

The new API takes an ExpressionInOCL argument - just right.

If you invoke as

boolean check = ocl.check(structureModel, expressionInOCL);


rather than

boolean check = ocl.check(structureModel, expressionInOCL.getOwningConstraint());


you use the better API that is JUnit tested.

Regards

Ed Wllink
Re: OCL Classic vs OCL Pivot: IllegalArgumentException: [message #1814154 is a reply to message #1814152] Wed, 04 September 2019 21:34 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Ed Willink wrote on Wed, 04 September 2019 16:32
...
you use the better API that is JUnit tested.


Yes. But the actual bug is a conflict betwen KDM's Boolean and OCL's which affects both variants of check(). Fixed in 2019-09RC2.

Regards

Ed Willink
Previous Topic:OCL editor exception in eclipse
Next Topic:Problem with OCL code while comparing the same class attribute of two instances
Goto Forum:
  


Current Time: Sun May 05 18:31:20 GMT 2024

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

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

Back to the top