Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] applyStereotypes not work programmatically(different results with Run Configurations and programmatically)
[ATL] applyStereotypes not work programmatically [message #522459] Mon, 22 March 2010 17:14 Go to next message
Filipe Araujo is currently offline Filipe AraujoFriend
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:
http://img377.imageshack.us/img377/9812/out2.png

Result Run Configurations:
http://img201.imageshack.us/img201/8707/out1.png

[Updated on: Mon, 22 March 2010 17:18]

Report message to a moderator

Re: [ATL] applyStereotypes not work programmatically [message #524097 is a reply to message #522459] Tue, 30 March 2010 16:46 Go to previous messageGo to next message
Filipe Araujo is currently offline Filipe AraujoFriend
Messages: 7
Registered: July 2009
Junior Member
not resolved yet!!!
help me!
Re: [ATL] applyStereotypes not work programmatically [message #524211 is a reply to message #522459] Wed, 31 March 2010 08:05 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
You could try to use platforms uri. This should work as this is the behavior used in the launch configuration.
Re: [ATL] applyStereotypes not work programmatically [message #524418 is a reply to message #524211] Wed, 31 March 2010 20:37 Go to previous message
Filipe Araujo is currently offline Filipe AraujoFriend
Messages: 7
Registered: July 2009
Junior Member
No chance!

Error loading uri:http://www.eclipse.org/uml2/3.0.0/UML: java.net.MalformedURLException: unknown protocol: uri
Previous Topic:[ATL] Launching ATL from Java, 'Content is not allowed in prolog'.
Next Topic:Doing M2M with Xtend ?
Goto Forum:
  


Current Time: Sun Aug 25 16:15:34 GMT 2019

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

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

Back to the top