M2 to M1 transformation (demotion?) [message #68085] |
Tue, 04 December 2007 08: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 #68235 is a reply to message #68152] |
Wed, 05 December 2007 09:35 |
Eclipse User |
|
|
|
Originally posted by: jhanss22.volvocars.com
William,
Thanks for your reply! What I really want is to consider entities in the
Configuration model (such as the ComIPduSize) to be available as MetaModel
entities in the transformation. I will try to elaborate a little bit more:
In the current release of the AUTOSAR standard, some information which
ended up in the Configuration model such as ComIPduSize is actually fixed
and would probably have better been defined as MetaModel entities. At this
point in time, it is not possible to change this in the standard.
What I want to achieve is a description of a mapping between entities in
MetaModels such as the System::IPdu::length to specific entities in Models
such as the <PARAM-CONF-CONTAINER-DEF><INTEGER-PARAM-DEF> where the
shortName is "ComIPduSize".
In a standard transformation both IPdu::length AND ComIPduSize would have
been described as entities in MetaModels. However, in AUTOSAR this is not
the case and I still need to come up with a transformation description.
Kind regards,
Jonas
|
|
|
Re: M2 to M1 transformation (demotion?) [message #68247 is a reply to message #68235] |
Wed, 05 December 2007 13:18 |
William Piers Messages: 301 Registered: July 2009 |
Senior Member |
|
|
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.03141 seconds