Defining input data to read

The "automatic mapping", that is data to read from the input document, is defined by the links from the input document to the Restructure functions’ input parameters and function headers. Alternatively, if you use Collector functions you create the corresponding mapping manually.

You can only create input parameters for a Restructure function in any of these methods:

  • linking elements, or attributes, in the input document to the Restructure function, or

  • linking Collector functions' output parameters to the Restructure function, where input parameters are automatically created, as for Java and Boolean functions.

When you do this, notice that these links are dashed and not solid like the other links. This is to indicate that data reading does not happen at that exact place in the sequence, but earlier. Think of these links as "I want to use this data", or references. The icon for Restructure input parameters and for Collector output parameters, is also dashed to indicate "reference parameters".

When an input parameter is created, an output parameter with the same name is automatically created.

Follow these rules that apply to the parameters:

  • If you rename the input parameter, the corresponding output parameter is also renamed.

  • If you delete the input parameter, the corresponding output parameter is also deleted.

  • If you move the output parameter, the corresponding input parameter is also moved.

The restructure process does not alter the data in any way, except when numerical data is summed, so we get this parameter pairing. The input and output parameters always have the String data type.

When an input parameter is highlighted the corresponding output parameter is also highlighted and the other way around. This is highlighted because the data is not altered in the function. Select the source for an input parameter to see where it is linked to after the Restructure function. This highlighting mechanism is also used for Collector functions. The data flow is highlighted from the selected data source through the Collector function and the Restructure function or functions to its destination or destinations.

Loop in the input document

This section is valid only if you use data directly from the input document.

For the Restructure function, you must create links by linking repeating elements in the input document to the function’s header. Drag and drop (or use the Link tool) a repeating input element to the blue area of the Restructure function, for example to the icon. This is a control link, so the line is bold. The link is also dashed like the data links. When the "automatic mapping" is executed, it must be known which input elements should control the loops. That is, on which input elements you want to loop (the "loop level"). For the credit transfer example, you loop on the repeating elements CreditTransferPayment and PaymentTransaction. Think of these links as "I want to loop on these elements".

Follow these guidelines:

  • Every Restructure function must have at least one loop link and one data link (input/output parameter).

  • You can link the same repeating input element to several Restructure functions.

  • You can link an input data element to several Restructure functions.

The input loop or control links do not need to be nested in the same way as the restructure loop. Otherwise, this would not be restructuring.

Note that, if you have a loop level (a repeating element) in the input document that only contain an inner loop (repeating child element), and you do not need any data from that outer loop level, you still need to link that repeating element to a Restructure function. Otherwise, the "automatic mapping" will not loop on that level and will only read the first instance.

So, why link input elements to Restructure functions in this "anarchical" way? To create the "automatic mapping" that reads data from the input document, you need all XPaths for the repeating elements controlling the loops and all XPaths for the data elements to read. The order in which the XPaths are defined does not matter because the actual XPaths can be sorted to create correct metadata for the "automatic mapping".

In this way, the input document’s data structure is decoupled from the desired (output document) data structure.

Loop for Collector functions

This section is valid only if you use data from Collector functions.

When you use Collector functions, you manually create the loops, so, you control the looping. The Restructure functions do not need to know about the loops in the original data structure, the data structure from the collectors is decoupled from the desired (output document) data structure.

Note that you can only use data from one (nested) Collector loop structure in a (nested) Restructure loop structure. Within a mapping you can use several "pairs" of Collector and Restructure loop structures, or Restructure loop structures separately using data directly from the input document.