attribute value cannot be set [message #502696] |
Wed, 09 December 2009 13:28 |
schach Messages: 5 Registered: October 2009 |
Junior Member |
|
|
Hi all,
I try to implement an ATL transformation from Marte to AADL.
In my ATL file, as input files i get the marte model to translate and an aaxl file containing an aadl property set. Both are conformed to their respective metamodel.
I have the following rule:
lazy rule dataType {
from
s : mergedMarteModel!Component
to
t : aadl2!DataType (
name <- s.name,
ownedSubprogramAccess <- thisModule.getSubprogramAccesses(s.ownedAttribute)->collect(e | thisModule.subprogramAccesses(e)),
ownedSubprogramGroupAccess <- thisModule.getSubprogramGroupAccesses(s.ownedAttribute)->collect(e | thisModule.subprogramGroupAccesses(e))
),
pa : aadl2!PropertyAssociation(
property <-aadl2!Property->allInstances()->select(tmp | tmp.name = 'DataRepresentation')->first()
)
do {
t.ownedPropertyAssociation <- pa;
thisModule.debug('trace1: ' + aadl2!Property->allInstances()->select(tmp | tmp.name = 'DataRepresentation')->first().name);
thisModule.debug('trace 2: ' + pa.property.name);
}
}
During the ATL transformation, I get an error on this lazy rule because in trace2 the pa.property is 'OclUndefined' whereas in trace 1 I get the right property name.
Seems like I can find the property 'DataRepresentation' but cannot assigned it to the property attribute of pa.
I set 'allowInterModelReferences' to true but still get no success in the transformation.
If I create a property in the output file I can assign it to the pa.property attribute (see below)
lazy rule dataType {
from
s : mergedMarteModel!Component
to
t : aadl2!DataType (.......),
p : aadl!Property ( name <- 'MyProperty'),
pa : aadl2!PropertyAssociation(
property <-p
)
do {
t.ownedPropertyAssociation <- pa;
}
}
Does anyone get any idea to help me?
Regards,
Arnaud Schach
|
|
|
|
Re: attribute value cannot be set [message #502898 is a reply to message #502749] |
Thu, 10 December 2009 08:51 |
schach Messages: 5 Registered: October 2009 |
Junior Member |
|
|
Hi,
the solution you propose works since you create the property into the output model.
In my problem I already have a property set containing my property. I just want to make a reference to this property which is defined in a different file.
In the aaxl format it is resolved in the following way: <property href="../Plugin_Resources/aaxl/SEI.aaxl2#_a4v1Ct_mEd6NVMrS4ccgkg "/>
Where _a4v1Ct_mEd6NVMrS4ccgkg is the xmi:id of the property in the property set file (SEI.aaxl2)
I can navigate into the property set, i can get the xmi:id of the properties but I cannot reference the property in the PropertyAssociation.
[Updated on: Thu, 10 December 2009 08:52] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.02747 seconds