|Access to keys in EMap member of model element [message #1780744]
||Fri, 26 January 2018 14:53
| Bruce Trask
Registered: July 2009
I used the steps from
to create a map in one of my model elements. It ends up generating an EMap.
My question is how to access that and the keys and values of its elements via the OCL or from the .mtl file in Acceleo.
In the OCL Interpreter view I enter
aql:self.theSystem.services.nameToPackageName // nameToPackageName is the map
as the expression
and I get back
which is what the map contains (two key value pairs)
If I do aql:self.theSystem.services.nameToPackageName->asSequence()
I get the same result.
What I am trying to do is iterate through the map to get the individual keys and values.
->at() does not seem to do the trick with the Map.
I was hoping for something like ->get(key) but that does not appear to exist.
I could not find anything with regard to working with Maps in aql or OCL.
[Updated on: Fri, 26 January 2018 14:56]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.01769 seconds