Book a Demo

Author Topic: Cloning children  (Read 7749 times)

Ian Mitchell

  • EA User
  • **
  • Posts: 507
  • Karma: +22/-4
  • The eaDocX and Model Expert guy
    • View Profile
Cloning children
« on: August 03, 2016, 12:58:46 am »
Using EA v13 build 1303, and no, this is not the start of a moral debate on child cloning....
The 'clone element' function in v13 works with no surprises when the item being cloned is a child of a package.
(Package) Original Package
--diagram 1
--element 1

Cloned to become:
(package) Cloned Original Package
--diagram1 (clone, empty)

I then drop element1 onto the cloned diagram1, and get EA to create a clone of element1, as a child of (package) Cloned Original Package:
(package) Cloned Original Package
--diagram1 (clone)
--element1 (clone)

So far, so good. No surprises.

So what about if I create a child of element1, and repeat the process:
(Package) Original Package
--diagram 1
--element 1
----element1.1 (child of element1)

Question is, what do we expect to happen when we clone element1 now? Do we clone its children as well? ALL of them? And their children?
If element1 is a BPMN process, then it will have children which are lanes/pools, which in turn will have lots of child activities, events etc: a BIG structure.

But what's the alternative? If we don't clone all the children, then EA seems to get confused, and won't clone the children AT ALL (bug reported).

So if I want to create a new version of a process, how should it be done? I think a 'deep clone' (all children) makes sense, but I'm really not sure what I expect.

Ideas please!


Ian Mitchell, Designer, eaDocX


www.eaDocX.com
www.theartfulmodeller.com

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Cloning children
« Reply #1 on: August 03, 2016, 01:30:36 am »
When I clone me, I expect my clone to have my guts too, not a hollow shape of myself.

q.

P.S. My clone might also have my relations. But likely the related might not be aware/want my clone get in the way.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Cloning children
« Reply #2 on: August 03, 2016, 10:03:58 am »
Hi Ian,

While it might not be a moral debate on child cloning, it surely is a functional one.

EA already has a precedent for an approach to cloning via the paste copy of elements.  In that case, if you copy a set of elements and then paste as copy via [Ctrl+Shift+V] then you get the option of [ ] Include Connectors.  This will paste copies of the original connectors between the selected elements (only).

Now, it seems to me that this is the precursor to the new cloning function.  Since all that the new cloning function adds is the «Trace» relationship back to the original item from the copy.
Not having yet tried the cloning feature in anger. I would expect that each cloned item would be linked back to its master.

Copy element does not traverse the Nesting tree and only copies the selected elements (maybe there should be that option?), whereas Cloning seems to (just tried it).
I would expect that the clone should copy the internal relationships (as qwerty, I think) suggested - and it does (just tried it).
It should also clone the external relationships,otherwise you don't have a clone - and it does (just tried it).

HTH,
Paolo
« Last Edit: August 03, 2016, 10:08:22 am by Paolo F Cantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Cloning children
« Reply #3 on: August 16, 2016, 05:23:22 pm »
Further to my discussion previously, I tried to use the cloning functionality in anger using the (latest - at this time) 1304 build.

In order to get it to do what I wanted, I had to jump through some relatively interesting hoops.

Selecting a package and the menu item "Clone Structure as New Version..." doesn't seem to clone the elements within the structure (not just in the diagrams but actually nested in the package structure).
As usual, the Help is a bit ambiguous - I expected the menu item to copy everything (or at least give me an option for a "Deep Clone").  So "Clone Structure..." ONLY clones the packages and diagrams.
The cloned diagram will have the original items.
You need to clone each items (as required) via the cloned diagram.

We had a set of over 200 items (from an external reference model that we wanted to clone and link back to the original items).  We would then use the cloned items within OUR model - but (via cloning) retain the links to the reference model.

We managed to do it, but the process was (as I said above) a bit weird.  This solution may help others in a similar situation.

We observed that if there were nested items in the set, and the nested items were on the same diagram as the nest, cloning the nest would also clone the nested items.  So we created a couple of temporary item and nested the other 200 odd under them.  We then dragged all the items onto a diagram (special temporary items and all).  At this point we, cloned the structure - which gave us the cloned diagram (but still pointing to the original items.  We then selected the temporary items on the diagram and cloned the Items as new version (one at a time).  Clean up the "mess in the kitchen" and voila - a "deep" clone with all the links as required - between the original and cloned items.

Does anybody know of an easier method to create such a deep clone with links?

HTH, some other poor user.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Cloning children
« Reply #4 on: August 17, 2016, 08:23:16 am »
The function isn't intended to deep clone an entire structure. It's there to assist with documenting how a system is changing between versions. The initial clone reflects that a new version has been defined, but no changes have been made yet. As things are changed, you clone the individual elements.

Normally to perform a full clone, you would export the package to XMI, re-import it with stripped guids then use the updated package status command to reset the version for everything in the new package.

The situation you have described isn't the intended use case for either function.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Cloning children
« Reply #5 on: August 17, 2016, 09:56:20 am »
The function isn't intended to deep clone an entire structure. It's there to assist with documenting how a system is changing between versions. The initial clone reflects that a new version has been defined, but no changes have been made yet. As things are changed, you clone the individual elements.
Once we got our heads around what was happening, we understood this.
Quote
Normally to perform a full clone, you would export the package to XMI, re-import it with stripped guids then use the updated package status command to reset the version for everything in the new package.
The problem with merely copying a structure is that you loose the linkage - provided by the cloning function.  This is very important when cloning a reference model - you need to refer to the original reference model.
Quote
The situation you have described isn't the intended use case for either function.
Yes, as I said above, we understand that now.  However, I thought others might be interested in how you could use the existing functionality for the unintended use case.

Having said that, it seems to me that it will become an increasingly useful use case - especially as industry / domain level reference models are being created.  Perhaps the best solution is to extend the current Copy / Paste to Clipboard functionality with the ability to trace back to the original copy source.

Thoughts?

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!