Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Multiple output files and inter-model references(Splitting one input model to multiple output models: inter-model references fail )
[ATL] Multiple output files and inter-model references [message #539980] Mon, 14 June 2010 13:53 Go to next message
Christian Kurze is currently offline Christian KurzeFriend
Messages: 16
Registered: July 2009
Junior Member
Hi,

I know there are similar topics on this issue, but no one has found a solution as it seems.

Since ATL 3.1 (I'm using RC4: 3.1.0.v201006071047) it is possible to have multiple output files referencing the same metamodel. And it is also possible to use the 'in' operator (see end of section http://www.eclipse.org/forums/index.php?t=msg&goto=10050 3&).Quite a nice function Smile

I have the following use case: I have one large model and have to separate it into some sub-models. Therefore I try do develop a transformation which is compiled at runtime and executed. Before this step, I try the use case with a simple example (no generation, everything is done manually).

My transformation:
-- @nsURI FCIM=http://fcim/0.0.4

module fcim2fcimmulti;
create OUTWUERFEL : FCIM, OUTDIM1 : FCIM, OUTDIM2 : FCIM from IN : FCIM;

-- Schema references
helper def : schemaOutWuerfel : FCIM!Schema = OclUndefined;
helper def : schemaOutDim1 : FCIM!Schema = OclUndefined;
helper def : schemaOutDim2 : FCIM!Schema = OclUndefined;

rule Schema2Schema {
	from 
		schemaIn : FCIM!Schema
	to
		schemaOutWuerfel : FCIM!Schema in OUTWUERFEL (
			name <- schemaIn.name
		),
		schemaOutDim1 : FCIM!Schema in OUTDIM1 (
			name <- schemaIn.name
		),
		schemaOutDim2 : FCIM!Schema in OUTDIM2 (
			name <- schemaIn.name											  
		)
	do {
		thisModule.schemaOutWuerfel <- schemaOutWuerfel;
		thisModule.schemaOutDim1 <- schemaOutDim1;
		thisModule.schemaOutDim2 <- schemaOutDim2;
	}
}

rule Wuerfel2Wuerfel_Sales {
	from
		wuerfelIn : FCIM!Wuerfel (
			wuerfelIn.name = 'Sales'
		)
	to
		wuerfelOut : FCIM!Wuerfel in OUTWUERFEL (
			schema <- thisModule.schemaOutWuerfel,
			name <- wuerfelIn.name
			--??dimensionAss <- wuerfelIn.dimensionAss
		)	
}

rule DimensionAss2DimensionAss_Sales {
	from
		dimAssIn : FCIM!WuerfelDimensionAss(
			dimAssIn.wuerfel.name = 'Sales'
		)
	to
		dimAssOut : FCIM!WuerfelDimensionAss in OUTWUERFEL (
			wuerfel <- dimAssIn.wuerfel,
			dimension <- dimAssIn.dimension			
		)
	do {
		--dimAssOut.refSetValue('dimension', thisModule.resolveTemp(dimAssIn.dimension, 'dimOut'));
	}
}

rule Dimension2Dimension_Time {
	from
		dimIn : FCIM!Dimension (
			dimIn.name = 'Time'
		)
	to
		dimOut : FCIM!Dimension in OUTDIM1 (
			schema <- thisModule.schemaOutDim1,
			name <- dimIn.name,
			wuerfelAss <- dimIn.wuerfelAss
		)
}

rule Dimension2Dimension_Customer {
	from
		dimIn : FCIM!Dimension (
			dimIn.name = 'Customer'
		)
	to
		dimOut : FCIM!Dimension in OUTDIM2 (
			schema <- thisModule.schemaOutDim2,
			name <- dimIn.name,
			wuerfelAss <- dimIn.wuerfelAss
		)
}


The problem is that the main file OUTWUERFEL (W_Sales.fcim), which links to the both dimension files OUTDIM1 (outdim1.fcim) and OUTDIM2 (outdim2.fcim), has wrong references (no file names are given, instead "new-model"):

<?xml version="1.0" encoding="ISO-8859-1"?>
<fcim:Schema xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:fcim="http://fcim/0.0.4" name="sales">
  <facts name="Sales">
    <dimensionAss>
      <dimension href="new-model#//@dimensions.0"/>
    </dimensionAss>
    <dimensionAss>
      <dimension href="new-model#//@dimensions.0"/>
    </dimensionAss>
  </facts>
</fcim:Schema>



The references in the linked files look nice:
<?xml version="1.0" encoding="ISO-8859-1"?>
<fcim:Schema xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:fcim="http://fcim/0.0.4" name="sales">
  <dimensions name="Time">
    <wuerfelAss href="W_Sales.fcim#//@facts.0/@dimensionAss.1"/>
  </dimensions>
</fcim:Schema>


<?xml version="1.0" encoding="ISO-8859-1"?>
<fcim:Schema xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:fcim="http://fcim/0.0.4" name="sales">
  <dimensions name="Customer">
    <wuerfelAss href="W_Sales.fcim#//@facts.0/@dimensionAss.0"/>
  </dimensions>
</fcim:Schema>


How to get rid of the "new-model" reference? There should be the names of the other two files?!?

Has anybody any ideas? Maybe I just do a very simple mistake?

Thanks for any help!

Chris

[Updated on: Mon, 14 June 2010 13:53]

Report message to a moderator

Re: [ATL] Multiple output files and inter-model references [message #540958 is a reply to message #539980] Thu, 17 June 2010 19:15 Go to previous message
Christian Kurze is currently offline Christian KurzeFriend
Messages: 16
Registered: July 2009
Junior Member
I just opened a bug for this issue:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=317233

Previous Topic:[ATL]How to transform XML-Model (conformed to XSD-Metamodel) in ecore
Next Topic:[ATL] AM3-Injector transforms xml to ecore with errors
Goto Forum:
  


Current Time: Tue Apr 16 04:35:05 GMT 2024

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

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

Back to the top