I have setup an AftConsolidate Event jython script that sends me an email with each load's process status (import status, validation status, etc.) when a user loads data. My plan is to add each user's email address to their location's Integration Option box and have them receive the email. That is all fine.

The only issue I have is that I only receive emails from successful loads and not those that fail along the way. AftConsolidate only gets triggered if the load successfully makes it that far so I am wondering where you would put a script that would give you an update on loads that failed, let's say during validation. Do I need to track the progress in each event script? If the process fails during validate, an email script in BefValidate would be of no use as it has already past and AftValidate wouldn't be invoked as the load wouldn't had made it that far.

Thx. I am noticing that my ExpStatus isn't returning the proper code from the AftExportToDat script. I get 0 (not started or failure) even though the export is succeeding and the processstates code is 21 (Export OK). Are there issues with ExpStatus returning the proper result? I can see in the process log just prior to aftexporttodat.py being invoked, the following successful record for each period being loaded:

AftExportToDat will still show EXPSTATUS as 0 since the actual export has not yet happened to the target application, only an export file has been created. You should check the EXPSTATUS in the AftExport event.

There is no AftExport in FDMEE that I am aware of...just AftExportToDat. I tried to manually make an AftExport.py file but it doesn't show up as being run in the logs following the execution of the DLR. Are you thinking of FDM Classic? Please advise.

I cannot get my ExpStatus or ValStatus to work without referencing the processstates line first. Here is a snippet from Oracle Support KB (FDMEE Script Samples (Doc ID 1613836.1))

How to use the Process Status property in scripts to generate e-mail alerts based on the failure/success of the events? The fdmContext does return the correct status. The fdmcontext gets initialized at the start of the process and the status is not available. You can use the following to get the status. The following prints the status to a log file:

AftExport only exists in FDM not FDMEE. I suppose the reason EXPSTATUS always returns a zero is because FDMEE treats the following 3 events ExportToDat, Load and Consolidate if enabled as part of the Export process. Therefore if you want to know whether an Export has succeded check the status in the AftLoad event if you don't have the consolidation option enabled and the AftConsolidate if the consolidation option is enabled.

Yes, that works in AftLoad and always did. Clearly the ExpStatus context value doesn't get populated until AftLoad. I was able to workaround this by getting the ProcessStatus context value and making an if statement checking if it's 21 or not. 21 is a successful export per the TLOGPROCESSSTATES table in FDMEE.

In the end, b/c AftLoad is all part of the Export process (thanks SH), I can just put the ExpStatus in there. I thought there may be an error that would shut down the process during export but as long as the AftLoad is always called, I think we are covered.

So now, an email is sent when VALSTATUS fails in AftValidate (with mapping errors attached) or EXPSTATUS fails in AftLoad (with .err file attached). If successful, AftConsolidate sends a successful email. This should allow our users to not stare at their screens for 10 minutes during multiload DLR processes.

I am also trying to develop a code to associate each user's email address to their unique location. I would appreciate if you can share your code. That would be very helpful. can you please send me the jython code in my personal email id bekta49@yahoo.com?

You can get fancier by tying it into the user that last updated the data load (I think Francisco wrote about this in the past) but this is a simpler approach if you don't mind updating the location everytime the user moves on. Hopefully this points you in the right direction.