Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Programmatical creation(Building OCL constraints from Java)
Programmatical creation [message #1759430] Tue, 11 April 2017 16:16 Go to next message
Edouard R. Batot is currently offline Edouard R. BatotFriend
Messages: 100
Registered: March 2015
Senior Member
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 16:19]

Report message to a moderator

Re: Programmatical creation [message #1759436 is a reply to message #1759430] Tue, 11 April 2017 16:39 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
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 17:35 Go to previous message
Edouard R. Batot is currently offline Edouard R. BatotFriend
Messages: 100
Registered: March 2015
Senior Member
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: Fri Apr 19 15:36:01 GMT 2024

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

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

Back to the top