Copy Collection
Description
The copy collection part (formerly known as struct copy part) allows you to copy a full or part of a data object to another data object. Note that it is possible to copy both collections or containers of data objects.
Use
You can use the struct copy part for copying the values of an object from all kind of types to another object. The target can be a new object or existing object, which merges the object values. Using struct copy allows you to modify the new object without affecting the original object, which would happen if the original object was just referenced by another object name (like set data object value does when use a container object type).
Use this part to merge containers with exclusive object names. Set the target to the existing container in which you want all data objects. Uncheck the "Override target if not null" option or the existing container will be deleted and replaced by the new one.
Editor Fields
Tab |
Field Name |
Description/Use |
Type/Options |
Optional/Mandatory |
Basic |
Source |
This is the name of the source data object from which you want to copy the data. |
Data Object |
Mandatory |
Basic |
Target |
This is the name of the data object in which the source will be stored. |
Data Object |
Mandatory |
Advanced |
Copy depth |
This defines how deeply nested the copy is done to prevent copying endless nested objects. Those items deeper than the specified depth are not copied. The default value is 50. |
Number |
Optional |
Advanced |
Override target if not null Merge |
This option allows you to overriding the target when it has already a value. When not overriding the target, the data is merged into the possible already existing target, e.g. existing values of the target are overwritten by values of the source and values of the source that do not exist in the target are added to the target. In Release 7.4, this item has been renamed "Merge" and is found on the Basic tab. |
Checkbox |
Mandatory |
Advanced |
Save data-object in log |
This option allows you to save the data object into the log. |
Yes | No |
Mandatory |
Filtering |
Filter |
This is the name of the data object that contains a named collection with variable names that only need to be copied. Variables not in this collection are not copied. The names must form the keys of the collection for maximum look-up performance. |
Data Object |
Optional |
Filtering |
Data type filter |
This is a data object that contains a named collection with variable names / paths as keys that need to be converted to the specified datatype (as a value in the collection). Variables that are not in this collection are copied as the original data type (unless the Filter blocks the copy of the variable). |
Data Object |
Optional |
Filtering |
Ignore explicit indices |
This flag enables/disables ignoring explicit specified indices in the filter tables. When checked, an object path in the filter table that contains an explicit index (for example test.example[3].subproperty) will be interpreted as a non-explicit index (for example test.example[].subproperty). This will allow the copy to take over all properties that match the inexplicit collection path. In the example that would mean that source.test.example[3].subproperty would be copied but also source.test.example[8].subproperty etc.) |
Checkbox |
Mandatory |
Filtering |
Root object |
This is the name of the object with which to start the copy. This allows a copy to be made of a substructure of the Source object. The variable names in the optional filter then need to exclude the root object name. |
Text |
Optional |
Filtering |
Interpolate filters |
Check this to allow the filter table columns to be interpolated. Leave this unchecked if no interpolation is required, which saves performance. The default is unchecked. |
Checkbox |
Mandatory |
Filtering |
Interpolation scope |
Use this field to specify the interpolation scope, e.g. the data structure to use for interpolation. If left empty, the default local context is used, which is the same as specifying 'local'. When 'global' is entered, the global context is used. In case of a specific object is configured, that instance of the object is used for interpolation. NOTE: interpolation scope has no direct relation to the specified root object. In case an element of the root object needs to be interpolated, the interpolation name must fully specify the path to the root object and sub element(s). |
Data Object |
Optional |
Example
Download and import the following example project in your workspace.