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
Edoaurd Batot is currently offline Edoaurd BatotFriend
Messages: 90
Registered: March 2015
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: 5977
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
Edoaurd Batot is currently offline Edoaurd BatotFriend
Messages: 90
Registered: March 2015
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: Thu Jul 19 22:53:26 GMT 2018

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

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

Back to the top