[ATL] applyStereotypes not work programmatically [message #522459] |
Mon, 22 March 2010 17:14 |
Filipe Araujo Messages: 7 Registered: July 2009 |
Junior Member |
|
|
I realized a transformation using the Run Configurations and everything is ok. but when I try programmatically, the profile is applied but does not apply stereotypes.
Is there a necessary condition to apply stereotypes? maybe some configuration in the launch ...
thank in advance.
// Defaults
ILauncher launcher = CoreService.getLauncher("EMF-specific VM");
launcher.initialize(Collections.EMPTY_MAP);
ModelFactory factory = CoreService.createModelFactory(launcher.getDefaultModelFactoryName());
injector = CoreService.getInjector(factory.getDefaultInjectorName());
extractor = CoreService.getExtractor(factory.getDefaultExtractorName());
asmURL = new URL("file:/C:/.../galileo/atl/CIMtoPIM.asm"); //$NON-NLS-1$
// Metamodel
umlMetamodel = factory.newReferenceModel();
injector.inject(umlMetamodel, "http://www.eclipse.org/uml2/2.1.0/UML"); //$NON-NLS-1$
// Creating models
IModel outModel = factory.newModel(umlMetamodel);
IModel inModel = factory.newModel(umlMetamodel);
IModel profilePIMModel = factory.newModel(umlMetamodel);
IModel profileCIMModel = factory.newModel(umlMetamodel);
// Loading existing model
injector.inject(inModel, "file:/C:/.../galileo/atl/model/CIM.uml");
injector.inject(profileCIMModel, "file:/C:/.../galileo/atl/model/ProfileCIM.profile.uml");
injector.inject(profilePIMModel, "file:/C:/.../galileo/atl/model/ProfilePIM.profile.uml");
// addModels
launcher.addOutModel(outModel, "OUT", "UML2"); //$NON-NLS-1$ //$NON-NLS-2$
launcher.addInModel(inModel, "IN", "UML2"); //$NON-NLS-1$ //$NON-NLS-2$
launcher.addInModel(profileCIMModel, "PROCIM", "UML2"); //$NON-NLS-1$ //$NON-NLS-2$
launcher.addInModel(profilePIMModel, "PROPIM", "UML2"); //$NON-NLS-1$ //$NON-NLS-2$
//libs
URL lib = new URL("file:/C:/.../galileo/atl/Lib.asm");
URL facilities = new URL("file:/C:/.../galileo/atl/ATLfacilities.asm");
launcher.addLibrary("lib", launcher.loadModule(lib.openStream()));
launcher.addLibrary("ATLFacilities", launcher.loadModule(facilities.openStream()));
//options
Map<String, Object> options = new HashMap<String, Object>();
options.put("allowInterModelReferences", "false");
options.put("supportUML2Stereotypes", "true");
options.put("showSummary", "true");
//run
launcher.launch(ILauncher.RUN_MODE, new NullProgressMonitor(), options, asmURL.openStream());
Result programmatically:
Result Run Configurations:
[Updated on: Mon, 22 March 2010 17:18] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03586 seconds