Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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)

...

           -  FTP XML file to remote host

     Else

           -  Variable = END – ends While loop next time through

           -  Terminate

  1. In the Navigator, select Definitions, Processing sequences
  2. Use the Image Modified button on the toolbar to create a new Processing Sequence.
  3. Select Palette tab from the left panel, then drag Assign and drop it on the Details panel on the right side.
  4. In the Expression input field of the Assign operation, type in

  5. Code Block
  6. &FLAG_WHILE

  7. = 'OK'

    Image Modified

  8. Code Block
  9. From the left panel Palette tab, drag the While operation and drop it at the end of the sequence.
    In the Condition field, type 


  10. &FLAG_WHILE

  11. = 'OK'

    Image Modified

  12. From the left panel Activities tab, drag the MAIL_RECEIVE activity and drop it at the end of the sequence.
    Use Promote / Demote buttons if necessary to position the activity inside the While loop.
    Image Modified
  13. Complete the POP3CONFIG parameters of the MAIL_RECEIVE activity by dragging the iii_TUTPOP3 from the Configurations tab on the left panel or you can simply type it in.Image Modified
  14. From the Palette tab, drag and drop an If at the end of the sequence. Make sure it is inside the While loop.
    Image Modified
  15.  From the Variables tab, drag FROMADDRESS and drop it in the IF Condition field, then complete the condition by typing *NE '' (two single quotes, no space)

    Note
    titleNote
    The FROMADDRESS 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 IF 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.

  16. From the Palette tab, drag the LOOP directive and drop it at the end of the processing sequence. It must be inside the IF condition block.
  17. Fill in the LOOP fields by dragging and dropping ATTACHMENTLIST from the Variables tab, and by typing the other fields.
    Image Modified
  18. Drag the CONCAT activity from the Activities tab and drop it at the end of the sequence. It must be inside the LOOP block. Use the Promote/Demote buttons to correct the level if necessary.
    You will use this activity to build the file name of the Response XML file as follows:

    STRING 1

    File path

    '/Lansa_Composer_licpgmlib/lic/Tutorial/iiiFTPOUT'

    STRING 2

    File Name

    '/iiiEmployeeDetails'

    STRING 3

    Attachment Count

    &ATLOOPINDEX

    STRING 4

    File Type

    '.xml'

    STRINGOUT

    ResultString

    &RESPONSEFILENAME

    Image Modified

  19. From the left panel Transformations 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.

  20.  Fill in the Transform Inbound parameters by drag and drop from the Variables tab or typing:Image Modified

  21.  After the transformation has run, the processing sequence will use FTP to send the output XML file.
    Drag FTP_OUTBOUND activity from the Activities tab on the left panel. Set FTPCONFIG parameter to iiiTUTFTPOUT by drag and drop fromConfigurations tab or by typing.

    Your sequence will look like this:Image Modified

  22. From the Palette tab, drag Else and drop it at the end of the sequence. It must be at the same level as the IF block.

  23. Code Block
  24. 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 Palette tab, drag Assign and drop it at the end of the sequence. It must be inside the else block.

    Type the assignment expression:

  25.  
  26. &FLAG_WHILE

  27. = 'END'

    This will end the loop in the next iteration when the While condition is evaluated.

  28. From the Palette tab, drag Terminate and drop it at the end of the sequence. Use the Promote button to shift the Terminate to the top level.

    Your completed sequence should look like the following:
    Image Modified

  29.  Save your processing sequence as:

    Name:

    iiiTUTSEQ07

    Description:

    Handle employee list CSV request  – LIC009.

    Status:

    Active