Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Xtext + OCL
Xtext + OCL [message #1838599] Tue, 02 March 2021 09:35 Go to next message
Anthony Nillar is currently offline Anthony NillarFriend
Messages: 74
Registered: May 2014
Member
Hi all,

I would like to integrate the OCL invariants within my Xtext editor. To do this, I just followed this example (Complete OCL for Xtext Validation) [1].

It does not seem to work in my case and Eclipse raised the following error:

201964 [Worker-5: Building] ERROR org.eclipse.xtext.validation.CompositeEValidator - Error executing EValidator
org.eclipse.ocl.pivot.internal.utilities.IllegalLibraryException: No OCL Standard Library content available
at org.eclipse.ocl.pivot.internal.StandardLibraryImpl.getRequiredLibraryType(StandardLibraryImpl.java:879)
at org.eclipse.ocl.pivot.internal.StandardLibraryImpl.resolveRequiredSimpleType(StandardLibraryImpl.java:1016)
at org.eclipse.ocl.pivot.internal.StandardLibraryImpl.getOclInvalidType(StandardLibraryImpl.java:742)
at org.eclipse.ocl.pivot.internal.StandardLibraryImpl.getOclInvalidProperty(StandardLibraryImpl.java:722)
at org.eclipse.ocl.pivot.internal.ecore.es2as.Ecore2ASReferenceSwitch.<init>(Ecore2ASReferenceSwitch.java:96)
at org.eclipse.ocl.pivot.internal.ecore.es2as.Ecore2AS.<init>(Ecore2AS.java:219)

Please, find attached the minimal example.
I am using Windows 10, Eclipse 2020-09 (4.17.0) and Xtext 2.23.

Did I miss something?

Thanks in advance!

Cheers,
Anthony

[1] https://help.eclipse.org/2020-12/index.jsp?topic=%2Forg.eclipse.ocl.doc%2Fhelp%2FIntegration.html&cp%3D69_1_10_4&anchor=CompleteOCLforXtextValidation
Re: Xtext + OCL [message #1838621 is a reply to message #1838599] Tue, 02 March 2021 15:44 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7129
Registered: July 2009
Senior Member
Hi

Works fine for me interactively. If I create temp.states with content "Hello yyyyyyyy !" I get a "Greetings can be maximum 5 chatacters" warning.

Ah! But if I let OCL or Xtext builders perform the validation I see your stack trace from the Worker Thread.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=571621 raised.

"No OCL Standard Library content available" is usually a simple initialization error so a 'one-line' fix might just make it into 2021-03.

For now use the interactive validation and disable the Xtext nature and do not include states as an OCL nature extension.

Regards

Ed Willink
Re: Xtext + OCL [message #1838637 is a reply to message #1838621] Tue, 02 March 2021 18:18 Go to previous messageGo to next message
Anthony Nillar is currently offline Anthony NillarFriend
Messages: 74
Registered: May 2014
Member
Hi Ed,

Thanks! I will use for now the interactive validation.

Cheers,
Antonio
Re: Xtext + OCL [message #1838660 is a reply to message #1838637] Wed, 03 March 2021 08:21 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7129
Registered: July 2009
Senior Member
Hi

It doesn't seem that simple. A recent improvmeent to avoid churning allInstances/implicitOpposites caches may be making it more complicated in my workspace, but even after reverting to M2 I find it difficult to get consistent behaviour. Sometimes background validation is good, sometimes interactive, sometimes everything is blank. Definitely something wrong. Sorry, no solid workaround/fix yet.

Regards

Ed Willink
Re: Xtext + OCL [message #1838807 is a reply to message #1838660] Fri, 05 March 2021 11:06 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7129
Registered: July 2009
Senior Member
Hi

If you install from https://ci.eclipse.org/ocl/job/ocl-branch-tests/261/artifact/targetPlatform/ you should find the OCL validation much improved.

Regards

Ed Willink
Re: Xtext + OCL [message #1839808 is a reply to message #1838807] Mon, 29 March 2021 10:53 Go to previous messageGo to next message
Anthony Nillar is currently offline Anthony NillarFriend
Messages: 74
Registered: May 2014
Member
Hi Ed.

Thank you so much! I just did it and it works!

Kind regards,
Anthony
Re: Xtext + OCL [message #1839811 is a reply to message #1839808] Mon, 29 March 2021 10:58 Go to previous messageGo to next message
Anthony Nillar is currently offline Anthony NillarFriend
Messages: 74
Registered: May 2014
Member
Hi,

Just one thing. Build 261 does not work for me. I use 264. https://ci.eclipse.org/ocl/job/ocl-branch-tests/264/artifact/targetPlatform/

Thanks again!

Kind regards,
Anthony
Re: Xtext + OCL [message #1839833 is a reply to message #1839811] Mon, 29 March 2021 18:28 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7129
Registered: July 2009
Senior Member
Hi

The branch-tests job is for WIP. Build 261 is long gone. Build 264 (8-Mar-2021) is later/better. The regular 2021-03 release (10-Mar-2021) should be even better. Visit http://www.eclipse.org/modeling/download.php?file=/modeling/mdt/ocl/downloads/drops/6.14.0/R202103100557/mdt-ocl-Update-6.14.0.zip

Regards

Ed Willink
Previous Topic:Xbase customization - Problem introducing support for IN construct in my language
Next Topic:discouraged access to org.eclipse.xtext.ui.wizard.template contents
Goto Forum:
  


Current Time: Fri May 14 11:37:20 GMT 2021

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

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

Back to the top