Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » OCL closure operation
OCL closure operation [message #1852704] Wed, 01 June 2022 14:22 Go to next message
Yves BERNARD is currently offline Yves BERNARDFriend
Messages: 146
Registered: July 2014
Senior Member
Hello,
I didn't succeed in using the OCL closure operation in my ATL rule. Do I do something wrong or is it simply not implemented by SimpleOCL?

Thanks.


Yves
Re: OCL closure operation [message #1852706 is a reply to message #1852704] Wed, 01 June 2022 16:36 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 581
Registered: September 2012
Location: Belgium
Senior Member

Not sure what you're trying to do: SimpleOCL is a separate language/plugin that compiles to EMFTVM bytecode. You can import SimpleOCL modules in ATL, and invoke the helpers you defined in SimpleOCL, including those that take lambda parameters. See also https://github.com/dwagelaar/simpleocl/blob/master/org.eclipselabs.simpleocl.tests/test-data/iterators.simpleocl

Cheers,
Dennis
Re: OCL closure operation [message #1852712 is a reply to message #1852706] Thu, 02 June 2022 06:02 Go to previous messageGo to next message
Yves BERNARD is currently offline Yves BERNARDFriend
Messages: 146
Registered: July 2014
Senior Member
Hello Dennis,
Basically I just want to use the standard OCL "closure" operation in ATL rules. I was speaking about SimpleOCL because my understanding was that the OCL engine used by ATL is SimpleOCL. That said, I was not aware of this ability to import SimpleOCL modules. I suppose it relies on the same "uses" directive than that for importing ATL modules?


Yves
Re: OCL closure operation [message #1852716 is a reply to message #1852712] Thu, 02 June 2022 06:54 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 581
Registered: September 2012
Location: Belgium
Senior Member

Yves BERNARD wrote on Thu, 02 June 2022 08:02
Hello Dennis,
I suppose it relies on the same "uses" directive than that for importing ATL modules?

Yes, it does!

Note that ATL/EMFTVM itself is based on OCL 2.2: see also https://wiki.eclipse.org/ATL/EMFTVM#Additional_API


Cheers,
Dennis
Re: OCL closure operation [message #1852733 is a reply to message #1852716] Thu, 02 June 2022 12:13 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 581
Registered: September 2012
Location: Belgium
Senior Member

I've added an example here: https://github.com/dwagelaar/atl.examples/tree/main/ATLWithSimpleOCL

Cheers,
Dennis
Re: OCL closure operation [message #1852737 is a reply to message #1852733] Thu, 02 June 2022 13:08 Go to previous messageGo to next message
Yves BERNARD is currently offline Yves BERNARDFriend
Messages: 146
Registered: July 2014
Senior Member
This is very helpful.

Thank you Dennis ! :-)


Yves
Re: OCL closure operation [message #1854509 is a reply to message #1852704] Tue, 23 August 2022 07:11 Go to previous messageGo to next message
Yves BERNARD is currently offline Yves BERNARDFriend
Messages: 146
Registered: July 2014
Senior Member
Sorry for the late follow up on this, I had to switch to another task. I'm back on this topic now.

Actually the sample example does not run on my computer. Instead, I get the following error message:

org.eclipse.m2m.atl.emftvm.util.VMException: Error during module loading: Error during module loading: Module Helpers not found

I confirm that simpleOCL is installed (from Eclipse "Installed Software" dialog):
SimpleOCL 2.1.0.202001021418 org.eclipselabs.simpleocl.feature.feature.group EclipseLabs


Yves

[Updated on: Tue, 23 August 2022 07:11]

Report message to a moderator

Re: OCL closure operation [message #1854550 is a reply to message #1854509] Wed, 24 August 2022 20:11 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 581
Registered: September 2012
Location: Belgium
Senior Member

The SimpleOCL builder is a bit primitive, and does not kick in without editing the .simpleocl file first. If the Helpers.emftvm file is missing, you can try to edit the Helpers.simpleocl file a bit, and save the file to trigger the compiler as a workaround.

Cheers,
Dennis
Re: OCL closure operation [message #1854768 is a reply to message #1854550] Fri, 09 September 2022 06:17 Go to previous message
Yves BERNARD is currently offline Yves BERNARDFriend
Messages: 146
Registered: July 2014
Senior Member
Ok! Now it works! :-)

Thank you Dennis.


Yves
Previous Topic:helper context overlap for base data types?
Next Topic:Does the regexReplaceAll operation work?
Goto Forum:
  


Current Time: Sat Nov 11 08:17:01 GMT 2023

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

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

Back to the top