M2 to M1 transformation (demotion?) [message #68085] |
Tue, 04 December 2007 03:24  |
Eclipse User |
|
|
|
Originally posted by: jhanss22.volvocars.com
Hi all,
I am a member of a standardization organization called AUTOSAR
(www.autosar.org). In my particular work-group we develop models for
describing a standardized automotive software architecture. We are just
about to define a mapping between two models and have to decide upon what
technology to use to describe this mapping/transformation. I have spent
some time reviewing ATL and have a short question that I would like to ask
anyone with more knowledge.
An extract of our models looks something like the following:
// MetaModel
package Generic {
class Identifiable {
attribute shortName : String;
attribute UUID : String;
}
}
// MetaModel
package System {
class IPdu extends Generic::Identifiable {
attribute length : Integer;
}
}
// MetaModel
package Configuration {
class ParamConfContainerDef exends Generic::Identifiable {
attribute parameter : ConfigParameter;
}
class ConfigParameter exends Generic::Identifiable {
}
class IntegerParamDef exends ConfigParameter {
attribute defaultValue : Integer
attribute max : Integer
attribute min : Integer
}
}
// Model
<PARAM-CONF-CONTAINER-DEF UUID="DCE:87fca427-919f-4d90-82f0-88a1d85028ed">
<SHORT-NAME>ComIPdu</SHORT-NAME>
<INTEGER-PARAM-DEF UUID="DCE:96e52a0f-7cc6-4d43-934e-080fb46c9e8a">
<SHORT-NAME>ComIPduSize</SHORT-NAME>
<MAX>1</MAX>
<MIN>1</MIN>
</INTEGER-PARAM-DEF>
</PARAM-CONF-CONTAINER-DEF>
What I wan't to do is to describe a transformation (demotion) from the
MetaModel "System" into the Model "Configuration", i.e. the transformation
goes between different meta levels. From what I have understood, this
should be possible to do using ATL, but I have not understood how.
Example of wanted transformation/mapping:
AUTOSAR_System::IPdu::length ==>
<PARAM-CONF-CONTAINER-DEF><INTEGER-PARAM-DEF><MAX>
Is this mapping possible to do using ATL?
Kind regards,
Jonas Hansson
|
|
|
|
|
Re: M2 to M1 transformation (demotion?) [message #68247 is a reply to message #68235] |
Wed, 05 December 2007 08:18  |
Eclipse User |
|
|
|
This is a multi-part message in MIME format.
--------------060903010501040700090106
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit
Hello,
Ok, so the transformation you describe seems to be simplier than what I
purposed :-).
example :
=========
rule sampleMapping {
from
input : System!IPdu
to
output : Configuration!ParamConfContainerDef (
UUID <- input.UUID,
shortName <- input.name,
parameter <- lengthParam
),
lengthParam: Configuration!IntegerParamDef (
UUID <- --NOTE : here you need to generate a new UUID
shortName <- input.name+'Size',
max <- input.length,
min <- input.length
)
}
Perhaps am I missing something again... but what you need to consider is
that as long as you provide input and output metamodels, corresponding
to source and target models, you will be able to describe all kind of
mappings in ATL.
I advise you to try, and to report here your eventual difficulties.
Best regards,
William
Jonas Hansson a
|
|
|
Powered by
FUDForum. Page generated in 0.25806 seconds