Step 3 Add the Trading Partner to your Processing Sequence

LANSA Composer

Step 3. Add the Trading Partner to your Processing Sequence

LIC005 - Set up a Trading Partner

In this step you will define a processing sequence to do the following:

  • Loop through all trading partners

a.  If a trading partner tutorial directory is defined (is not equal to blank)

b.  If trading partner name = iiiTUTTP

  i.  List XML files in trading partner tutorial directory

  ii.  Loop through list of XML files

  iii.  Assign a batch number

  iv.  Transform XML file to database files order header (TUTORDH) and order details (TUTORDL)

1.  In the Navigator, expand Definitions and select Processing sequences. Select your Processing Sequence iiiTUTSEQ02. As before, create a new processing sequence by copying this one. Save it with an ID: of iiiTUTSEQ03 and Description:  iii Tutorial – LIC005

2.  Click the Edit button to open the Processing Sequence in the editor.

3.  From the Palette tab select the Loop construct and add it to the sequence at the beginning.

4.  Select the new loop and enter the Details (bottom right). Enter List name *TRADINGPARTNERS Note: This must end with an "S".

     Alternatively, select the Built-ins tab (top left) and drag and drop *TRADINGPARTNERS to the List name.

5.  Demote, using the toolbar icons, the other entries in the sequence to be below the Trading Partners loop. This is telling the processing, to loop through the Trading Partners and execute the child entries for each Trading Partner.

6.  From the Palette tab, select the If construct and add it to the sequence after the Trading Partner loop and before the Activity DIRECTORY_LIST. Demote the entries after the inserted If

7.  Filter the loop to only review Trading Partners with your partner ID.  Select the If you just added and in the Details (bottom right) enter the Condition:

      *TRADINGPARTNER.ID =  'iiiTUTTP' (where iii are your initials)

     Once again, note that "tradingpartner.id" can be dragged from the Built-ins tab. It is found under Trading partner attributes.        

     Your Processing Sequence should now look like the following:

     You now need to adjust the Processing Sequence to execute the child entries only if the Trading Partner has a linked tutorial directory.

8.  From the Palette tab, select the If construct and add it to the sequence immediately after the Trading Partner loop and before the If construct added in 6 above. Demote the entries after the inserted If you have just inserted.

9.  Select the If you just added and in the Details (bottom right) enter the Condition:

      *TRADINGPARTNER.DIR.TUT *NE ' '

     Note: The *TRADINGPARTNER does not end with "S". This variable refers to the current Trading Partner which is the current entry of the *TRADINGPARTNERS loop.

10.Select the Activity DIRECTORY_LIST. For the Parameter DIRECTORY (bottom right) for the Variable or value for parameter enter the value *TRADINGPARTNER.DIR.TUT

     For more information on this entry refer to Processing sequence then the Built-in Variable topic in the Composer Guide.

11.You are now using the directory linked to the Trading Partner as the DIRECTORY in the DIRECTORY_LIST. Previously this was an input input parameter to the processing sequence. You can now remove this by selecting Parameters tab (top right) and deleting the DIRECTORY  and YOURINITIALS entries. The initial Parameters tab (top right) should now contain no entries.

     Your Processing Sequence should now look like this:

12.Save your Processing Sequence.