Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Model-to-Model Transformation » [ATL]different transformed results between ATL configuration and Java programming transformation
[ATL]different transformed results between ATL configuration and Java programming transformation [message #988850] Mon, 03 December 2012 08:04
Beatus Ding is currently offline Beatus Ding
Messages: 18
Registered: November 2012
Junior Member
Hi everyone,I'm transforming one ".fm model" into another ".unify" model using ATL.Nothing wrong with ATL configuration.But when I try to programming launch atl transformation with the following code.I get exactly the same result,the only differences is that the prefix is gone.How to resolve the problem?
String srcMetaURI="file:///e:/SynModel/unify.core/model/unify.ecore";
		String tgtMetaURI="file:///e:/SynModel/fm.core/model/fm.ecore";
		String srcModelURI="file:///E:/SynModel/atl/fm/generic model/new_domain.unify";
		String tgtModelURI="D:/Document/workspace_test/AGM_FM/new_domain.xml";
		String asmPath="file:///E:/SynModel/atl/fm/atl/unify2fm.asm";
		String srcMetaURI2="http://se.edu.cn/unify";
		String tgtMetaURI2="http:///featureIDE";
		
		register(resource(srcMetaURI, true));
		register(resource(tgtMetaURI, true));
		
		Resource model = resource(srcModelURI, true);
		
		OneInOneOutTransformation trans = new Transformations.Builder()
		.asm(asmPath)
		.in(get(srcMetaURI2), "IN", "FM")
		.out(get(tgtMetaURI2), "OUT","UNIFY")
		.buildOneInOneOut();
		
		EMFModel out = transform(inject(model, get(srcMetaURI2)), trans);
		
		out.getResource().setURI(URI.createFileURI(tgtModelURI));
		try {
			out.getResource().save(null);
		} catch (IOException e) {
			e.printStackTrace();
		}

The result of ATL Configuration(from the graphical operation´╝ëis as follows:
<?xml version="1.0" encoding="ASCII"?>
<unify:Model xmlns:unify="http://se.fudan.edu.cn/unify" unify:type="FeatureModelType">
  <unify:entities unify:type="StructType" unify:variable="false">
  </unify:entities>
  <unify:attributes unify:name="chosenLayoutAlgorithm" unify:type="String" unify:value="1"/>
</unify:Model>

The result of Java programming transformation is as follows:
<?xml version="1.0" encoding="ASCII"?>
<unify:Model xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:unify="http://se.fudan.edu.cn/unify" type="FeatureModelType">
  <entities type="StructType" variable="false">
  </entities>
  <attributes name="chosenLayoutAlgorithm" type="String" value="1"/>
</unify:Model>

Previous Topic:Behavioral features ( state machine) support
Next Topic:Ant ATL tasks command line execution
Goto Forum:
  


Current Time: Sat Apr 19 00:24:51 EDT 2014

Powered by FUDForum. Page generated in 0.03331 seconds