Building Your Event-Driven Architecture : Service Development Help : Mapping Data in Flow Services : About Linking Variables : Linking to and from Array Variables in the Pipeline : Creating a Link to or from an Array Variable
Creating a Link to or from an Array Variable
When you are linking to or from an array variable, keep the following points in mind:
*To link to or from an element in an array variable, you need to know the index for the element’s position in the array. Array index numbering begins at 0 (the first element in the array has an index of 0, the second element has an index of 1, and so on).
*To dynamically specify the index, you can set the index to the value of a pipeline variable. The variable you specify must be a String. To use a pipeline variable, specify the variable name enclosed in percent signs (%). For example, if the pipeline contains the variable itemNumber that will contain the index you want to use at run time, specify %itemNumber% for the index. For the link to execute successfully at run time, the value of the variable must be a non-negative integer.
*If you link to an array variable and specify an index that does not exist, Designer increases the length of the array to include the specified array index. For example, suppose that a String List has length 3. You can link to the String List and specify an index of 4; that is, you can link to the fifth position in the String List. At run time, the Integration Server increases the length of the String List from 3 to 5.
*Each element in an array can be the source or target of a link; that is, each element in the array can be the start or end of a link. For example, if a source String List variable contains three elements, you can link each of the three elements to a target variable.
*If the source and target variables are arrays, you can specify an index for each variable. For example, you can link the third element in a source String List to the fifth element in target String List.
*If you do not specify an array index for an element when linking to or from arrays, the default behavior of the Pipeline view will be used. For information about the default behavior of the Pipeline view, see Default Pipeline Rules for Linking to and from Array Variables.
*If you are linking to or from a String Table, you need to specify an index value for the row and column.
*When you link a Document or Document List variable to another Document or Document List variable, the structure of the source variable determines the structure of the target variable. For more information, see Linking to Document and Document List Variables.
*At run time, the link (copy) fails if the source array index contains a null value or if you specify an invalid source or target index (such as a letter or non-numeric character). Integration Server generates journal log messages (at debug level 6 or higher) when links to or from array variables fail.
The following procedure explains how to link to or from an array variable.
To create a link to or from an array variable
1. Create a link between the variables using the procedure described in Creating a Link Between Variables.
2. In Pipeline view, click the link that connects the variables.
3. In the Properties view, click the Indices value and click . The Link Indices dialog box appears.
4. If the source variable is an array variable, under Source, type the index that contains the value you want to link. If the source variable is a String Table, you need to specify a row index and a column index.
5. If the target variable is an array variable, under Destination, type the index to which you want to link the source value. If the target variable is a String Table, you need to specify a row index and a column index.
6. Click OK.
Tip:  
You can also open the Link Indices dialog box by selecting the link between the variables and clicking on the Pipeline view toolbar.
Copyright © 2016 - 2016 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback