Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [henshin-dev] Update of Nightly Build / Issue using Java 8 Nashorn JS Engine

Hi Christian,

 

I also think, that a proper “Java Class loader” for Henshin rules makes sense. This would give a chance to remove the full qualified names for called Java Classes inside Henshin Rules as well, they are quite annoying when it comes to readability of rules, especially when using deep package structures.

 

Maybe a single keyword / charset (i.e. >>classname<<) leading the Java call will satisfy the needs, perhaps it’s even possible to create a “import” parameter in addition to each rule, that is executed before the rule.

 

Greetings,

 

Markus

 

Von: henshin-dev-bounces@xxxxxxxxxxx [mailto:henshin-dev-bounces@xxxxxxxxxxx] Im Auftrag von Christian Krause
Gesendet: Montag, 30. Juni 2014 20:19
An: Henshin developers mailing list
Betreff: Re: [henshin-dev] Update of Nightly Build / Issue using Java 8 Nashorn JS Engine

 

Hi Markus,

 

thanks for giving us feedback. We currently have some connectivity problems in our build setup. Hopefully the nightly build will work again soon.

 

Regarding your problem: we cannot just search for dots in the JS code -- we would need a proper parsing here. I think a clean way of doing it would be a possibility for specifying JS package imports. Do you think this makes sense?

 

Cheers,

Christian

 

 

2014-06-30 12:35 GMT+02:00 <mke@xxxxxxxxxx>:

Hi there,

 

I was curious that the latest nightly build was created over a month ago. Especially after the commit of Christian Krause regarding the fixes for Java 8, I’d like to ask, if you could create a new build containing these fixes.

 

The issue we are facing is the following. Right now the package import to the JS Engine is not working. I saw that the importing issue should be solved by adding the rhino compatibility mode. Still there is a problem in the evaluation of attributes/variables:

 

We are calling a static method in a java class using the fully qualified name. The attribute value is set to lets say:

 

Attribute = “This is the new attribute value: ” + de.mypackage.StringCreator.createString(var)

 

where createString is a static method using a String parameter.

 

The issue is, that the attribute evaluator in the EngineImpl does not recognize the variable  de.mypackage.StringCreator.createString(var) as a full qualified Java Class, hence we get the following error message:

 

java.lang.RuntimeException: ReferenceError: "de" is not defined in <eval> at line number 1

       at org.eclipse.emf.henshin.interpreter.impl.EngineImpl.evalAttributeExpression(EngineImpl.java:906)

       at org.eclipse.emf.henshin.interpreter.impl.EngineImpl.createChanges(EngineImpl.java:861)

       at org.eclipse.emf.henshin.interpreter.impl.EngineImpl.createChanges(EngineImpl.java:876)

       at org.eclipse.emf.henshin.interpreter.impl.EngineImpl.createChange(EngineImpl.java:756)

       at org.eclipse.emf.henshin.interpreter.impl.RuleApplicationImpl.execute(RuleApplicationImpl.java:99)

       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 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 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 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 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)

 

I fixed this issue by adding a conditional check if the attribute.getValue() String contains any “.” elements and added a “importPackage(de.mypackage)” before the actual evaluation, maybe you could add a similar check to make it work in the nightly build as well.

 

Greetings and thanks for all your work,

 

Markus

 


_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/henshin-dev

 


Back to the top