[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [henshin-user] (no subject)

@Daniel, I think this FAQ doesn't apply as the transformation executes correctly when using the Henshin GUIÂ in Eclipse.

@Steffen, this might well be the case as nowhere in the code have I imported my ecore model.
I attach my code at the end of this mail ( this code was copy pasted from the henshin interpreter page).
Do I have to add an instruction to import the ecore metamodel ? If so, how to do it ? ( I'm relatively new to the ecore world ).

Thanks for the swift reply,
Cheers,

LoÃc

ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ HenshinResourceSet resourceSet = new HenshinResourceSet(workingDir);
ÂÂÂ
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ // Load a model:
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ Resource model = resourceSet.getResource(input);
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ Â
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ // Load the Henshin module:
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ Module module = resourceSet.getModule(transformation);
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ Â
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ // Apply the transformation (see below)...
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ Â
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ // Save the model:
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ model.save(null);
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ // Prepare the engine:
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ Engine engine = new EngineImpl();
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ Â
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ // Initialize the graph:
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ EGraph graph = new EGraphImpl(model);
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ Â
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ // Find the unit to be applied:
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ Unit u = module.getUnit(unit);
ÂÂÂ ÂÂÂ ÂÂÂ
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ // Apply the unit:
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ UnitApplication application = new UnitApplicationImpl(engine, graph, u, null);
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ application.execute(null);

ÂÂÂ ÂÂÂ



On Wed, Feb 8, 2017 at 9:24 AM, Steffen Zschaler <steffen.zschaler@xxxxxxxxx> wrote:

From the stack trace, it looks like this occurs inside ECore. Have you set up your resource set correctly to include all the relevant metamodels?

Many thanks,

Steffen


On 08/02/2017 07:38, Daniel StrÃber wrote:
Dear Loic,

there is an a FAQ entry about null pointer exceptions (NPEs) while executing a transformation, have you checked it? https://wiki.eclipse.org/Henshin_FAQ#I_get_NPEs_when_I_try_to_execute_my_transformation

Besides that, if possible, it would help us if you can attach the Java code, so we can look at it (I assume you modified it a bit so that it matches your transformation).

Best regards,
Daniel

Am 07.02.2017 um 23:48 schrieb loic.gammaitoni@xxxxxxxxx:

Dear mailing list readers,

Iâm interested in measuring the time needed by Henshin to execute a transformation (see attached cdrefinement.henshin) on a given xmi model ( size10.xmi conforming to CD.ecore). The transformation works great when running through eclipse but unfortunately I canât see any log of the time it took to be computed.
I thus tried my luck in developing a small java application running the transformation and printing out the time taken and canât get rid of a NullPointerException...
Here is the stacktrace: (note that I simply reused the code given in the henshin interpreter web page)

Exception in thread "main" java.lang.NullPointerException

ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ at org.eclipse.emf.ecore.impl.EClassImpl.getFeatureID(EClassImpl.java:1500)

ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ at org.eclipse.emf.ecore.impl.DynamicEObjectImpl.eDerivedStructuralFeatureID(DynamicEObjectImpl.java:218)

ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:1008)

ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:1003)

ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:998)

ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ at org.eclipse.emf.henshin.interpreter.impl.ChangeImpl$AttributeChangeImpl.applyAndReverse(ChangeImpl.java:134)

ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ at org.eclipse.emf.henshin.interpreter.impl.ChangeImpl$CompoundChangeImpl.applyAndReverse(ChangeImpl.java:466)

ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ at org.eclipse.emf.henshin.interpreter.impl.RuleApplicationImpl.undo(RuleApplicationImpl.java:126)

ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ at org.eclipse.emf.henshin.interpreter.impl.UnitApplicationImpl.undo(UnitApplicationImpl.java:135)

ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ at org.eclipse.emf.henshin.interpreter.impl.UnitApplicationImpl.executeSequentialUnit(UnitApplicationImpl.java:230)

ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ at org.eclipse.emf.henshin.interpreter.impl.UnitApplicationImpl.doExecute(UnitApplicationImpl.java:104)

ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ at org.eclipse.emf.henshin.interpreter.impl.UnitApplicationImpl.execute(UnitApplicationImpl.java:90)

ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ at Interpreter.interpret(Interpreter.java:80)

ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ at Main.main(Main.java:38)


Do you have any idea what causes this error ?

Also, is there a way to get the time taken by henshin to execute a transformation directly in eclipse ( without having to program anything )

Cheers,
LoÃc

Â

Â

Â

Â



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



_______________________________________________ henshin-user mailing list henshin-user@xxxxxxxxxxx To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://emea01.safelinks.protection.outlook.com/?url="">https%3A%2F%2Fdev.eclipse.org%2Fmailman%2Flistinfo%2Fhenshin-user&data="">7Csteffen.zschaler%40kcl.ac.uk%7Cd07bcc42cc444ee058cf08d44ff58f49%7C8370cf1416f34c16b83c724071654356%7C0&sdata=GZvUzq%2BqoGUk2%2FltY3QqwPcE2X8pqnyPftwW%2BT9Ap%2Fs%3D&reserved=0

-- 
Dr. rer. nat. Steffen Zschaler AHEA
Senior Lecturer

King's College London
Department of Informatics

Email szschaler@xxxxxxx
Phone +44 (020) 7848 1513
WWW   http://www.steffen-zschaler.de/

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