I didn't look into your source code but your stack trace tells me that the error happens during the saving of the model. This could mean that your transformation was not successful or that you didnt extract the result of the transformation correctly. First you should make sure that the transformation was correctly executed. You could set a breakpoint after the transformation execution and look into the contents oft the EGraph. Alternatively you could pass a LoggingApplicationMonitor to your unit application to get debug output. See also the wiki on the Henshin interpreter.
I tried to reproduce the issue, but I got another error instead :
Exception in thread "main" java.lang.NullPointerException
at
org.eclipse.emf.henshin.model.resource.HenshinResourceSet.saveEObject(HenshinResourceSet.java:358)
at
org.eclipse.emf.henshin.model.resource.HenshinResourceSet.saveEObject(HenshinResourceSet.java:346)
at org.eclipse.example.Left2Right.main(Left2Right.java:37)
Could you help me with this ?
Le 23/01/2015 17:58, Christian Krause a
écrit :
Hi Sebastien,
I hope we can fix the editor bug soon. Regarding your NPE
at runtime, we need a stack trace and ideally your example.
I would like to use rule-nesting, just like it's used in
Ecore2Rdb example.
I have really basic ecore models.
My source ecore model "left.ecore" contains a main class
called "Left", which can contain 0 or more classes named
"LeftChild".
My target ecore model "right.ecore" contains a main class
called "Right", which can contain 0 or more classes named
"RightChild".
In my Henshin diagram, I can design the transformation of
"Left" to "Right" (using Trace model), which works fine.
For the transformation of "LeftChild" to "RightChild", I'm
trying to use rule-nesting :
In the same rule, I can add the following classes:
- "preserve*/children" :LeftChild
- "create*/children" :Trace
- "create*/children" :RightChild
But when it comes to adding edges, I can not connect
"Right" to "RightChild".
If I change the annotation to "create", I can create the
edge.
Then I change the annotation back to "create*/children",
but I get a NullPointerException at runtime.
The only way to make it work is to create another rule
where my "Right" class is already created ("preserve"
annotation).
Could you help me to find out what I'm missing to make it
work ?