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 
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 09:53] by Moderator