Vogella has a nice example here (using standard EMF resource
sets, you will need to kep using a HenshinResourceSet):
http://www.vogella.com/tutorials/EclipseEMFPersistence/article.html#load-an-existing-model
. The links in there should take you to more details. I forget
what HenshinResourceSet already sets up for you, but recall having
issues with it when the rules and corresponding metamodel weren't
in the right relative positions.
Steffen
On 08/02/2017 09:42, Loic Gammaitoni
wrote:
@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);
_______________________________________________
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="">
--
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/ |