[ATL]How to get an attribute which is defined in another file [message #93322] |
Mon, 27 October 2008 09:20  |
Eclipse User |
|
|
|
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 #93437 is a reply to message #93422] |
Tue, 28 October 2008 11:04  |
Eclipse User |
|
|
|
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>
>> .................
>
|
|
|
Powered by
FUDForum. Page generated in 0.03574 seconds