Book a Demo

Author Topic: Clone existing element (structure) retaining existing connections  (Read 40998 times)

MarcinG

  • EA User
  • **
  • Posts: 67
  • Karma: +0/-0
    • View Profile
Hello,

has anyone yet resolved / scripted a case where cloning existing element structure would retain relationships to elements not being cloned ?
Example :  a Node element (lets call it a Platform), containing nested Nodes, one of them having a relationship with another Node (lets call it Control) outside of this Platform node.  Now, I need to clone Platform node (including substructure) in such way that its internal Node each retains relationship to existing Control node.

Best regards
Marcin

MarcinG

  • EA User
  • **
  • Posts: 67
  • Karma: +0/-0
    • View Profile
Re: Clone existing element (structure) retaining existing connections
« Reply #1 on: April 30, 2025, 03:47:33 pm »
Perhaps Sparx could listen and consider that there is existing functionality "Copy Full Structure for Duplication" which retains relationships between copied elements.  Now, it would be nice to add an option to retain relationships which the copied element has with existing elements (not being copied).

Best regards
Marcin

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: Clone existing element (structure) retaining existing connections
« Reply #2 on: April 30, 2025, 06:30:29 pm »
When you use the term "cloning", do you mean time aware modelling - i.e., Clone Structure as New Version?

If you do, it only clones the package (and diagrams within the package). It does not clone the elements, with the current functionality elements and relationships can only be cloned, AFIK, by opening a diagram and cloning elements individually or in bulk (by selecting them all).

If you clone 2 elements in a diagram with 10 elements, Sparx EA will only clone relationships between those 2 elements, if there are any. I am not sure what Sparx EA does with any relationships to non-cloned elements and what happens with relationships to non-cloned elements, if a user chooses to clone them later.

If all elements in a diagram are cloned, I would expect Sparx EA to also clone all the relationships. But the example in your OP is nesting and it depends how nesting is represented.

In short, if you have all elements in your original diagram, they are visually nested, select them all and clone them as a new version then I would expect Sparx EA to clone any relationships between the elements.

I agree with your comment about having a "Clone Full Structure for Duplication" option.



MarcinG

  • EA User
  • **
  • Posts: 67
  • Karma: +0/-0
    • View Profile
Re: Clone existing element (structure) retaining existing connections
« Reply #3 on: April 30, 2025, 06:39:43 pm »
When you use the term "cloning", do you mean time aware modelling - i.e., Clone Structure as New Version?
No, Time Aware Modelling is a different beast and serves different purpose.  I am familiar with how it works, but that is not my use case.


I agree with your comment about having a "Clone Full Structure for Duplication" option.
Thanks.

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: Clone existing element (structure) retaining existing connections
« Reply #4 on: April 30, 2025, 07:21:33 pm »
Thank you Marcin

When you say
[SNIP]
has anyone yet resolved / scripted a case where cloning existing element structure would retain relationships to elements not being cloned ?
What is your use case?

I am asking the question because we are using time aware modelling (TAM) to clone elements for 2 use cases that do not fit nicely with how I think TAM should be used.

MarcinG

  • EA User
  • **
  • Posts: 67
  • Karma: +0/-0
    • View Profile
Re: Clone existing element (structure) retaining existing connections
« Reply #5 on: April 30, 2025, 11:16:22 pm »
What is your use case?

I am asking the question because we are using time aware modelling (TAM) to clone elements for 2 use cases that do not fit nicely with how I think TAM should be used.
I provide an example in the original post.  Imagine that you design a network where multiple elements exchange information.  Topology will be somewhat a snowflake - so ... you will have a hub and spokes, and then one of the spokes will lead to another hub with its own spokes.  Now, there is no a priori knowledge of how many spokes (or children, if we use this reference) will a hub (parent) have.  There is also a possibility that relationship is between hub and a nested element of a spoke.  Easiest to model would be a pattern of one hub, one spoke (with nested elements), and then clone multiple spokes (children) as many times as needed because they will have the same communication characteristics with hub.
That's the simplest, but of course it might be that we have special spokes that are somehow related to hub and to nested elements of their own.

For now ... I simply use a pattern, then manually recreate relationships - which is a bit faster than cloning full structure for duplication, finding one of the nested elements, and creating relationship between it and the hub.

