Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » attribute value cannot be set(attribute value cannot be set)
attribute value cannot be set [message #502696] Wed, 09 December 2009 13:28 Go to next message
schach  is currently offline schach Friend
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 #502749 is a reply to message #502696] Wed, 09 December 2009 15:38 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
Hi,

You can't navigate the target model which is aadl2.
You have two solutions :
- if the property DataRepresentation is obtained from an element in mergedMarteModel then you can point on this element and ATL will automatically resolve it to the corresponding aadl2!Property

let's suppose that mergedMarteModel has an element with 'DataRepresentation' as it's name which is transformed into an aadl2!Property with the same name. You could use :

property <-mergedMarteModel!Element->allInstances()->select(tmp | tmp.name = 'DataRepresentation')->first()

- if the property DataRepresentation is obtained from a lazy rule, you can switch to an unique lazy rule and call that rule in the binding :

unique lazy rule createProperty {
from s : String
to t : aadl2!Property(
name <- s
)
}

and then

pa : aadl2!PropertyAssociation(
property <-thisModule.createProperty('DataRepresentation')
)

The keyword "unique" allows to create only one Property per String even if the rule is called multiple times with the same String.


BTW, you don't have to use an imperative statement to put pa in the ownedPropertyAssociation reference of t. You can write :

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)),
ownedPropertyAssociation <- pa
),
pa : aadl2!PropertyAssociation(
Re: attribute value cannot be set [message #502898 is a reply to message #502749] Thu, 10 December 2009 08:51 Go to previous message
schach  is currently offline schach Friend
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

Previous Topic:[ATL] Running ATL transformation programmatically
Next Topic:[ATL] No Resource found, unable to extract
Goto Forum:
  


Current Time: Thu Apr 18 23:31:26 GMT 2024

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

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

Back to the top