Difficulty with an ATL expression [message #106539] |
Sun, 14 June 2009 17:40 |
Eclipse User |
|
|
|
Originally posted by: oba.informatik.uni-kiel.de
Hallo,
I have the following meta-model subset:
// A class "State" with a reference called "stateArgs"
// to another class "StateArgument":
<eClassifiers xsi:type="ecore:EClass" name="State">
<eStructuralFeatures xsi:type="ecore:EReference" name="cstate"
ordered="false"
eType="#//CState" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="stateArgs"
ordered="false"
upperBound="-1" eType="#//StateArgument" containment="true"/>
</eClassifiers>
// The model element "StateArgument" with an attribute "type" whichs
// datatpye is "Pseudo":
<eClassifiers xsi:type="ecore:EClass" name="StateArgument">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="type"
ordered="false" unique="false"
eType="#//Pseudo"/>
</eClassifiers>
// "Pseudo" is an enumaration, where a literal 'final' is.
I simply want to select the "State"s which are of type final.
Namely I try to do something like that:
helper context MM1!State def: isFinal : Boolean =
let cllctn : Collection = collection -> select
(State|State.stateArgs.type = 'final')
if self.stateArgs.oclIsUndefined() then
false
else
for self.allInstancesFrom(MM1:StateArgument)
// This is the point where I don't know how to 'say' "which have the
type final".
I know, this must be quite easy to write down. Anyone any idea? Sorry
for the newbie question.
|
|
|
|
Powered by
FUDForum. Page generated in 0.02630 seconds