Step 1 Set up a Loop to Cycle through the List of xml Files

LANSA Composer

Step 1. Set up a Loop to Cycle through the List of xml Files

LIC004 - Add the Transformation to the Processing Sequence

1.  Navigate to Definitions/Processing Sequences and select the Processing Sequence you created in tutorial LIC0002 – iiiTUTSEQ01.

2.  Press the Copy button to create a new processing sequence based on this one:

3.  Give the new processing sequence an ID of iiiTUTSEQ02 and click the Copy button.

     When the details for your copied iiiTUTSEQ02 are shown, give the new processing sequence an appropriate description as shown:

4.  Save the change to your new processing sequence.

5.  Click the Edit button to open the Processing sequence editor window. Delete the activity TUT_02_AT  from the previous exercise, so that your sequence contains a single Activity DIRECTORY_LIST. The Activity will output a list of files in a list named FILELIST.

6.  Select the Parameters tab and delete the YOURINITIALS input parameter.

7.  From the Palette tab select the Loop construct and add it to the sequence at the end. Your sequence will now contain the Activity and then Loop. Note that the Error tab (bottom left) shows errors (red triangle) and warnings (yellow triangle). This is because the details for the Loop have yet to be entered.

     If your Loop is in the wrong place use the move up and move down buttons on the toolbar to reposition it.

8.  Select the Loop. The details of the loop will be shown (bottom right).

a.  In the List name enter FILELIST.

b.  In the Loop variable enter THISFILE. This means that the loop will cycle through the list of entries in the FILELIST and the value of the entry which is currently being processed will be set in the variable named THISFILE. The variable THISFILE may be used as an input to subsequent processing steps within this loop.

c.  In the Index variable enter FILECNT. The variable FILECNT will contain the number of the entry which is currently being processed.

     Note that the previously displayed errors (red triangle) have gone, though a warning (yellow triangle) may remain about the loop item being empty - you will deal with this next.