Basic syntax question in mapping [message #1783576] |
Wed, 14 March 2018 09:52 |
Bruce Trask Messages: 58 Registered: July 2009 |
Member |
|
|
Hello,
Apologies for a basic syntax question but I can't seem to locate the answer despite some looking.
For a given mapping:
mapping Root :: Root2Root() : Root {
element += self.element->select(a | a.oclIsKindOf(A))[A]->map A2B();
}
what is the purpose of the [A] or is it redundant (being shorthand forselect(a | a.oclIsKindOf(A)) ) . I am trying to find the reference in the OCL standard for this. I understand it is some sort of OCL shorthand but was wondering its purpose in this case.
Should I be able to execute
self.element->select(a | a.oclIsKindOf(A))[A]
in the OCL console. I get an error
Evaluating:
self.element->select(a | a.oclIsKindOf(A))[A]
Results:
2:1:2:42 "simpleNameCS" expected instead of "self.element->select(a | a.oclIsKindOf(A))"
I can do
Evaluating:
self.element->select(a | a.oclIsKindOf(A))
Results:
A 1
A -1
but not self.element[A]
for that I get
Evaluating:
self.element[A]
Results:
Qualifiers do not conform to expected types: (self.element)
Regards,
Bruce
[Updated on: Wed, 14 March 2018 10:15] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02951 seconds