Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Problems using Ecore OCL for derived(New problem when Generating an Ecore project with OCL used for derived attributes)
Problems using Ecore OCL for derived [message #1853779] Mon, 18 July 2022 08:41 Go to next message
Avi Shaked is currently offline Avi ShakedFriend
Messages: 131
Registered: October 2019
Senior Member
Hi,

I used Ecore OCL within my Ecore modelling project for calculating a derived attribute in one of my projects.
Everything worked fine until about a month ago, but now I keep getting an error when doing code generation for the Ecore project stating "Errors occurred while generating code." The details are in the attached file.
Can you please help me resolve this?

Best regards,
Avi
Re: Problems using Ecore OCL for derived [message #1853816 is a reply to message #1853779] Tue, 19 July 2022 06:01 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Please ask OCL questions on the OCL forum / Papyrus questions on the Papyrus forum.

What you have presented is impossible since Eclipse OCL makes no use of EMFt and so the cannot modify without a write transaction cannot occur.

However you provide only a PNG rather than a full stack trace, so we cannot see what, presumably Papyrus, is part of the trimmed trace.

If this really is a use case that once worked, my best guess is that either Papyrus or OCL has evolved so that a Papyrus ResourceSet configured for EMFt is now exposed for re-use.

You therefore need to accurately report your use case and the versions that work and those that do not.

(OCL has been evolving and now uses a ThreadLocal rather than a ResourceSet adapter to cache the OCL context for which EMF provides no passing mechanism. It is possible that a sequence of two actions has passed something unhappy between OCL sessions. However that would imply that OCL was being invoked on the main rather than a worker thread, which would be a very bad practice. Looking at the PNG again, it might not be trimmed, it may be a worker thread as expected, so conversely if you are using an older version of Eclipse OCL, you may be demonstrating why I moved from a ResourceSet adapter that could share across threads in embarrassing ways to a Thread Local that cannot.)

Regards

Ed Willink
Re: Problems using Ecore OCL for derived [message #1853820 is a reply to message #1853816] Tue, 19 July 2022 07:42 Go to previous message
Avi Shaked is currently offline Avi ShakedFriend
Messages: 131
Registered: October 2019
Senior Member
Thank you for your detailed reply, Ed.

I would like to note this was not an OCL-related question and neither a Papyrus one.
I was using GEMOC Studio (not Papyrus) and thought the EMF are used in a straightforward manner, but it seems I was wrong and it was indeed the GEMOC platform that introduced a bug. I tried my design with native Eclipse and it works just fine.

Best regards,
Avi
Previous Topic:[CDO] Duplicating a branch
Next Topic:How can I see the exact query EMF executes?
Goto Forum:
  


Current Time: Thu Apr 25 01:41:52 GMT 2024

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

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

Back to the top