Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF Diff/Merge » Coevolution with an existing project & Rule used twice in the same bridge.
Coevolution with an existing project & Rule used twice in the same bridge. [message #1772499] Mon, 11 September 2017 14:42 Go to next message
Aurelien Didier is currently offline Aurelien DidierFriend
Messages: 12
Registered: April 2015
Junior Member
Hello,

I have started to work with coevolution again, I have seen the documentation on https://wiki.eclipse.org/EMF_DiffMerge/Co-Evolution and sample projects are useful but it is not easy when things are a bit different from samples.

1. I have defined a bridge between an existing project and a new project. The coevolution works directly in that case.
However, when I try to transform my model into an existing project, it seems that I need to use an "IndermediateUpdateScope" to make it work (see CapellaIntermediateUpdateScope in APA sample). Is this scope mandatory or i it used for something else? Is there anything else to do for making this work?

2. How can I use the same rules with a different parent in my transformation. We have noticed that in the following case

ARule ruleA = new ARule(this);
BRule ruleB = new BRule(ruleA);
CRule ruleC1 = new CRule(ruleA);
CRule ruleC2 = new CRule(ruleB);
DRule ruleD = new DRule(ruleB);

In ruleD, in need to get the result of ruleC2 via CRule container = mappingExecution_p.get(elem, CRule.ID);
But there is no result because CRule is used twice with the same ID.
We were able to solve this using non static IDs in our CRule class, but is there a better way to do that?

Regards,

Aurélien
Re: Coevolution with an existing project & Rule used twice in the same bridge. [message #1772587 is a reply to message #1772499] Tue, 12 September 2017 16:49 Go to previous message
Olivier Constant is currently offline Olivier ConstantFriend
Messages: 91
Registered: January 2012
Member
Hello Aurélien,

1. The CapellaIntermediateUpdateScope is necessary only because in the case of Capella, a model contains a lot of predefined elements (architectures, root functions, default data types, ...) that usually need to be ignored. A transformation that targets a Capella model usually focuses on specific subsets of the Capella model, not the whole. The scope allows restricting the update to such subsets. You do not need to worry about that if you are not in such a case.

2. In a bridge, every instance of a rule or query must have a unique identifier for unambiguous traceability. So if you have several instances of the same query/rule class, they cannot share a common (hence static) ID. The solution you found is the correct one. This is, btw, why the Query and Rule classes have constructors with ID parameters.

Hope this helps.
Previous Topic:Is there any sample/tutorial to introduce how to write a diff/merge service
Next Topic:Co-Evolution Basic Concepts
Goto Forum:
  


Current Time: Sun May 20 21:19:22 GMT 2018

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

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

Back to the top