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.
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.
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.
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)