UML (and Ecore) Models hava Objects and Multiplicities
OCL, on which ATL is based, reifies Multiplicities as Collections which
are different to Objects.
The "." operator is used for Object navigation
The "->" operator is used for Collection navigation (this is what the
error message is telling you)
Helpfully/confusingly the short forms
"." on a collection is implicit collect: "->collect(...)" (which is also
what the error message is telling you)
"->" on an Object is implicit convert to set
On 26/04/2014 18:34, Samantha Parker wrote:
> Hy, I have to write a helper that given a sequence, return the union
> of smaller sequence. This is my code
> helper def: sw_events(events: Sequence(MODEL_A!ViewElement)):
> Sequence(MODEL_A!ViewElementEvent) =
> events->iterate(iter; res: Sequence(MODEL_A!ViewElementEvent) =
> The result of this helper is a sequence of MODEL_A!ViewElement, as I
> want, but I can't use it. I have this error:
> Collections do not have properties, use ->collect()
> I have use res.union too but I have the same error.
> What Can I do?
> Thank you in advance for your help.