Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Modeling (top-level project) » Amalgamate Models
Amalgamate Models [message #382206] Fri, 23 May 2008 14:04 Go to next message
Eclipse UserFriend
Originally posted by: zhengxie.ie.ibm.com

I have two uml models, model1 and model2. I need to add all the elements
in model2 into model1, so that the new model1 has all the elements of
model1 and model2. How can I do it?


Thanks.
Re: Amalgamate Models [message #382207 is a reply to message #382206] Fri, 23 May 2008 14:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: zhengxie.ie.ibm.com

Zheng Xie wrote:
> I have two uml models, model1 and model2. I need to add all the elements
> in model2 into model1, so that the new model1 has all the elements of
> model1 and model2. How can I do it?
>
>
> Thanks.
Basicly, what I did is:

find all the Packages in model2 and add them to model1's packagedElements.

The problem is:
The applied stereotypes are lost.
Re: Amalgamate Models [message #382208 is a reply to message #382207] Sat, 24 May 2008 13:33 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Zheng,

Please use the UML newsgroup, which I've added to the "to" list of the
reply, for questions about UML.


Zheng Xie wrote:
> Zheng Xie wrote:
>> I have two uml models, model1 and model2. I need to add all the
>> elements in model2 into model1, so that the new model1 has all the
>> elements of model1 and model2. How can I do it?
>>
>>
>> Thanks.
> Basicly, what I did is:
>
> find all the Packages in model2 and add them to model1's
> packagedElements.
>
> The problem is:
> The applied stereotypes are lost.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Amalgamate Models [message #382211 is a reply to message #382208] Wed, 28 May 2008 13:47 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Zheng,

For a general "copy" method you can have a look at EcoreUtil.copy(EObject
eObject).
The UMLUtil PackageMerger uses this to copy elements.

Alternatively have a look UML2Util.getAllContents() to get the contents of
one object. A defensive copy of the contents can be made.

Cheers,
- James.


"Ed Merks" <merks@ca.ibm.com> wrote in message
news:g195bt$ct7$1@build.eclipse.org...
> Zheng,
>
> Please use the UML newsgroup, which I've added to the "to" list of the
> reply, for questions about UML.
>
>
> Zheng Xie wrote:
>> Zheng Xie wrote:
>>> I have two uml models, model1 and model2. I need to add all the elements
>>> in model2 into model1, so that the new model1 has all the elements of
>>> model1 and model2. How can I do it?
>>>
>>>
>>> Thanks.
>> Basicly, what I did is:
>>
>> find all the Packages in model2 and add them to model1's
>> packagedElements.
>>
>> The problem is:
>> The applied stereotypes are lost.
Re: Amalgamate Models [message #607531 is a reply to message #382206] Fri, 23 May 2008 14:47 Go to previous message
Eclipse UserFriend
Originally posted by: zhengxie.ie.ibm.com

Zheng Xie wrote:
> I have two uml models, model1 and model2. I need to add all the elements
> in model2 into model1, so that the new model1 has all the elements of
> model1 and model2. How can I do it?
>
>
> Thanks.
Basicly, what I did is:

find all the Packages in model2 and add them to model1's packagedElements.

The problem is:
The applied stereotypes are lost.
Re: Amalgamate Models [message #607532 is a reply to message #382207] Sat, 24 May 2008 13:33 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Zheng,

Please use the UML newsgroup, which I've added to the "to" list of the
reply, for questions about UML.


Zheng Xie wrote:
> Zheng Xie wrote:
>> I have two uml models, model1 and model2. I need to add all the
>> elements in model2 into model1, so that the new model1 has all the
>> elements of model1 and model2. How can I do it?
>>
>>
>> Thanks.
> Basicly, what I did is:
>
> find all the Packages in model2 and add them to model1's
> packagedElements.
>
> The problem is:
> The applied stereotypes are lost.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Amalgamate Models [message #607535 is a reply to message #382208] Wed, 28 May 2008 13:47 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Zheng,

For a general "copy" method you can have a look at EcoreUtil.copy(EObject
eObject).
The UMLUtil PackageMerger uses this to copy elements.

Alternatively have a look UML2Util.getAllContents() to get the contents of
one object. A defensive copy of the contents can be made.

Cheers,
- James.


"Ed Merks" <merks@ca.ibm.com> wrote in message
news:g195bt$ct7$1@build.eclipse.org...
> Zheng,
>
> Please use the UML newsgroup, which I've added to the "to" list of the
> reply, for questions about UML.
>
>
> Zheng Xie wrote:
>> Zheng Xie wrote:
>>> I have two uml models, model1 and model2. I need to add all the elements
>>> in model2 into model1, so that the new model1 has all the elements of
>>> model1 and model2. How can I do it?
>>>
>>>
>>> Thanks.
>> Basicly, what I did is:
>>
>> find all the Packages in model2 and add them to model1's
>> packagedElements.
>>
>> The problem is:
>> The applied stereotypes are lost.
Previous Topic:Add New Resource Storage Mechanism
Next Topic:missing tracing tab
Goto Forum:
  


Current Time: Thu Apr 25 05:22:42 GMT 2024

Powered by FUDForum. Page generated in 0.04310 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top