Lee Sobotkin

Oh What a Tangled Web We Weave! Tips for Copying Components

Blog Post created by Lee Sobotkin Employee on Apr 26, 2018

Normally when I teach the various ‘copy’ features in the platform, I follow up, in jest, with “BUT do not ever use these features!” Of course I would never advocate avoiding capability in the platform, but I want the reader to seriously consider the implications of ‘copying’. They can land you in a real mess; Something that resembles a nasty spider web!

 

In this post:

 

Shallow vs. Deep Copying

Before getting to far into this topic, I want to define two concepts of object copying. I will describe these concepts with a trivial example using familiar Boomi terms.

 

Consider the familiar map that references a source and destination profile:

sample map illustration

 

Shallow Copy

If I make a shallow copy of this map, I will have 2 maps (the original and copy), both referencing the same source and destination profiles. Therefore, if I make a change in the source OR destination profiles, that change will be reflected in both maps!

 

shallow copy illustration

 

Deep Copy

If I make a deep copy of this map, not only will I have 2 maps (the original and copy) BUT I will also have a copy of the source and destination profiles. The new map copy references the new source and destination profile copies. Making changes in the original source and destination profiles will not affect the map copy. Conversely, making a change to the source and destination profile copies will not affect the original map.

deep copy illustration

 

Our Starting Point

With the understanding of shallow vs. deep copying, lets use a slightly large example. Consider the following layout:

Project Alpha contains one Process, ‘INT001 – Get Accounts (DB > File)’. I’ve denoted the associated components and references. The process references two Connections, two Operations, and a map (indicated by black arrows on the right). The Map references a Cross Reference Table, two Profiles, and a Map Function (indicated by red arrows on the left).

 

For the following cases, consider a scenario where Project Beta (similar to Alpha) is about to begin and the developer wants to use parts or all of Project Alpha as a starting point....

 

Copying in the Component Explorer

There are several scenarios (seven to be exact) when copying components in the Component Explorer...

 

Copying Components

 

Copying a component that DOES NOT reference another component from the Component Explorer

Copying the XML Profile, “Accounts” into folder ‘2. Project Beta’, will create a new XML Profile component. This new XML Profile component will not be referenced by any other component.

 

[Shallow] Copying a component that references another component from the Component Explorer

Copy Component Dependents UNCHECKED – Copying the Map will create a new Map component, BUT both original and new Maps will reference the same source and destination Profiles, Cross Reference Table, and Map Function components. Making a mapping change in the new Map will not affect the old Map mappings, BUT altering either Profiles, Cross Reference Table, or Map Function components will affect BOTH Maps.

Notice how the map in folder '2. Project Beta' references profiles in folder '1. Project Alpha' and Map Function in folder '#shared'.

 

[Deep] Copying a component that references another component from the Component Explorer

Copy Component Dependents CHECKED - Copying the Map will create a new Map component, AND create new source and destination profiles, Cross Reference Table, and Map Function components. Making a change in the new Map, Profiles, Cross Reference Table, or Map Function components will not affect the old Map, Profiles, Cross Reference Table, or Map Function components (and vice versa). Additionally, all referenced components will be newly created in the SAME folder.

Notice how all referenced components of the map are copied into folder '2. Project Beta'.

 

Copying folders

[Shallow] Copying a folder; with subfolders checked

Copying a folder structure will duplicate all components within that original folder structure into the Destination Folder (folder structure maintained). Component references within the structure are maintained in the copy, therefore changes made in the copy will not affect the original (and vice versa). BUT, Component reference outside the copied structure are maintained, therefore changes to referenced components outside the copied structure WILL affect old and new copies.

Notice how components in the new folder '1. Project Alpha' reference components in the '#shared' folder, while referential integrity within the subfolders are maintained.

 

[Deep] Copying a folder; with subfolders checked

Copying a folder structure will duplicate all components into the Destination Folder (folder structure maintained). Component reference within the structure is maintained in the copy, therefore changes made in the copy will not affect the original (and vice versa). BUT, Components reference outside the copied structure will also be copied into the folder(s) they are referenced, therefore changes to referenced components outside the copied structure will affect old and NOT new copies.

Notice how the all the components '#shared' folder were copied, even-though it was not a subfolder of '1. Project Alpha'.

 

[Shallow] Copying a folder; with subfolders unchecked

Copying a folder will duplicate all components into the Destination Folder. Component reference within the folder is maintained in the copy, therefore changes made in the copy will not affect the original (and vice versa). BUT, Components reference outside the copied folder is maintained, therefore changes to referenced components outside the copied folder will affect old and new copies.

Notice how the all the components in the new folder '1. Project Alpha' reference components in the '#shared' folder and '1. Project Alpha/#Alpha Shared' folder.

 

[Deep] Copying a folder; with subfolders unchecked

Copying a folder will duplicate all components into the Destination Folder (folder structure maintained). Component reference within the folder is maintained in the copy, therefore changes made in the copy will not affect the original (and vice versa). BUT, Components reference outside the copied folder will also be copied into the folder, therefore changes to referenced components outside the copied folder will affect old and NOT new copies.

Notice how the all the components in '#shared' and '1. Project Alpha/#Alpha Shared' are copied into the new '1. Project Alpha' folder.

 

Copying on the Canvas

Copying a shape on the process canvas is NOT the same as copying components in the Component Explorer.

 

Copying a non-component shape from the canvas to another canvas

Copying and pasting the Message shape on the canvas will create a new Message shape. Any changes made to either shape will not affect the other.  

Copying a component shape from the canvas to another canvas

Copying and pasting the Map shape on the canvas will not create a new Map component: the two shapes will continue to reference the same Map component (and subsequently the referenced Profiles and Map Functions).

 

Wrap-Up

These cases are small and sometimes trivial. But, now think about doing a deep copy in the Component Explorer on a Process that references many components, that reference other components, spanning multiple folders! Shared components are now replicated, Connection components duplicated (think license implication on deployment). The web of references is dizzying……Bottom line: always be mindful when copying, especially making deep copies.

 

Lee Sobotkin is a Senior Integration Consultant at Dell Boomi. He is not very fond of spiders nor webs.

Outcomes