Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » Error running RegularVM transformation from Java
Error running RegularVM transformation from Java [message #1694233] Sun, 03 May 2015 08:22 Go to next message
Yasser Khan is currently offline Yasser KhanFriend
Messages: 23
Registered: October 2011
Junior Member
My ATL transformations doesn't work as accepted when I invoke them from Java using the RegularVM. I can't change any line of code in the transformations. My transformation is .uml to .uml
Please advise what is missing in my code:

_factoryMap = Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap();
_factoryMap.put("ecore", new EcoreResourceFactoryImpl());
_factoryMap.put("uml", new UMLResourceFactoryImpl());

AtlModelHandler.registerDefaultHandler("EMF", new AtlEMFModelHandler());

_factory = new ASMFactory();
_injector = new ASMInjector();
_extractor = new ASMExtractor();
_launcher = new RegularVMLauncher();

Map<String, Object> optionsInMM = new HashMap<String, Object>();
optionsInMM .put("modelHandlerName", "EMF");
optionsInMM .put("modelName", _inMetamodelName);
optionsInMM .put("path", inMetamodelUri);
_inMetamodel = _factory.newReferenceModel(optionsInMM);

Map<String, Object> optionsOutMM = new HashMap<String, Object>();
optionsOutMM .put("modelHandlerName", "EMF");
optionsOutMM .put("modelName", _outMetamodelName);
optionsOutMM .put("path", _outMetamodelUri);
_outMetamodel = _factory.newReferenceModel(optionsOutMM tions);

Map<String, Object> inModelOptions = new HashMap<String, Object>();
inModelOptions.put("modelHandlerName", "EMF");
inModelOptions.put("modelName", _inModelName);
inModelOptions.put("path", inModelUri);
inModelOptions.put("newModel", true);

_inModel = _factory.newModel(_inMetamodel, inModelOptions);

Map<String, Object> outModelOptions = new HashMap<String, Object>();
outModelOptions.put("modelHandlerName", "EMF");
outModelOptions.put("modelName", _outModelName);
outModelOptions.put("path", outModelUri);
outModelOptions.put("newModel", true);

_outModel = _factory.newModel(_outMetamodel, outModelOptions);

Map<String, Object> launcherOptions = new HashMap<String, Object>();
launcherOptions.put("OPTION_CONTENT_TYPE", false);
launcherOptions.put("disassemblyMode", false);
launcherOptions.put("allowInterModelReferences", false);

_injector.inject(_inModel, inModelUri);
_launcher.addInModel(_inModel, _inModelName, _inMetamodelName);
_launcher.addOutModel(_outModel, _outModelName, _outMetamodelName);

for(String libPath : libAsmPaths){
InputStream libraryStream = getFileAsStream(libPath);

String libraryName = getFileNameWithoutExt(libPath);
_launcher.addLibrary(libraryName, getFileAsStream(libPath));

InputStream[] modulesStreams = new InputStream[supImposedModuleAsmPaths.size() + 1];
int i=0;
modulesStreams[i++] = getFileAsStream(moduleAsmPath);

for(String superImposedAsmPath : supImposedAsmPaths){
modulesStreams[i++] = getFileAsStream(superImposedAsmPath);

Object result = _launcher.launch(ILauncher.RUN_MODE, new NullProgressMonitor(), launcherOptions, (Object[]) modulesStreams);

[Updated on: Sun, 03 May 2015 08:26]

Report message to a moderator

Re: Error running RegularVM transformation from Java [message #1694258 is a reply to message #1694233] Mon, 04 May 2015 01:59 Go to previous message
Yasser Khan is currently offline Yasser KhanFriend
Messages: 23
Registered: October 2011
Junior Member
Problem solved using LauncherService.launch.

[Updated on: Mon, 04 May 2015 02:16]

Report message to a moderator

Previous Topic:DiagnosticException in own ATL-Plugin
Next Topic:Print ATL console output to file from Java
Goto Forum:

Current Time: Mon Jan 22 10:40:15 GMT 2018

Powered by FUDForum. Page generated in 0.01889 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software