|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Hexa decimal to integer conversion [message #900464 is a reply to message #900452] |
Tue, 07 August 2012 08:16 |
Kosala Yapa Messages: 159 Registered: September 2010 |
Senior Member |
|
|
Thanks.
My problem is, yes I defined EOperation (hexToInt(String)) signature at target.ecore diagram, however the EOperation is implemented at the code base, which is generated from the target.genmodel.
How to call this hexToInt() in my ATL module? This is my problem.
Can I use run configuration settings to call this operation? I do not think so, because run configuration is not linked with generated code. (is there any way to make that link?)
As the other option,
I created an ATL plugin, and trying to run as a java application.
Properties file:
# Metamodels paths or nsUris
TPF2PSSu2.metamodels.source = file:/C:/..../source.ecore
TPF2PSSu2.metamodels.target = file:/C:/.../target.ecore
loading models:
/**
* Load the input and input/output models, initialize output models.
* @generated
*/
public void loadModels(String inModelPath) throws ATLCoreException {
ModelFactory factory = new EMFModelFactory();
IInjector injector = new EMFInjector();
IReferenceModel sourceMetamodel = factory.newReferenceModel();
injector.inject(sourceMetamodel, getMetamodelUri("source"));
IReferenceModel targetMetamodel = factory.newReferenceModel();
injector.inject(targetMetamodel, getMetamodelUri("target"));
this.inModel = factory.newModel(sourceMetamodel);
injector.inject(inModel, inModelPath);
this.outModel = factory.newModel(targetMetamodel);
}
I still get the error:
org.eclipse.m2m.atl.engine.emfvm.VMException: Operation not found: OUT!<unnamed>.hexToInt(java.lang.String)
at rule_getModule#40(TPF2PSSu2.atl[87:15-87:45])
Yes, I can understand, this launcher is not yet connected with the generated code.
Is there any approach to load the target meta model from the generated code?
It looks to me some modification is needed at
injector.inject(targetMetamodel, getMetamodelUri("target"));
this.inModel = factory.newModel(sourceMetamodel);
I really appriciate any help to solve this problem.
Thanks
Kosala
[Updated on: Tue, 07 August 2012 15:45] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06674 seconds