Use Case: Creating an Array to Use in a Subsequent Service Step

In this use case, you get an array of file names from an auxiliary table that stores Source Code Management (SCM) application information, and then create a new item for each file in another auxiliary table that stores Issue Defect Management (IDM) information.
Note: Similar data can come from any external Web service. That is, instead of coming from an auxiliary table, the data about files and associated issues can come from your SCM application.
The orchestration workflow loops through each file and then processes it as follows:
  1. Gets an array of files from an auxiliary table.
  2. Adds the file names to an input element in a subsequent Service step.
  3. Creates new items in another auxiliary table.

To create an array and use it in a subsequent Service step:

  1. Add steps to the orchestration workflow as shown below.

    image

  2. In the Working Data for the workflow, add a variable to store the number of loops through the ForEachFile step, using the type "Integer." Set the default value of the variable to 0.

    image

  3. Configure the GetSCMData step to get a list of file names from the auxiliary table for the SCM application.

    image

    image

  4. Configure the ForEachFile step to repeat the operations in the loop for each file returned in the GetSCMData response.

    image

  5. Configure the CopyNumber step to store the number of times the orchestration workflow loops through the ForEachFile step.

    image

    Note: This step must be included. You must copy the number of loops into the working data; you cannot use the ForEachFile step by itself.
  6. Configure the CopyTitle step to set the value of the title in the item[] array in the CreateFiletoIssue step. This value is a file name returned by the GetSCMData step.

    image

  7. Configure the CreateFileToIssue step to create a new item in another auxiliary table for each file that was returned by the GetSCMData step.

    image

    image