Best regards
Marcin

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: Clone existing element (structure) retaining existing connections
« Reply #6 on: May 01, 2025, 07:08:45 pm »
Thank you Marcin, is the following a fair summary of your use case?

"You are doing some discovery/documenting work and you want to use what you discover as a template, please note the emphasis, to more efficiently create additional content as you discover more about the topology of the network."

Conceptually, we have a similar use case and I have had it possibly for as long as I have used Sparx EA. Essentially, I don't think Sparx EA has an elegant way of easily use existing content as a template to create additional content with a similar or identical structure, and combine it with other features such as Time Aware Modelling (TMA).

TMA is best used to show the differences between different stable architectures - e.g., do a gap analysis.

But knowledge is not gained/documented linearly, we don't get and document all knowledge about an existing architecture - e.g., a network topology - and, then, design a new network. I would argue that both activities happen in parallel and don't see a way of cleanly work in parallel with Sparx EA combining both approaches.

Not sure, if I have gone off on a tangent.

MarcinG

  • EA User
  • **
  • Posts: 67
  • Karma: +0/-0
    • View Profile
Re: Clone existing element (structure) retaining existing connections
« Reply #7 on: May 02, 2025, 11:48:24 pm »
Thank you Marcin, is the following a fair summary of your use case?

"You are doing some discovery/documenting work and you want to use what you discover as a template, please note the emphasis, to more efficiently create additional content as you discover more about the topology of the network."
In generic terms - it could be acceptable, but in reality this is about modelling, not discovery/documentation.

Conceptually, we have a similar use case and I have had it possibly for as long as I have used Sparx EA. Essentially, I don't think Sparx EA has an elegant way of easily use existing content as a template to create additional content with a similar or identical structure, and combine it with other features such as Time Aware Modelling (TMA).
If only creating Patterns could optionally include retaining relationships to elements not being part of the pattern ... but it cannot have such option, as consistency when re-using patterns in other repositories would be affected.
Hence, my only hope was cloning full structure for duplication.

But knowledge is not gained/documented linearly, we don't get and document all knowledge about an existing architecture - e.g., a network topology - and, then, design a new network. I would argue that both activities happen in parallel and don't see a way of cleanly work in parallel with Sparx EA combining both approaches.
I understand and agree with you about architecture development (lifecycle).  We have a special case here :-).

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: Clone existing element (structure) retaining existing connections
« Reply #8 on: May 06, 2025, 06:20:30 pm »
If only creating Patterns could optionally include retaining relationships to elements not being part of the pattern ... but it cannot have such option, as consistency when re-using patterns in other repositories would be affected.
Hence, my only hope was cloning full structure for duplication.
Just to get the meaning of terminology here before I comment any further. In terms of how a repository is organised, what determines if an element is in the pattern? Perhaps, belonging to the same package?

I understand and agree with you about architecture development (lifecycle).  We have a special case here :-).
You are not the 1st special case I come across, we have several special cases ourselves :-).

MarcinG

  • EA User
  • **
  • Posts: 67
  • Karma: +0/-0
    • View Profile
Re: Clone existing element (structure) retaining existing connections
« Reply #9 on: May 06, 2025, 10:06:26 pm »
Just to get the meaning of terminology here before I comment any further. In terms of how a repository is organised, what determines if an element is in the pattern? Perhaps, belonging to
Patterns as "Design Patterns".
As a short explanation - using option "Merge" does the job as it should when using patterns.  Except ... if there is a Port element embedded in the Node, whereas "Merge" is no longer available.  If it was ... it would be a solution to my case.  As would be if the pattern could remember default element to Merge with.
« Last Edit: May 06, 2025, 11:28:55 pm by MarcinG »

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: Clone existing element (structure) retaining existing connections
« Reply #10 on: May 07, 2025, 06:35:50 pm »
Those patterns, I cannot make my mind if they are there as markhitecture (architectural marketing) or, if they are really useful. There are no Sparx EA patterns for some of the patterns I regularly, including the pub-sub, pattern. We have considered creating our own patterns but since, from memory, the content customisation capabilities are somehow limited, we resorted to other ways of achieving the same result.

A key thing about patterns is that they need to be stand alone, they must not have any relationships to any elements in the repository/project outside the pattern. Since all our work (5 people) takes place on the same SQL Server repository database, functionally I cannot see the difference between publishing patterns and allowing users to copy a package within the repository.