Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Re: Amalgamate Models
Re: Amalgamate Models [message #477431] Sat, 24 May 2008 13:33 Go to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
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 #477456 is a reply to message #477431] 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 #626638 is a reply to message #477431] 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:[Announce] MDT UML2 2.2.0RC2 is available
Next Topic:static profiles with model libraries
Goto Forum:
  


Current Time: Fri Apr 26 17:00:43 GMT 2024

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

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

Back to the top