Accessing elements properties in a EMF Compare Diff Model

199 Views Asked by At

I have used EMF Compare to compare 2 models comforming to a custom metamodel.
I generated and saved the Diff model to an .xmi file.
Currently, I am working on how to use the Diff Model within ATL to transform the differences to another model.
The problem is that I can't figure out how to access the properties of the element ( defined in my custom metamodel) being changed. I could access the kind of change like this :

diffModel.kind

but I cannot access the properties of the element who has been changed.

1

There are 1 best solutions below

0
On

To know the element that have change in a diff block, you have to query wich is the match element where is contained the diff, in this element have two attributes: left and right, that references the source and the target elements.

To access the match element where is contained the diff block, you can use the ATL operation refImmediateComposite(). Example: diff.refImmediateComposite().

Also you need to define as input model the source and target model compared.