Step 3 Add an Email acknowledgement to your Processing Sequence

LANSA Composer

Step 3. Add an Email acknowledgement to your Processing Sequence

LIC006 - Add Email Acknowledgement to Processing Sequence

You have set up configurations for the SMTP email. Now you can add an email acknowledgement to your Processing Sequence.

1.  In the Navigator, expand Definitions and select Processing sequences.

2.  Select your Processing sequence, iiiTUTSEQ03 and create a new processing sequence by copying it. Save the new one as ID: iiiTUTSEQ04, Description: iii Tutorial – LIC006 and save it.

     Use the Edit button to open the new processing sequence. You want to send a single email to a Trading Partner if any xml files were found and transformed for that Trading Partner.

3.  From the Palette tab select the If construct and add it to the sequence at the end. Adjust, using Promote, the level of the If, so it is at the same level as the FILELIST Loop.

4.  Select the If and in the Condition enter &FILECNT *GT 0

5.  From the Activities tab select MAIL_SEND and add to the sequence after the If so that the MAIL_SEND is within the If. You can adjust the levels if necessary using the Promote/Demote icons.

6.  Select the MAIL_SEND Activity. In the Parameters (bottom right), enter a Variable or value for parameter for SMTPMESSAGEDETAILID of the SMTP mail detail configuration you created in the last step (iiiTUTEMAILACK) or drag and drop it from the Configurations tab.

7.  Add the SMTP server configuration (iiiTUTSMTPID) you created to the Variable or value for parameter for SMTPSERVERID.

8.  Enter a Variable or value for parameter for parameter TOADDRESS of *TRADINGPARTNER.EM (that is *TRADINGPARTNER without an "S" plus a full stop "." and EM)., or drag and drop it from the Builtins tab.

     This means when the Processing Sequence is executed it will assign the value of the email address from the Trading Partner to the TO email address used by the MAILS_END Activity. In this way the email will be sent to the Trading Partner being processed.

     You need to execute the MAIL_SEND Activity if any entries were found in the FILELIST. Remember that FILECNT is the index for the FILELIST.

9.  You now need to ensure that the FILECNT is always zero before building the FILELIST. You do not want the FILECNT to have a value left over from a previous Trading Partner. So you must set FILECNT to zero before the list is set up. To do this, select an Assign from the Palette and add to the sequence before the Activity DIRECTORY_LIST.

10. Select the Assign and set the Expression to &FILECNT = 0

     Your processing sequence should now look like the following:

11. Save your changes to the processing sequence.