Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [henshin-dev] Java Package import at Rule Level

Hi Christian,

 

most commonly, we use Java Classes to change a parameter found in the LHS to create a new attribute in the RHS.

 

Let’s say I have a class StringManipulator in the package de.teampb.utils that has a static method public String manipulate(String anyString).

 

Then my _expression_ in the RHS would be <<create>> attributeName = StringManipulator.manipulate(stringParameterFromLHS).

 

I also tried to access via full qualified name, but then js is arguing about the not defined parameter de.

 

Greetings,

 

Markus

 

Von: henshin-dev-bounces@xxxxxxxxxxx [mailto:henshin-dev-bounces@xxxxxxxxxxx] Im Auftrag von Christian Krause
Gesendet: Mittwoch, 3. September 2014 13:35
An: Henshin developers mailing list
Betreff: Re: [henshin-dev] Java Package import at Rule Level

 

Hi Markus,

how does the _expression_ look like?

 

Cheers,
Christian

 

2014-09-03 12:50 GMT+02:00 <mke@xxxxxxxxxx>:

I’tried different variations of calls.

 

The Package, that I try to include is de.teampb.tma

 

for the global import I called the EngineImpl constructor via new String[]{“de.teampb.tma”} and via String[]{de.teampb.tma.ClassName}

 

for the local import on the necessary rule, I added the String to the rule property.

 

All this source is compiled on JDK 7.

 

Greetings and thanks for the help,

 

Markus

 

Von: henshin-dev-bounces@xxxxxxxxxxx [mailto:henshin-dev-bounces@xxxxxxxxxxx] Im Auftrag von Christian Krause
Gesendet: Dienstag, 2. September 2014 10:50


An: Henshin developers mailing list
Betreff: Re: [henshin-dev] Java Package import at Rule Level

 

How does your package import and your _expression_ look like?

 

Cheers,

Christian

 

2014-09-02 9:20 GMT+02:00 <mke@xxxxxxxxxx>:

Hi Christian,

 

unfortunately the patch did not work out for me.

 

Getting the following stack trace:

 

Exception in thread "main" java.lang.AssertionError: __noSuchProperty__ placeholder called

       at jdk.nashorn.internal.objects.NativeJavaImporter.__noSuchProperty__(NativeJavaImporter.java:109)

       at jdk.nashorn.internal.scripts.Script$\^eval\_.runScript(<eval>:1)

       at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:498)

       at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:206)

       at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:378)

       at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:546)

       at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:528)

       at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:524)

       at jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:194)

       at javax.script.AbstractScriptEngine.eval(Unknown Source)

       at org.eclipse.emf.henshin.interpreter.impl.ScriptEngineWrapper.eval(ScriptEngineWrapper.java:99)

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

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

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

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

       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)

 

regardless, which import mechanism I’m using.

 

Greetings,

 

Markus

Von: henshin-dev-bounces@xxxxxxxxxxx [mailto:henshin-dev-bounces@xxxxxxxxxxx] Im Auftrag von Christian Krause


Gesendet: Freitag, 22. August 2014 14:04


An: Henshin developers mailing list

Betreff: Re: [henshin-dev] Java Package import at Rule Level

 

Hi Markus,

 

there is currently no global import mechanism (you could inject them into the JS engine I guess, but thats not really convenient). Could you maybe send us a patch of your implementation? 

 

Cheers,

Christian

 

PS: Please note that if we include it, it will be of course published under the terms of the EPL. If you don't want that, please don't send us anything...

 

2014-08-22 12:25 GMT+02:00 <mke@xxxxxxxxxx>:

Just wanted to say thanks for an implementation of a JS- Java Package import Feature at Rule level. Works like a charm!

 

A small question regarding global imports of java packages into the JS-Engine:

 

Would it be possible to extend the Engine interface resp. EngineImpl with a constructor, where String array of globally imported packages can be set, because we use java methods quite regularly, and it would save a huge amount of time, if we could import all libraries at once during the startup of the engine. I’ve done it for my local work, but I’m not sure if anything else will break using this extension.

 

Or is there already a global import mechanism, that I overlooked?

 

Greetings,

 

Markus

 

Von: henshin-dev-bounces@xxxxxxxxxxx [mailto:henshin-dev-bounces@xxxxxxxxxxx] Im Auftrag von Christian Krause
Gesendet: Mittwoch, 20. August 2014 19:24
An: Henshin developers mailing list
Betreff: [henshin-dev] Git config for Windows

 

Hi,

please use this Git config in Windows:

 

core.autocrlf=true

core.filemode=false

 

If you have dirty projects due to windows line endings, try a hard reset after setting the config.

 

Cheers,

Christian


_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/henshin-dev

 


_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/henshin-dev

 


_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/henshin-dev

 


_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/henshin-dev

 


_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/henshin-dev

 


Back to the top