Skip to main content



      Home
Home » Modeling » OCL » Programmatical creation(Building OCL constraints from Java)
Programmatical creation [message #1759430] Tue, 11 April 2017 12:16 Go to next message
Eclipse UserFriend
Hi,

In order to modify OCL ASTs I would like to create an OperationCallExp to replace one I don't like (with(in) reason). I want to instantiate an "oclIsTypeOF" operation.
Creating the OperationCallExp object is made easy thanks the EcoreFactory, and modifying its fields is straight forward using Ecore eSetters. Plugin a source, changing operation code is ok.

Troubles to perform the creation happen when I try to instantiate an EOperation to fill the referredOperation field. I've tried many ways, investigated in the Ecore code and documentation, but I can't make it.

Do you have any hint where to look for in the documentation and/or code and/or test code to instantiate such EOperation from scratch (I mean, no parsing) ?

Thank you,
Edouard

[Updated on: Tue, 11 April 2017 12:19] by Moderator

Re: Programmatical creation [message #1759436 is a reply to message #1759430] Tue, 11 April 2017 12:39 Go to previous messageGo to next message
Eclipse UserFriend
H

See your reply on the start/end thread.

Programmatically, IIRC there is an additionalOperations capability to register alien operations. Search the JUnit tests for an example. I never understood them, but did realize that they could not be serialized to XMI. Hence the Pivot OCL uses true models that can have true XMI references.

Regards

Ed Willink
Re: Programmatical creation [message #1759440 is a reply to message #1759436] Tue, 11 April 2017 13:35 Go to previous message
Eclipse UserFriend
Quote:
Programmatically, IIRC there is an additionalOperations capability to register alien operations

Alien ?
I'm modifying OCL within its own boundaries. Operations I want to (re)create are OCL operations : "oclIsTypeOf", "=", "<>", etc.
Previous Topic:How to derive a collection of objects
Next Topic:Start/End position
Goto Forum:
  


Current Time: Mon Jul 14 21:24:52 EDT 2025

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

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

Back to the top