Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL]How to get an attribute which is defined in another file
[ATL]How to get an attribute which is defined in another file [message #93322] Mon, 27 October 2008 13:20 Go to next message
yue ma is currently offline yue maFriend
Messages: 22
Registered: July 2009
Junior Member
Hi,
I met such a problem:
I want to select a "propertyDefinition" from the "propertyAssociation",
the propertyDefinition is referenced to another file, see the XML file
below.

I write a helper, but it seems there is some problem, I cannot get the
identified "propertyDefinition", it always returns empty .

Is there anything I made wrong?
Or how could I get such an attribute which is automatically defined in
another file?

helper context core!ThreadImpl def: ThreadPeriodIsDefined(): Boolean =
if self.properties.propertyAssociation.oclIsUndefined()
then false
else self.properties.propertyAssociation-> collect(a|
a.propertyDefinition) -> select(b|b.name = 'Period') ->
flatten()->notEmpty()
endif;


...............
<threadImpl name="client_thread.impl" compType="#//@threadType.0">
<properties>
<propertyAssociation noMode="false"
propertyDefinition=" ../../../plugin/edu.cmu.sei.osate.workspace/resources/proper ties/AADL_Properties.aaxl#//@propertySet.0/@propertyDefiniti on.48 "
constant="false" access="false" append="false" derived="false">
<propertyValue xsi:type="property:EnumValue"
enumLiteral=" ../../../plugin/edu.cmu.sei.osate.workspace/resources/proper ties/AADL_Project.aaxl#//@propertySet.0/@propertyType.3/@enu mLiteral.0 "/>
</propertyAssociation>
<propertyAssociation noMode="false"
propertyDefinition=" ../../../plugin/edu.cmu.sei.osate.workspace/resources/proper ties/AADL_Properties.aaxl#//@propertySet.0/@propertyDefiniti on.65 "
constant="false" access="false" append="false" derived="false">
<propertyValue xsi:type="property:IntegerValue"
unitLiteral=" ../../../plugin/edu.cmu.sei.osate.workspace/resources/proper ties/AADL_Project.aaxl#//@propertySet.0/@propertyType.9/@uni tLiteral.3 "
valueString="100" value="100" base="10"/>
</propertyAssociation>
</properties>
</threadImpl>
..................
Re: [ATL]How to get an attribute which is defined in another file [message #93422 is a reply to message #93322] Tue, 28 October 2008 13:35 Go to previous messageGo to next message
Freddy Allilaire is currently offline Freddy AllilaireFriend
Messages: 130
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------060306080608040707050301
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

Hi,

All your models should be loaded. In your case, I think
AADL_Properties.aaxl should be added in the launch configuration.

Regards,
Freddy.

yue a
Re: [ATL]How to get an attribute which is defined in another file [message #93437 is a reply to message #93422] Tue, 28 October 2008 15:04 Go to previous message
yue ma is currently offline yue maFriend
Messages: 22
Registered: July 2009
Junior Member
Hi,
I tried this explicitly load, but then an exception occurs:
The class 'PropertyType' is not a valid classifier

But I checked the model, all the validation is OK.
I don't know whether it's caused by the format of the aaxl file or some
internal error.
Does anyone have met a similar probloem? How to resolve it?
Thank you in advance.
regards
Yue



Freddy Allilaire a écrit :
> Hi,
>
> All your models should be loaded. In your case, I think
> AADL_Properties.aaxl should be added in the launch configuration.
>
> Regards,
> Freddy.
>
> yue a écrit :
>> Hi,
>> I met such a problem:
>> I want to select a "propertyDefinition" from the
>> "propertyAssociation", the propertyDefinition is referenced to another
>> file, see the XML file below.
>>
>> I write a helper, but it seems there is some problem, I cannot get the
>> identified "propertyDefinition", it always returns empty .
>>
>> Is there anything I made wrong?
>> Or how could I get such an attribute which is automatically defined in
>> another file?
>>
>> helper context core!ThreadImpl def: ThreadPeriodIsDefined(): Boolean =
>> if self.properties.propertyAssociation.oclIsUndefined()
>> then false
>> else self.properties.propertyAssociation-> collect(a|
>> a.propertyDefinition) -> select(b|b.name = 'Period') ->
>> flatten()->notEmpty()
>> endif;
>>
>>
>> ..............
>> <threadImpl name="client_thread.impl" compType="#//@threadType.0">
>> <properties>
>> <propertyAssociation noMode="false"
>> propertyDefinition=" ../../../plugin/edu.cmu.sei.osate.workspace/resources/proper ties/AADL_Properties.aaxl#//@propertySet.0/@propertyDefiniti on.48 "
>>
>> constant="false" access="false" append="false" derived="false">
>> <propertyValue xsi:type="property:EnumValue"
>> enumLiteral=" ../../../plugin/edu.cmu.sei.osate.workspace/resources/proper ties/AADL_Project.aaxl#//@propertySet.0/@propertyType.3/@enu mLiteral.0 "/>
>>
>> </propertyAssociation>
>> <propertyAssociation noMode="false"
>> propertyDefinition=" ../../../plugin/edu.cmu.sei.osate.workspace/resources/proper ties/AADL_Properties.aaxl#//@propertySet.0/@propertyDefiniti on.65 "
>>
>> constant="false" access="false" append="false" derived="false">
>> <propertyValue xsi:type="property:IntegerValue"
>> unitLiteral=" ../../../plugin/edu.cmu.sei.osate.workspace/resources/proper ties/AADL_Project.aaxl#//@propertySet.0/@propertyType.9/@uni tLiteral.3 "
>>
>> valueString="100" value="100" base="10"/>
>> </propertyAssociation>
>> </properties>
>> </threadImpl>
>> .................
>
Previous Topic:[ATL] Mixed types collection operations
Next Topic:[ATL] package not found
Goto Forum:
  


Current Time: Thu Apr 18 20:29:24 GMT 2024

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

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

Back to the top