Hello all,
It seems this question has been asked many time but I try to launch my transformation from an Eclipse plugin and it fails.
When launching the ATL from the ATL launcher everything is fine.
But I tried using generated java class from ATL plugin or even tried the atl-common plugin from google code and they both give me the same error.
org.eclipse.m2m.atl.engine.emfvm.VMException: Cannot find class orgomg::cwm::resource::record::RecordFile in reference model OUTMODEL
at __matchFileConnection(TosMetadata400to410.atl[106:3-107:30])
local variables: self=thisModule, s=IN!<unnamed>:INMODEL!PositionalFileConnection
at __matcher__(TosMetadata400to410.atl)
local variables: self=thisModule
at main(TosMetadata400to410.atl)
local variables: self=thisModule
actually my output metamodel named metadata.ecore is defined in one plugin (say pluginA )and depends on another metamodel called cwm.ecore that is in another plugin (say pluginB )
and the class it does not find is the cwm.ecore.
I have tried registering the package orgomg.cwm.resource.record where lies the class in the atl-common example but it fails the same way.
Does anyone have an idea on how to solve this problem ?
Does ATL uses EMF registered package via eclipse extension points ? my guess is no
How to register many packages in ATL engine ?
here is my atl-common code
//in model
String oldMetamodelURI = "platform:/plugin/org.talend.model.migration/old_metamodels/metadata.ecore";
String oldMetamodelNsURI = "http://www.talend.org";
register(resource(oldMetamodelURI, true));
//out model
register(ConnectionPackage.eINSTANCE.eResource());
register(RecordPackage.eINSTANCE.eResource());
Transformation<EMFModel, EMFModel> metadata40toMetadata41 = new Transformations.Builder()
.asm("platform:/plugin/org.talend.model.migration/samples/tos_metadata400to410.asm")
.in(get(oldMetamodelNsURI), "IN", "INMODEL").out(get(ConnectionPackage.eNS_URI), "OUT", "OUTMODEL")
.buildOneInOneOut();
EMFModel out = transform(
inject(resource("platform:/plugin/org.talend.model.migration/samples/oldPositionalFileConnection.xmi", true),
get(oldMetamodelNsURI)), metadata40toMetadata41);
Resource resource = out.getResource();
resource.save(new FileOutputStream("e:\temp\testATL.xmi"), Collections.emptyMap());