This discussion is archived
5 Replies Latest reply: Oct 31, 2012 5:48 AM by KellyDGreen RSS

Batch Loader Email

935161 Newbie
Currently Being Moderated
I am using a process method of serial and I have an email notification code in the batch loader script that is sent out to the admin. The email notifcation has a message based on the Process State. If I am testing with one file, the email sent with no issues. If am testing multiple files, the email is sent out when the last file is loaded. I would like an email sent out to the admin after every file is loaded.

Any suggestions are appreciated.
  • 1. Re: Batch Loader Email
    user10757003 Journeyer
    Currently Being Moderated
    Where is your script code that writes the current e-mail at present. In the Batch Action Script, there are two events, at the end, called AftProcessFile and aftProcessBatch. Have you tried putting the code in the aftProcessFile event? you may need to access the batch loader file collection to get the process state for the selected file.
  • 2. Re: Batch Loader Email
    935161 Newbie
    Currently Being Moderated
    I went through the process of setting the paramaters for batch processing, then created the script. I placed the email in that script. I did not use the BatchAction.
  • 3. Re: Batch Loader Email
    966196 Newbie
    Currently Being Moderated
    Yes, I follow you and that's a problem with writing the e-mail notification from within the Batch Loader script that you created.

    If you wan to do this in the Batch Loader script that you've made, then you would need to call the BATCHENG for the current BatchID and then call the recordset to list the files collected during the BATCHENG process. Then once you have the list of files, you can do a loop to trigger nofication for each file. I won't be able give you source code for this, but if you go through the Supplemental API in the workbench, it has everything you need.

    For example, calling "farsFileListforBatchID" will return a list of all files for the specified BatchID. This works for SERIAL running batches, but there are some issues when running in Parallel.
  • 4. Re: Batch Loader Email
    user10757003 Journeyer
    Currently Being Moderated
    have a look at the following recent post for an example of what the previous post has explained.

    Batch Script Processing - Please Help

    I have not tried this, but the only issue may be as to when the collection of files in a batch gets deleted (If it does as part fo the batch process)
  • 5. Re: Batch Loader Email
    KellyDGreen Explorer
    Currently Being Moderated
    Move the email code to the Action scripts instead of the batch. If you put the email in AftLoad, for example, it will send after each file loads.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points