Hi Marco,
the types of Attributes, Edges and Nodes are not contained in the
same resource -- maybe that is why they are not resolved by
resolveAll(). We could try to visit all Attributes, Edges and
Nodes in the Henshin resource and invoke getType().getEType() on
them. Hopefully that triggers the proxy resolution. By the way,
you can just do a sysout on getType().getEType() and see what it
returns. If it is the proxy resolution problem, then the second
time you invoke it I would expect that it should be the real
EObject (not the proxy). Could you try it out? If it works, I
would add it to the HenshinResource implementation, so that it is
done under the hood.
Cheers,
Christian
On 09/11/2012 07:54 PM, Konersmann, Marco wrote:
Hi Christian,
thank you very much for your support. The workaround did not
work.
I noticed that the wizard has no problems with the execution.
I will also have a look at the code.
Cheers
Hi Marco,
this exception is probably caused by a missing proxy
resolution. A similar problem has been reported before. I am
now inclined to enforce the resolution of all proxy objects
during loading. I will make some experiments and see whether
it works.
If you don't want to wait for the next release which will fix
the problem (I expect that we roll out a new version in the
next 2 weeks), you could try the following (works only if you
execute it in code): before applying the transformation, run
EcoreUtil.resolveAll(system), where system is your
transformation system. I don't know if that works. I will try
it out in the next days.
Cheers,
christian
On 9/11/2012 5:31 PM, Marco Konersmann wrote:
Hello again,
working on UML models, I ran into another error that I hope
you can help me with.
My UML instance model is:
Model --packagedElement--> Component (name:WebShop)
My transformation rule is:
<<preserve>> Model
--<<delete>>PackagedElement--->
<<delete>> Component (name="WebShop")
This gives me a NPE:
Exception in thread "main" java.lang.NullPointerException
at
org.eclipse.emf.henshin.interpreter.info.VariableInfo.createConstraints(VariableInfo.java:168)
at
org.eclipse.emf.henshin.interpreter.info.VariableInfo.createVariables(VariableInfo.java:104)
at
org.eclipse.emf.henshin.interpreter.info.VariableInfo.<init>(VariableInfo.java:70)
at
org.eclipse.emf.henshin.interpreter.info.RuleInfo.<init>(RuleInfo.java:29)
at
org.eclipse.emf.henshin.interpreter.impl.EngineImpl.getRuleInfo(EngineImpl.java:499)
at
org.eclipse.emf.henshin.interpreter.impl.EngineImpl$MatchFinder.<init>(EngineImpl.java:197)
at
org.eclipse.emf.henshin.interpreter.impl.EngineImpl$MatchGenerator.iterator(EngineImpl.java:157)
at
org.eclipse.emf.henshin.interpreter.impl.RuleApplicationImpl.execute(RuleApplicationImpl.java:90)
at init.Example.run(Example.java:61)
at init.Example.main(Example.java:75)
in createConstraints(..) line 168 is:
attributeValue = castDown(attributeValue,
attribute.getType().getEType().getInstanceClassName());
with attribute.getType().getEType() being null.
attribute.getType() resolves to
"org.eclipse.emf.ecore.impl.EAttributeImpl@4a646ffe
(eProxyURI:
../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name)"
That "name" attribute has the EType "String
[java.lang.String]" in the meta model.
Is this a bug in Henshin, or do I use the API in a wrong
way?
I attached an example project.
Best regards
Marco
_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/henshin-dev
_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/henshin-dev
|