Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » how to clone a model
how to clone a model [message #477520] Sat, 14 June 2008 18:00 Go to next message
Krzysztof Kaczmarski is currently offline Krzysztof KaczmarskiFriend
Messages: 88
Registered: July 2009
Member
Hi All,

Perhaps someone could point me to an example showing how to clone
(deeply) a model created programmatically. Is it possible somehow?

Thanks in advance,
Krzysztof
Re: how to clone a model [message #477521 is a reply to message #477520] Sat, 14 June 2008 18:35 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Krzysztof,

I expect you'd be able to use EcoreUtil.copy/copyAll.


Krzysztof Kaczmarski wrote:
> Hi All,
>
> Perhaps someone could point me to an example showing how to clone
> (deeply) a model created programmatically. Is it possible somehow?
>
> Thanks in advance,
> Krzysztof


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: how to clone a model [message #477543 is a reply to message #477521] Thu, 19 June 2008 10:47 Go to previous messageGo to next message
Krzysztof Kaczmarski is currently offline Krzysztof KaczmarskiFriend
Messages: 88
Registered: July 2009
Member
Thanks.
KK


Ed Merks wrote:
> Krzysztof,
>
> I expect you'd be able to use EcoreUtil.copy/copyAll.
>
>
> Krzysztof Kaczmarski wrote:
>> Hi All,
>>
>> Perhaps someone could point me to an example showing how to clone
>> (deeply) a model created programmatically. Is it possible somehow?
>>
>> Thanks in advance,
>> Krzysztof
Re: how to clone a model [message #477582 is a reply to message #477543] Tue, 08 July 2008 14:49 Go to previous messageGo to next message
Krzysztof Kaczmarski is currently offline Krzysztof KaczmarskiFriend
Messages: 88
Registered: July 2009
Member
Hi Ed,

One mode question concerning model copying.

I do something like this:

Model clonnedModel = (Model) EcoreUtil.copy( model );

And the resulting clonnedModel is ok except for applied stereotypes.
I debugged the uml files before and after the copying and came to
conclusion that the source file contains XMI section with stereotype
applications while the resulting file contains only pure UML tags.

Do you know anything about this problem?

Regards,
Krzysztof



Krzysztof Kaczmarski wrote:
> Thanks.
> KK
>
>
> Ed Merks wrote:
>> Krzysztof,
>>
>> I expect you'd be able to use EcoreUtil.copy/copyAll.
>>
>>
>> Krzysztof Kaczmarski wrote:
>>> Hi All,
>>>
>>> Perhaps someone could point me to an example showing how to clone
>>> (deeply) a model created programmatically. Is it possible somehow?
>>>
>>> Thanks in advance,
>>> Krzysztof
Re: how to clone a model [message #477586 is a reply to message #477582] Wed, 09 July 2008 00:31 Go to previous messageGo to next message
Tim Myer is currently offline Tim MyerFriend
Messages: 81
Registered: July 2009
Member
Hi Krzystof,
Perhaps your question will be answered by this feature enhancement request:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=204658
----Tim----

Krzysztof Kaczmarski wrote:
> Hi Ed,
>
> One mode question concerning model copying.
>
> I do something like this:
>
> Model clonnedModel = (Model) EcoreUtil.copy( model );
>
> And the resulting clonnedModel is ok except for applied stereotypes.
> I debugged the uml files before and after the copying and came to
> conclusion that the source file contains XMI section with stereotype
> applications while the resulting file contains only pure UML tags.
>
> Do you know anything about this problem?
>
> Regards,
> Krzysztof
>
>
>
> Krzysztof Kaczmarski wrote:
>> Thanks.
>> KK
>>
>>
>> Ed Merks wrote:
>>> Krzysztof,
>>>
>>> I expect you'd be able to use EcoreUtil.copy/copyAll.
>>>
>>>
>>> Krzysztof Kaczmarski wrote:
>>>> Hi All,
>>>>
>>>> Perhaps someone could point me to an example showing how to clone
>>>> (deeply) a model created programmatically. Is it possible somehow?
>>>>
>>>> Thanks in advance,
>>>> Krzysztof
>
Re: how to clone a model [message #477587 is a reply to message #477582] Wed, 09 July 2008 11:34 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Krzysztof,

Sorry, I missed your question. I'm not sure where how the stereotype
applications are recorded in the model. It sounds like they aren't
contained though, since copy will only copy the containment tree. You'd
need to use copyAll and copy the model and the referencing stereo types
as a single operation (if that makes any sense; I'm no UML expert).


Krzysztof Kaczmarski wrote:
> Hi Ed,
>
> One mode question concerning model copying.
>
> I do something like this:
>
> Model clonnedModel = (Model) EcoreUtil.copy( model );
>
> And the resulting clonnedModel is ok except for applied stereotypes.
> I debugged the uml files before and after the copying and came to
> conclusion that the source file contains XMI section with stereotype
> applications while the resulting file contains only pure UML tags.
>
> Do you know anything about this problem?
>
> Regards,
> Krzysztof
>
>
>
> Krzysztof Kaczmarski wrote:
>> Thanks.
>> KK
>>
>>
>> Ed Merks wrote:
>>> Krzysztof,
>>>
>>> I expect you'd be able to use EcoreUtil.copy/copyAll.
>>>
>>>
>>> Krzysztof Kaczmarski wrote:
>>>> Hi All,
>>>>
>>>> Perhaps someone could point me to an example showing how to clone
>>>> (deeply) a model created programmatically. Is it possible somehow?
>>>>
>>>> Thanks in advance,
>>>> Krzysztof
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: how to clone a model [message #626711 is a reply to message #477520] Sat, 14 June 2008 18:35 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Krzysztof,

I expect you'd be able to use EcoreUtil.copy/copyAll.


Krzysztof Kaczmarski wrote:
> Hi All,
>
> Perhaps someone could point me to an example showing how to clone
> (deeply) a model created programmatically. Is it possible somehow?
>
> Thanks in advance,
> Krzysztof


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: how to clone a model [message #626733 is a reply to message #477521] Thu, 19 June 2008 10:47 Go to previous message
Krzysztof Kaczmarski is currently offline Krzysztof KaczmarskiFriend
Messages: 88
Registered: July 2009
Member
Thanks.
KK


Ed Merks wrote:
> Krzysztof,
>
> I expect you'd be able to use EcoreUtil.copy/copyAll.
>
>
> Krzysztof Kaczmarski wrote:
>> Hi All,
>>
>> Perhaps someone could point me to an example showing how to clone
>> (deeply) a model created programmatically. Is it possible somehow?
>>
>> Thanks in advance,
>> Krzysztof
Re: how to clone a model [message #626775 is a reply to message #477543] Tue, 08 July 2008 14:49 Go to previous message
Krzysztof Kaczmarski is currently offline Krzysztof KaczmarskiFriend
Messages: 88
Registered: July 2009
Member
Hi Ed,

One mode question concerning model copying.

I do something like this:

Model clonnedModel = (Model) EcoreUtil.copy( model );

And the resulting clonnedModel is ok except for applied stereotypes.
I debugged the uml files before and after the copying and came to
conclusion that the source file contains XMI section with stereotype
applications while the resulting file contains only pure UML tags.

Do you know anything about this problem?

Regards,
Krzysztof



Krzysztof Kaczmarski wrote:
> Thanks.
> KK
>
>
> Ed Merks wrote:
>> Krzysztof,
>>
>> I expect you'd be able to use EcoreUtil.copy/copyAll.
>>
>>
>> Krzysztof Kaczmarski wrote:
>>> Hi All,
>>>
>>> Perhaps someone could point me to an example showing how to clone
>>> (deeply) a model created programmatically. Is it possible somehow?
>>>
>>> Thanks in advance,
>>> Krzysztof
Re: how to clone a model [message #626779 is a reply to message #477582] Wed, 09 July 2008 00:31 Go to previous message
Tim Myer is currently offline Tim MyerFriend
Messages: 81
Registered: July 2009
Member
Hi Krzystof,
Perhaps your question will be answered by this feature enhancement request:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=204658
----Tim----

Krzysztof Kaczmarski wrote:
> Hi Ed,
>
> One mode question concerning model copying.
>
> I do something like this:
>
> Model clonnedModel = (Model) EcoreUtil.copy( model );
>
> And the resulting clonnedModel is ok except for applied stereotypes.
> I debugged the uml files before and after the copying and came to
> conclusion that the source file contains XMI section with stereotype
> applications while the resulting file contains only pure UML tags.
>
> Do you know anything about this problem?
>
> Regards,
> Krzysztof
>
>
>
> Krzysztof Kaczmarski wrote:
>> Thanks.
>> KK
>>
>>
>> Ed Merks wrote:
>>> Krzysztof,
>>>
>>> I expect you'd be able to use EcoreUtil.copy/copyAll.
>>>
>>>
>>> Krzysztof Kaczmarski wrote:
>>>> Hi All,
>>>>
>>>> Perhaps someone could point me to an example showing how to clone
>>>> (deeply) a model created programmatically. Is it possible somehow?
>>>>
>>>> Thanks in advance,
>>>> Krzysztof
>
Re: how to clone a model [message #626780 is a reply to message #477582] Wed, 09 July 2008 11:34 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Krzysztof,

Sorry, I missed your question. I'm not sure where how the stereotype
applications are recorded in the model. It sounds like they aren't
contained though, since copy will only copy the containment tree. You'd
need to use copyAll and copy the model and the referencing stereo types
as a single operation (if that makes any sense; I'm no UML expert).


Krzysztof Kaczmarski wrote:
> Hi Ed,
>
> One mode question concerning model copying.
>
> I do something like this:
>
> Model clonnedModel = (Model) EcoreUtil.copy( model );
>
> And the resulting clonnedModel is ok except for applied stereotypes.
> I debugged the uml files before and after the copying and came to
> conclusion that the source file contains XMI section with stereotype
> applications while the resulting file contains only pure UML tags.
>
> Do you know anything about this problem?
>
> Regards,
> Krzysztof
>
>
>
> Krzysztof Kaczmarski wrote:
>> Thanks.
>> KK
>>
>>
>> Ed Merks wrote:
>>> Krzysztof,
>>>
>>> I expect you'd be able to use EcoreUtil.copy/copyAll.
>>>
>>>
>>> Krzysztof Kaczmarski wrote:
>>>> Hi All,
>>>>
>>>> Perhaps someone could point me to an example showing how to clone
>>>> (deeply) a model created programmatically. Is it possible somehow?
>>>>
>>>> Thanks in advance,
>>>> Krzysztof
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Re: Associations lost when converting from UML
Next Topic:Create a class diagram using ArgoUML API
Goto Forum:
  


Current Time: Fri Apr 19 23:09:01 GMT 2024

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

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

Back to the top