Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Parsing an ocl file (complete OCL) to define operations in an environment
Parsing an ocl file (complete OCL) to define operations in an environment [message #1081566] Wed, 07 August 2013 11:49 Go to next message
Olivier Melois is currently offline Olivier MeloisFriend
Messages: 14
Registered: March 2012
Junior Member
Hello.

I'm a developer for an Eclipse project, and I need to provide the user with the possibility of writing his own OCL operations, that will be used by my mechanisms to extract relevant information from a model.

I'm familiar with how operations can be "manually" loaded into an environment (org.eclipse.ocl.Environment) object and then executed, however I'd like to parse an ocl file (edited with the Complete OCL editor) to retrieve operations and load them into an environment of my choice.

Could I just load the xtext model contained by the ocl file inside a resource set of my choice, and then use it to define the operations in my environment ? I'm pretty sure I could manage to comprehend pieces of the metamodel used by CompleteOCL and find the information I'm looking for, but does a utility class exist for loading the operations into an environment ? Any pointers would be greatly appreciated.

Thank you for your time.
Re: Parsing an ocl file (complete OCL) to define operations in an environment [message #1081621 is a reply to message #1081566] Wed, 07 August 2013 13:15 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
HI

As of Juno, there is a Load Complete OCL Resource menu option for
views/editors in which the selection is adaptable to an EObject.

This support adding OCL into a/the Xtext editor. See the Complete OCL
tutorial in the OCL Documentation.

You may find that this same approach or the underlying classes are
suitable for you.

Regards

Ed Willink


On 07/08/2013 12:49, Olivier Melois wrote:
> Hello.
> I'm a developer for an Eclipse project, and I need to provide the user
> with the possibility of writing his own OCL operations, that will be
> used by my mechanisms to extract relevant information from a model.
> I'm familiar with how operations can be "manually" loaded into an
> environment (org.eclipse.ocl.Environment) object and then executed,
> however I'd like to parse an ocl file (edited with the Complete OCL
> editor) to retrieve operations and load them into an environment of my
> choice.
> Could I just load the xtext model contained by the ocl file inside a
> resource set of my choice, and then use it to define the operations
> in my environment ? I'm pretty sure I could manage to comprehend
> pieces of the metamodel used by CompleteOCL and find the information
> I'm looking for, but does a utility class exist for loading the
> operations into an environment ? Any pointers would be greatly
> appreciated.
> Thank you for your time.
Previous Topic:UML2ECORE via adapter
Next Topic:Visiting expression from SpecificationCS
Goto Forum:
  


Current Time: Wed Apr 24 14:37:54 GMT 2024

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

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

Back to the top