Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » def / derive in interactive OCL console(Looking for a way to define an operation inside OCL interpreter)
def / derive in interactive OCL console [message #1783326] Mon, 12 March 2018 06:08 Go to next message
Jens Zimmermann is currently offline Jens ZimmermannFriend
Messages: 6
Registered: March 2018
Junior Member
Hello,
I am provided with an eclipse instance with an EMF-based model Editor with interactive OCL but without Access to the underlying ecore model.
I am looking for a way to extend the language by defining certain helper-operations on certain classes (as could be done inside the ecore) but I am limited to the OCL Interpreter. Is there any way to do that?
Thanks!
Re: def / derive in interactive OCL console [message #1783415 is a reply to message #1783326] Mon, 12 March 2018 19:22 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

The interpreter is limiting since it's really just a one line (with line wrap) expression evaluator.

You should however be able to define all your additions in a Complete OCL document, then after loading your Ecore metamodel, probably in the Sample Ecore Editor, you can use OCL->Load Document to load your additional declarations into the Ecore. You can then use these declarations in 'one line' evaluations.

Regards

Ed Willink
Re: def / derive in interactive OCL console [message #1783486 is a reply to message #1783415] Tue, 13 March 2018 14:35 Go to previous messageGo to next message
Jens Zimmermann is currently offline Jens ZimmermannFriend
Messages: 6
Registered: March 2018
Junior Member
Thanks, Ed,
unfortunately I am in a Situation that the underlying ecore is not present anymore but I have only the generated Editor (with some extensions).
I suppose there is no other way left to enhance the capabilities of the OCL-console?
Jens
Re: def / derive in interactive OCL console [message #1783488 is a reply to message #1783486] Tue, 13 March 2018 14:54 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

I don't really understand since generation copies the *.ecore if necessary. But if you have really lost it, the EMF create model from annotated Java, or the Modisco reverse engineering could enable you to regenerate it or at least give you a good first draft for manual recreation. You are pretty much dead without it.

Regards

Ed Willink
Previous Topic:Bug in generated code?
Next Topic:Generic Enumeration Literal
Goto Forum:
  


Current Time: Fri Apr 19 20:01:57 GMT 2024

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

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

Back to the top