Home » Modeling » UML2 » How to programmatically add an element as an owned element of another
How to programmatically add an element as an owned element of another [message #476536] |
Wed, 14 November 2007 05:48  |
Eclipse User |
|
|
|
Hi,
Given a new element (E.g., a CreateObjectAction), and an existing element
(E.g., Activity), I need to set the CreateObjectAction as a child or owned
element of the Activity. I tried using
Activity.getOwnedElements().add(theCreateObjectAction) and also
allOwnedElements().add() but I get a UnsupportedOperationException. Need
help on the right API to use.
Thanks,
Francis
|
|
|
Re: How to programmatically add an element as an owned element of another [message #476542 is a reply to message #476536] |
Wed, 14 November 2007 23:19   |
Eclipse User |
|
|
|
Francis,
The ownedElement and allOwnedElement features are derived unions, and hence,
by definition, read-only. Try using Activity#createNode(String, EClass), or
if the action has already been created, you could add to the list returned
from Activity#getNodes().
Kenn
"Francis" <fgavino@gmail.com> wrote in message
news:48051760056b57a633176dcb8d74db34$1@www.eclipse.org...
> Hi,
>
> Given a new element (E.g., a CreateObjectAction), and an existing element
> (E.g., Activity), I need to set the CreateObjectAction as a child or owned
> element of the Activity. I tried using
> Activity.getOwnedElements().add(theCreateObjectAction) and also
> allOwnedElements().add() but I get a UnsupportedOperationException. Need
> help on the right API to use.
>
> Thanks,
> Francis
>
>
|
|
|
Re: How to programmatically add an element as an owned element of another [message #476635 is a reply to message #476542] |
Thu, 15 November 2007 15:55  |
Eclipse User |
|
|
|
Francis,
To figure out if the collection you would like to add items to is derived
( and you actually have a life and don't want to figure this out from the
superstructure spec) then you can have a quick look at the interface at the
getter for the '@model' tag where derived=true. Derived unions calculate
their values from other properties that are defined to subset it. You can
also find subset information in the interface ( new in the M3 milestone ).
Cheers,
- James.
"Kenn Hussey" <Kenn.Hussey@embarcadero.com> wrote in message
news:fhghbv$anl$1@build.eclipse.org...
> Francis,
>
> The ownedElement and allOwnedElement features are derived unions, and
> hence, by definition, read-only. Try using Activity#createNode(String,
> EClass), or if the action has already been created, you could add to the
> list returned from Activity#getNodes().
>
> Kenn
>
> "Francis" <fgavino@gmail.com> wrote in message
> news:48051760056b57a633176dcb8d74db34$1@www.eclipse.org...
>> Hi,
>>
>> Given a new element (E.g., a CreateObjectAction), and an existing element
>> (E.g., Activity), I need to set the CreateObjectAction as a child or
>> owned element of the Activity. I tried using
>> Activity.getOwnedElements().add(theCreateObjectAction) and also
>> allOwnedElements().add() but I get a UnsupportedOperationException. Need
>> help on the right API to use.
>>
>> Thanks,
>> Francis
>>
>>
>
>
|
|
|
Re: How to programmatically add an element as an owned element of another [message #625464 is a reply to message #476536] |
Wed, 14 November 2007 23:19  |
Eclipse User |
|
|
|
Francis,
The ownedElement and allOwnedElement features are derived unions, and hence,
by definition, read-only. Try using Activity#createNode(String, EClass), or
if the action has already been created, you could add to the list returned
from Activity#getNodes().
Kenn
"Francis" <fgavino@gmail.com> wrote in message
news:48051760056b57a633176dcb8d74db34$1@www.eclipse.org...
> Hi,
>
> Given a new element (E.g., a CreateObjectAction), and an existing element
> (E.g., Activity), I need to set the CreateObjectAction as a child or owned
> element of the Activity. I tried using
> Activity.getOwnedElements().add(theCreateObjectAction) and also
> allOwnedElements().add() but I get a UnsupportedOperationException. Need
> help on the right API to use.
>
> Thanks,
> Francis
>
>
|
|
|
Re: How to programmatically add an element as an owned element of another [message #625473 is a reply to message #476542] |
Thu, 15 November 2007 15:55  |
Eclipse User |
|
|
|
Francis,
To figure out if the collection you would like to add items to is derived
( and you actually have a life and don't want to figure this out from the
superstructure spec) then you can have a quick look at the interface at the
getter for the '@model' tag where derived=true. Derived unions calculate
their values from other properties that are defined to subset it. You can
also find subset information in the interface ( new in the M3 milestone ).
Cheers,
- James.
"Kenn Hussey" <Kenn.Hussey@embarcadero.com> wrote in message
news:fhghbv$anl$1@build.eclipse.org...
> Francis,
>
> The ownedElement and allOwnedElement features are derived unions, and
> hence, by definition, read-only. Try using Activity#createNode(String,
> EClass), or if the action has already been created, you could add to the
> list returned from Activity#getNodes().
>
> Kenn
>
> "Francis" <fgavino@gmail.com> wrote in message
> news:48051760056b57a633176dcb8d74db34$1@www.eclipse.org...
>> Hi,
>>
>> Given a new element (E.g., a CreateObjectAction), and an existing element
>> (E.g., Activity), I need to set the CreateObjectAction as a child or
>> owned element of the Activity. I tried using
>> Activity.getOwnedElements().add(theCreateObjectAction) and also
>> allOwnedElements().add() but I get a UnsupportedOperationException. Need
>> help on the right API to use.
>>
>> Thanks,
>> Francis
>>
>>
>
>
|
|
|
Goto Forum:
Current Time: Sat Aug 30 15:01:33 EDT 2025
Powered by FUDForum. Page generated in 0.05131 seconds
|