Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Transformations with ATL 3.0.0 and 3.0.1
[ATL] Transformations with ATL 3.0.0 and 3.0.1 [message #512864] Mon, 08 February 2010 08:55 Go to next message
Sebastian is currently offline SebastianFriend
Messages: 5
Registered: July 2009
Junior Member
Hi,

in our tool - the MDPE Workbench - we invoke ATL programmatically. So far, we used ATL 3.0.0 and all our transformations worked very well. Recently, we updated the ATL version to ATL 3.0.1 and there is a very strange problem for which we have no ideas how we can solve it.

The transformation takes a so called TIPM model, a Trace model and another annotation (PAM) model as input and generates a new TIPM with additonal annotation information from the PAM model. As mentioned above in ATL 3.0.0 the transformation works fine. If we use ATL 3.0.1, data from PAM is available in the TIPM, but not contained in the model (see the snipped of TIPM).

...
 </org.modelplex.tipm:TIPM>
  <org.modelplex.tipm:OpenWorkload description="WorkloadName">
    <occurence xsi:type="org.modelplex.tipm:ValueTable">
      <tableEntries endTime="303" value="2.0"/>
    </occurence>
  </org.modelplex.tipm:OpenWorkload>
  <org.modelplex.tipm:ValueTable>
    <tableEntries endTime="305" value="20.0"/>
  </org.modelplex.tipm:ValueTable>
...
</xmi:XMI>


The transformation is launched programmatically by the workbench. All required metamodels and models are loaded and access to model elements in the PAM model is possible. The latter, I tested with a helper in the ATL script. This helper is a String and print the value of the name attribute of the first PAM!Workload element to the console by using debug() in ATL.
However, if I execute the transformation manually via a launch configuration, the transformation produces the correct result (the same as in ATL 3.0.0). In both cases, we use the regular ATL VM.

Do you have any ideas what the problem is? Please, let me know if you need addtional information. I have no idea what kind of information is useful for this problem.

Best regards,
Sebastian
Re: [ATL] Transformations with ATL 3.0.0 and 3.0.1 [message #512871 is a reply to message #512864] Mon, 08 February 2010 09:29 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
What do you exactly mean by "not contained in the model " ?

Maybe it's a problem of model inter-references.

Try :

options.put("allowInterModelReferences", "false");
Re: [ATL] Transformations with ATL 3.0.0 and 3.0.1 [message #512873 is a reply to message #512864] Mon, 08 February 2010 04:34 Go to previous messageGo to next message
William Piers is currently offline William PiersFriend
Messages: 301
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------010300010706080609090409
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hello,

Answers below:

S.Cech a écrit :
> Hi,
>
> in our tool - the MDPE Workbench - we invoke ATL programmatically. So
> far, we used ATL 3.0.0 and all our transformations worked very well.
> Recently, we updated the ATL version to ATL 3.0.1 and there is a very
> strange problem for which we have no ideas how we can solve it.
>
> The transformation takes a so called TIPM model, a Trace model and
> another annotation (PAM) model as input and generates a new TIPM with
> additonal annotation information from the PAM model. As mentioned above
> in ATL 3.0.0 the transformation works fine.

Both programmatically and using launch configurations ?

> If we use ATL 3.0.1, data
> from PAM is available in the TIPM, but not contained in the model (see
> the snipped of TIPM).
>

Did you try using the latest 3.0.2 build ?
http://www.eclipse.org/modeling/download.php?file=/modeling/ m2m/atl/downloads/drops/3.0.2/S201001190421/m2m-atl-SDK-3.0. 2RC1.zip

>
> ..
> </org.modelplex.tipm:TIPM>
> <org.modelplex.tipm:OpenWorkload description="WorkloadName">
> <occurence xsi:type="org.modelplex.tipm:ValueTable">
> <tableEntries endTime="303" value="2.0"/>
> </occurence>
> </org.modelplex.tipm:OpenWorkload>
> <org.modelplex.tipm:ValueTable>
> <tableEntries endTime="305" value="20.0"/>
> </org.modelplex.tipm:ValueTable>
> ..
> </xmi:XMI>
>
>
> The transformation is launched programmatically by the workbench. All
> required metamodels and models are loaded and access to model elements
> in the PAM model is possible. The latter, I tested with a helper in the
> ATL script. This helper is a String and print the value of the name
> attribute of the first PAM!Workload element to the console by using
> debug() in ATL.
> However, if I execute the transformation manually via a launch
> configuration, the transformation produces the correct result (the same
> as in ATL 3.0.0). In both cases, we use the regular ATL VM.
>
> Do you have any ideas what the problem is? Please, let me know if you
> need addtional information. I have no idea what kind of information is
> useful for this problem.

All what you could provide is useful : ATL project, metamodels,
programmatic launch snippet or entire code...
This kind of bug may be quite hard to reproduce, so feel free to submit
materials - attached to your answer - if you are allowed to, regarding
to your confidentiality policy. Otherwise, try to make a simple project
reproducing the bug.

Thanks in advance,

William

>
> Best regards,
> Sebastian

--
Ne manquez pas notre prochaine formation ATL inter entreprises:
ATL - Paris - du 2 au 3 Décembre 2009
Pour plus de dates et pour le détail de cette formation:
http://www.obeo.fr/pages/formations/fr

Don't forget our next ATL training:
ATL - Paris - 2009 December from 2th to 3th
More dates and training program on:
http://www.obeo.fr/pages/formations/fr

--------------010300010706080609090409
Content-Type: text/x-vcard; charset=utf-8;
name="william_piers.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="william_piers.vcf"

YmVnaW46dmNhcmQNCmZuOldpbGxpYW0gUGllcnMNCm46UGllcnM7V2lsbGlh bQ0Kb3JnOk9i
ZW8NCmFkcjoyIHJ1ZSBSb2JlcnQgU2NodW1hbm47O2xvdCAyNDtOQU5URVM7 OzQ0NDA4O0Zy
YW5jZQ0KZW1haWw7aW50ZXJuZXQ6d2lsbGlhbS5waWVyc0BvYmVvLmZyDQp0 aXRsZTpNREEg
Q29uc3VsdGFudA0KdGVsO3dvcms6KzMzICgwKTIgNTEgMTMgNTAgNTMNCnVy bDpodHRwOi8v
d3d3Lm9iZW8uZnINCnZlcnNpb246Mi4xDQplbmQ6dmNhcmQNCg0K
--------------010300010706080609090409--
Re: [ATL] Transformations with ATL 3.0.0 and 3.0.1 [message #514013 is a reply to message #512873] Fri, 12 February 2010 05:53 Go to previous messageGo to next message
Sebastian is currently offline SebastianFriend
Messages: 5
Registered: July 2009
Junior Member
Hi,

I tried out the option 'allowInterModelReferences' as well as the ATL 3.0.2 RC1, however with the same result.

In the following, I provide some details how the transformation is executed from our tooling.

In order to invoke the ATL transformaiton programatically we use an additional model, where references to required models and metamodels are stored. We use the following code to prepare the ATL Launcher:

	loadMetamodels(atlTransformationChain);

	for (ATLTransformation atlTransformation : atlTransformationChain
			.getAtlTransformations()) {
		...
		ILauncher launcher = CoreService
				.getLauncher("Regular VM (with debugger)");
		Map<String, Object> initOptions = new HashMap<String, Object>();
		initOptions.put("allowInterModelReferences", "false");
		launcher.initialize(initOptions);
		
		...
		outputModels.addAll(loadModels(launcher, atlTransformation));

		launch(launcher, atlTransformation, outputModels, monitor);
		...
	}


The following loadModels method ( invoked from the method above) is responsible to add source and target models to the launcher.

private List<ATLModel> loadModels(ILauncher launcher,
			ATLTransformation atlTransformation) throws CoreException,
			ATLCoreException {
		...
		Map<String, Object> modelOptions = new HashMap<String, Object>();
		for (ATLModel model : sourceModels) {
			final String modelName = model.getName();
			modelOptions.put(MODEL_NAME, modelName);
			modelOptions.put(PATH, model.getUri());
			modelOptions.put(NEW_MODEL, Boolean.FALSE.toString());
			IModel iModel = defaultModelfactory.newModel(referenceModels.get(model
					.getConformsTo().getName()), modelOptions);
			models.put(modelName, iModel);
			injectors.get(model.getConformsTo().getName()).inject(
				models.get(modelName), convertURI(model));
			launcher.addInModel(models.get(modelName), modelName, model.getConformsTo()
				.getName());
		}
		//similar code for returnModels

		return retModelList;


The following method launch invokes the ATL VM:

private void launch(ILauncher launcher, ATLTransformation atlTransformation,
			List<ATLModel> outputModels, IProgressMonitor monitor)
			throws MDPEException {
		Map<String, Object> options = new HashMap<String, Object>();
		options.put("isRefiningTraceMode", new Boolean(atlTransformation
				.isIsRefinement()).toString());
		options.put("launcherName", "Regular VM (with debugger)");
		options.put("disassemblyMode", "false");
		options.put("continueAfterError", "false");
		options.put("disableAttributeHelperCache", "true");
		options.put("printExecutionTime", "false");
		options.put("OPTION_DERIVED", "true");
		options.put("modelHandlers", modelHandlers);
		options.put("step", "false");
		options.put("profile", "false");


		try {
			launcher.launch("run", monitor, options, new URL(atlTransformation
					.getUri()).openStream());

			// extract all output models
			for (ATLModel model : outputModels) {
				extractors.get(model.getConformsTo().getName()).extract(
						models.get(model.getName()), convertURI(model));
			}
		}...
	}

Re: [ATL] Transformations with ATL 3.0.0 and 3.0.1 [message #514659 is a reply to message #512864] Tue, 16 February 2010 09:11 Go to previous message
Sebastian is currently offline SebastianFriend
Messages: 5
Registered: July 2009
Junior Member
Hello again,

I tried to set breakpoints in the launch method of class RegularVMLauncher:

- The first breakpoint has been added to the first line: IDebugTarget mTarget = null;
- The second one: if (launchParam != null)

Then I observed resources in the ResourceSet of the EMFModelLoader class at each breakpoint. The ResourceSet is referenced in the models attribute of RegularVM launcher.

At breakpoint 1 (before transformation execution with ATL 3.0.1 / 3.0.2RC), the ResourceSet contains:

[org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl@117bc60 uri='file:/C:\Users\Sebastian\Desktop\WinesellerAnnotaions\Core.mdpe', 
...XMIResourceImpl@1505ddb uri='file:/C:\Users\Sebastian\Desktop\WinesellerAnnotaions\Parameter.mdpe', 
...XMIResourceImpl@141ea0d uri='file:/C:\Users\Sebastian\Desktop\WinesellerAnnotaions\Requirement.mdpe', 
...UMLResourceImpl@5f8407 uri='platform:/resource/MDPEAnnotationExample/wineseller.uml', 
...XMIResourceImpl@1c3bff2 uri='file:/E:\01Test\ToolIntegration\runtime\Configuration\.metadata\.plugins\org.modelplex.mdpe.workbench.core\preTIPM.tipm', 
...ToolResource@6ed4db uri='file:/E:\01Test\ToolIntegration\runtime\Configuration\.metadata\.plugins\org.modelplex.mdpe.workbench.core\source2preTIPM.trace', 
...XMIResourceImpl@1c5274d uri='file:/E:/01Test/ToolIntegration/runtime/Configuration/.metadata/.plugins/org.modelplex.mdpe.workbench.core/TIPM.tipm', 
...ToolResource@125b20a uri='file:/E:/01Test/ToolIntegration/runtime/Configuration/.metadata/.plugins/org.modelplex.mdpe.workbench.core/Dev2TIPM.trace', 
...XMIResourceImpl@1cbedaf uri='file:/E:/01Test/ToolIntegration/runtime/Configuration/.metadata/.plugins/org.modelplex.mdpe.workbench.core/TIPM.tipm', 
...ToolResource@161b165 uri='file:/E:/01Test/ToolIntegration/runtime/Configuration/.metadata/.plugins/org.modelplex.mdpe.workbench.core/Dev2TIPM.trace']


At breakpoint 2 (after transformation execution with ATL 3.0.1 / 3.0.2RC), the ResourceSet contains:

...XMIResourceImpl@117bc60 uri='file:/C:\Users\Sebastian\Desktop\WinesellerAnnotaions\Core.mdpe', 
...XMIResourceImpl@1505ddb uri='file:/C:\Users\Sebastian\Desktop\WinesellerAnnotaions\Parameter.mdpe', 
...XMIResourceImpl@141ea0d uri='file:/C:\Users\Sebastian\Desktop\WinesellerAnnotaions\Requirement.mdpe', 
...UMLResourceImpl@5f8407 uri='platform:/resource/MDPEAnnotationExample/wineseller.uml', 
...XMIResourceImpl@1c3bff2 uri='file:/E:\01Test\ToolIntegration\runtime\Configuration\.metadata\.plugins\org.modelplex.mdpe.workbench.core\preTIPM.tipm', 
...ToolResource@6ed4db uri='file:/E:\01Test\ToolIntegration\runtime\Configuration\.metadata\.plugins\org.modelplex.mdpe.workbench.core\source2preTIPM.trace', 
...XMIResourceImpl@1c5274d uri='file:/E:/01Test/ToolIntegration/runtime/Configuration/.metadata/.plugins/org.modelplex.mdpe.workbench.core/TIPM.tipm', 
...ToolResource@125b20a uri='file:/E:/01Test/ToolIntegration/runtime/Configuration/.metadata/.plugins/org.modelplex.mdpe.workbench.core/Dev2TIPM.trace', 
...XMIResourceImpl@1cbedaf uri='file:/E:/01Test/ToolIntegration/runtime/Configuration/.metadata/.plugins/org.modelplex.mdpe.workbench.core/TIPM.tipm', 
...ToolResource@161b165 uri='file:/E:/01Test/ToolIntegration/runtime/Configuration/.metadata/.plugins/org.modelplex.mdpe.workbench.core/Dev2TIPM.trace', 
...XMIResourceImpl@1ce9e4d uri='file:/Core.mdpe', ]



The interesting point is the last entry in the ResourceSet with uri file:/Core.mdpe, which is not a valid file.

If I use ATL 3.0.0 this invalid file does not occur (see the resource set before and after the transformation.

before transformation with ATL 3.0.0
...XMIResourceImpl@14b5ad5 uri='file:/C:/Users/Sebastian/Desktop/Annotation%20Model%20Example/annotations/Core.mdpe', 
...XMIResourceImpl@385bbe uri='file:/C:/Users/Sebastian/Desktop/Annotation%20Model%20Example/annotations/Parameter.mdpe', 
...XMIResourceImpl@f170e uri='file:/C:/Users/Sebastian/Desktop/Annotation%20Model%20Example/annotations/Requirement.mdpe', 
...UMLResourceImpl@1af6f1c uri='platform:/resource/Annotation%20Model%20Example/wineseller.uml', 
...XMIResourceImpl@15adc79 uri='file:/E:/01Test/EclipseRCP_ATL3/runtime-New_configuration/.metadata/.plugins/org.modelplex.mdpe.workbench.core/preTIPM.tipm',
...ToolResource@40b5a9 uri='file:/E:/01Test/EclipseRCP_ATL3/runtime-New_configuration/.metadata/.plugins/org.modelplex.mdpe.workbench.core/source2preTIPM.trace', 
...XMIResourceImpl@1884e78 uri='file:/E:/01Test/EclipseRCP_ATL3/runtime-New_configuration/.metadata/.plugins/org.modelplex.mdpe.workbench.core/TIPM.tipm',
...ToolResource@1d7caeb uri='file:/E:/01Test/EclipseRCP_ATL3/runtime-New_configuration/.metadata/.plugins/org.modelplex.mdpe.workbench.core/Dev2TIPM.trace',
...XMIResourceImpl@4b1fc3 uri='file:/E:/01Test/EclipseRCP_ATL3/runtime-New_configuration/.metadata/.plugins/org.modelplex.mdpe.workbench.core/TIPM.tipm',
...ToolResource@1246a4 uri='file:/E:/01Test/EclipseRCP_ATL3/runtime-New_configuration/.metadata/.plugins/org.modelplex.mdpe.workbench.core/Dev2TIPM.trace']


after transformation with ATL 3.0.0
[...XMIResourceImpl@14b5ad5 uri='file:/C:/Users/Sebastian/Desktop/Annotation%20Model%20Example/annotations/Core.mdpe',
...XMIResourceImpl@385bbe uri='file:/C:/Users/Sebastian/Desktop/Annotation%20Model%20Example/annotations/Parameter.mdpe', 
...XMIResourceImpl@f170e uri='file:/C:/Users/Sebastian/Desktop/Annotation%20Model%20Example/annotations/Requirement.mdpe', 
...UMLResourceImpl@1af6f1c uri='platform:/resource/Annotation%20Model%20Example/wineseller.uml', 
...XMIResourceImpl@15adc79 uri='file:/E:/01Test/EclipseRCP_ATL3/runtime-New_configuration/.metadata/.plugins/org.modelplex.mdpe.workbench.core/preTIPM.tipm', 
...ToolResource@40b5a9 uri='file:/E:/01Test/EclipseRCP_ATL3/runtime-New_configuration/.metadata/.plugins/org.modelplex.mdpe.workbench.core/source2preTIPM.trace', 
...XMIResourceImpl@4b1fc3 uri='file:/E:/01Test/EclipseRCP_ATL3/runtime-New_configuration/.metadata/.plugins/org.modelplex.mdpe.workbench.core/TIPM.tipm',
...ToolResource@1246a4 uri='file:/E:/01Test/EclipseRCP_ATL3/runtime-New_configuration/.metadata/.plugins/org.modelplex.mdpe.workbench.core/Dev2TIPM.trace']


Any ideas?

Best regards,
Sebastian
Previous Topic:[QVTO] subobjects() order
Next Topic:[ATL] Lazy Rule Inheritance with multiple Arguments
Goto Forum:
  


Current Time: Thu Apr 25 19:10:35 GMT 2024

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

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

Back to the top