Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » EMF cross-model references(Elements of several output models in ONE file?)
EMF cross-model references [message #898743] Fri, 27 July 2012 12:25
Gunnar Arndt is currently offline Gunnar Arndt
Messages: 57
Registered: June 2012
Member
I'm using ATL to transform a customer-specific Ecore model into an Ecore model of OTX (Open Test eXchange, an ISO standard) and HMI (Human-Machine Interface, an extension of OTX).
The Ecore models of OTX and HMI were created from an XML-Schema (otx.xsd, which imports hmi.xsd). I wrote 'models' because the Ecore's XSD importer creates a seperate model for each imported sub-model/extension, although it'd better be one model with elements added as an extension.

That means that I have to set up the ATL module with several output metamodels/models:
-- @path transformate=ModelTransformation.ecore
-- @path otx=otx.ecore
-- @path otxHmi=hmi.ecore
-- @atlcompiler atl2006

module transformate2otx;
create OUT: otx, hmi: otxHmi from IN: transformate; -- create 2 output models
-- rules creating OTX and HMI output:
rule Presenter2Screen {
	from
		source: transformate!Presenter
	to
		otxActionRealisation: otxHmi!OpenScreen (
			-- ...
		),
		otxScreenDeclaration: otx!DocumentVariableDeclaration (
			-- ...
		)
}


The launch configuration for ATL in Eclipse requires me to allow cross-model references, and to provide two output models (one with the metamodel OTX, the other one with the metamodel HMI) resulting in two output files.

Any HMI element has to be a child of an OTX element and is added to one by the ATL rules.
The problem: After the transformation, the HMI output file contains the last element of the HMI metamodel created during the transformation process, although it should be empty:
<?xml version="1.0" encoding="ISO-8859-1"?>
<hmi:OpenScreen modal="true">
  <hmi:screenHandle name="Test_2108"/>
  <hmi:arguments>
    <hmi:outArg param="Test_2108_OutArg">
      <hmi:variable xsi:type="otx:StringVariable" name="ReturnVariable"/>
    </hmi:outArg>
  </hmi:arguments>
</hmi:OpenScreen>

The HMI elements created before are added as children of OTX elements in the OTX output file; that is the desired behavior. Note: this means that that last HMI element is missed in the OTX file).

Now, to finally to get to the point, my question: Can I avoid the creation of several output files and make sure that all created elements (of any output model) reside in one single output file?

This seems to be an uncommon problem in ATL, although several output models are allowed. I would be grateful for any help you can provide - and thank you for reading to this point. I'm not yet sure if I could make the problem clear.
Previous Topic:Building/Compiling ATL Files With ANT And Maven
Next Topic:ATL:Package with URI not found
Goto Forum:
  


Current Time: Tue Sep 16 21:40:26 GMT 2014

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

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