Step 5. Create Processing Sequence
LIC009 - Handle multiple requests via an email attachment
In this step you will create a processing sequence to do the following:
- Assign a variable = OK
- While variable = OK
- Retrieve single email using MAIL_RECEIVE
- If FROMADDRESS is not equal to blank (an email was found)
- Loop through email attachment file (list)
- CONCAT path and filename create output path\filename
- Transform from file PSLMST to XML, selecting EMPNO form email attachment file
- FTP XML file to remote host
Else
- Variable = END – ends While loop next time through
- Terminate
1. In the
, select2. Use the button on the toolbar to create a new
.3. Select
tab from the left panel, then drag Assign and drop it on the panel on the right side.4. In the Expression input field of the
&FLAG_WHILE = 'OK'
5. From the left panel
In the Condition field, type &FLAG_WHILE = 'OK'
6. From the left panel
Use buttons if necessary to position the activity inside the While loop.
7. Complete the POP3CONFIG parameters of the MAIL_RECEIVE activity by dragging the iii_TUTPOP3 from the
tab on the left panel or you can simply type it in.
8. From the
tab, drag and drop an If at the end of the sequence. Make sure it is inside the While loop.
9. From the
tab, drag and drop it in the IF Condition field, then complete the condition by typing *NE '' (two single quotes, no space)Note: The will be blank when no e-mail is received. You will use this condition to change the loop flag later on to end the loop.
When the
condition is true, then you will loop through the e-mail attachments (in case more than one attachment is received) and send the attachment to the transformation map, and FTP out the result.10. From the
tab, drag the LOOP directive and drop it at the end of the processing sequence. It must be inside the IF condition block.11. Fill in the LOOP fields by dragging and dropping ATTACHMENTLIST from the Variables tab, and by typing the other fields.
12. Drag the CONCAT activity from the
tab and drop it at the end of the sequence. It must be inside the LOOP block. Use the buttons to correct the level if necessary.You will use this activity to build the file name of the Response XML file as follows:
|
13. From the left panel
tab, drag iiiTUTMAP03 and drop it at the end of the sequence. It must be inside the LOOP block. Use Promote/Demote to correct the level if necessary.14. Fill in the
parameters by drag and drop from the tab or typing:
15. After the transformation has run, the processing sequence will use FTP to send the output XML file.
Drag FTP_OUTBOUND activity from the tab on the left panel. Set FTPCONFIG parameter to iiiTUTFTPOUT by drag and drop from tab or by typing.
Your sequence will look like this:
16. From the
tab, drag Else and drop it at the end of the sequence. It must be at the same level as the IF block.17. The ELSE block will be reached when there is no further e-mail to process. Here you will add the logic to end the While block.
From the
tab, drag Assign and drop it at the end of the sequence. It must be inside the else block.Type the assignment expression: &FLAG_WHILE = 'END'
This will end the loop in the next iteration when the While condition is evaluated.
18. From the
tab, drag Terminate and drop it at the end of the sequence. Use the button to shift the Terminate to the top level.Your completed sequence should look like the following:
19. Save your processing sequence as:
|