[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.uml2] Re: Adding activities to a model

Hi Luis,

Try calling the  .getPackagedElements().add(...).

The getOwnedMembers() returns a derived union and you cannot directly add
items to derived unions in this way.

Cheers,

- James.



"Luis Costa" <luis.costa@xxxxxxxxx> wrote in message
news:c31f6eb182162061dce6fc501b5d0928$1@xxxxxxxxxxxxxxxxxx
> Hello,
>
>
> I'm migrating an application that used UML2 1 to use UML 2 2 instead.
>
> But I'm having problems when adding an Activity to a Model.
>
> This a sample of my code (the error happens in the "add" instruction)
>
> Activity activity = UMLFactory.eINSTANCE.createActivity();
> ((Model) parent).getOwnedMembers().add(activity);
>
>
> Anyone had similar problems or has some hint?
>
>
>
> Thanks in advance,
>
> Luís Costa
> SINTEF ICT
>
>
>