Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [henshin-dev] Problem with enums and registered packages

Hey Christian,

it seems you are using a generated model, which is of course fine. I cannot reproduce your error. Please send the complete example including the generated code (just zip all projects belonging to the example).
You find both packages attached to this mail. One of them is EnumBug (containing my metamodel) and Runtime (containing the erroneous henshin model and the tester). I used the second project within a runtime of the first plugin project to have my ecore model registered. (see below)

Regarding your error: something is weird here. The error message indicates that you are using an attribute _expression_ which contains a reference to a "belongs_to" variable or constant. The error message basically says that this variable or constant is not defined. I searched for "belongs_to" in all files you have sent, but I didn't find any reference to it. Where does the "belongs_to" come from? The enum you are using only has one possible value called "foo".
I'm sorry that I sent you the wrong error message. I reconstructed the bug in a minimal project setup to avoid unnecessary dependencies. The old error message was from my original project. The actual message from the files I sent you is pretty much the same:
Exception in thread "main" java.lang.RuntimeException: sun.org.mozilla._javascript_.internal.EcmaError: ReferenceError: "foo" is not defined. (<Unknown source>#1) in <Unknown source> at line number 1
	at org.eclipse.emf.henshin.interpreter.impl.EngineImpl.evalAttributeExpression(EngineImpl.java:656)
	at org.eclipse.emf.henshin.interpreter.info.VariableInfo.createConstraints(VariableInfo.java:150)
	at org.eclipse.emf.henshin.interpreter.info.VariableInfo.createVariables(VariableInfo.java:107)
	at org.eclipse.emf.henshin.interpreter.info.VariableInfo.<init>(VariableInfo.java:73)
	at org.eclipse.emf.henshin.interpreter.info.RuleInfo.<init>(RuleInfo.java:26)
	at org.eclipse.emf.henshin.interpreter.impl.EngineImpl.getRuleInfo(EngineImpl.java:496)
	at org.eclipse.emf.henshin.interpreter.impl.EngineImpl$MatchFinder.<init>(EngineImpl.java:193)
	at org.eclipse.emf.henshin.interpreter.impl.EngineImpl$MatchGenerator.iterator(EngineImpl.java:153)
	at org.eclipse.emf.henshin.interpreter.impl.RuleApplicationImpl.execute(RuleApplicationImpl.java:89)
	at org.eclipse.emf.henshin.interpreter.impl.UnitApplicationImpl.executeRule(UnitApplicationImpl.java:175)
	at org.eclipse.emf.henshin.interpreter.impl.UnitApplicationImpl.doExecute(UnitApplicationImpl.java:99)
	at org.eclipse.emf.henshin.interpreter.impl.UnitApplicationImpl.execute(UnitApplicationImpl.java:89)
	at org.eclipse.emf.henshin.interpreter.impl.UnitApplicationImpl.executeSequentialUnit(UnitApplicationImpl.java:222)
	at org.eclipse.emf.henshin.interpreter.impl.UnitApplicationImpl.doExecute(UnitApplicationImpl.java:103)
	at org.eclipse.emf.henshin.interpreter.impl.UnitApplicationImpl.execute(UnitApplicationImpl.java:89)
	at HenshinTester$2.apply(HenshinTester.java:67)
	at HenshinTester$2.apply(HenshinTester.java:1)
	at org.eclipse.xtext.xbase.lib.ObjectExtensions.operator_doubleArrow(ObjectExtensions.java:104)
	at HenshinTester.transform(HenshinTester.java:71)
	at HenshinTester.main(HenshinTester.java:26)

If you have a generated model, you can just access the implementation of the package once in the beginning. Then EMF will do the rest and automatically add the package to the global registry. So it should be enough to call EnumBugPackage.eINSTANCE.getName(); once in the beginning.
My question pointed to the usage of my EPackage inside of henshin (in the model / diagram files). In the context menu of the Module I can select "Import Package ... from Registry", but I don't know how to register my package in the current eclipse runtime (Other than exporting it to Dropins / Starting a second plugin-runtime) in order to be able to select it from the list.

Thank you very much


Jona

Attachment: Runtime.zip
Description: Zip archive

Attachment: EnumBug.zip
Description: Zip archive


Back to the top