You could have a look at my solution at the bottom of this thread :
It isn't quite what you are doing but it sounds like you may be able to tweak it for your needs or simply grab the bits of code referring to job status
Thanks for your pointer. I checked this piece of code and it seems to be fetching process id by force kick off of another process (PumpAPI.startProcess())during post process. My process kicks off using file monitoring and I need to get a handle to that process to know its status. Is there a way to get process id of the process that just finished for which a post process has been kicked off?
I'm not sure if this will solve your issue entirely, but it may be worth a try.
First create a Global script variable, e.g.
This would be in the Script Node of the Data Pump admin.
Then, in the Post-Process Script for the Process, you can have your conditional code, e.g.
Log.AddEvent("g_bExportCompleted = True")
Log.AddEvent("g_bExportCompleted = False")
Note that the Post-Process Script is called after the last job of a process completes.
Then in the Post Export Script for the project (you will have to flesh this entire thing out if there is more than one, probably using multiple globals)
g_bExportCompleted = ExportCompleted
This means that if the export fails, you update the global variable, then use this in the post-export script.
So, in practice with a single project process that only spawns one job, the log might look like this:
Date/Time Event Description
+ 08-12-2008 20:58:26 Created.
+ 08-12-2008 20:58:26 Process launched 1 job(s).
+ 08-12-2008 20:58:26 Dispatched.
+ 08-12-2008 20:58:27 Set project file: C:\Program Files\Monarch Data Pump\Projects\Simple.xprj
+ 08-12-2008 20:58:28 5. One or more columns in the destination table do not match their corresponding columns in the export data set. Postal Code column does not exist in the destination table.
+ 08-12-2008 20:58:28 In PostExport
+ 08-12-2008 20:58:28 Failed: DwchServer.ExporterFailureException: Exporter method RunAllExports returned false. at DwchServer.JobHandler.a(MpExportClass A_0, ServerDB A_1, JobLog A_2, Int32 A_3) at DwchServer.JobHandler.a(ServerDB A_0)
+ 08-12-2008 20:58:28 Distribution started
+ 08-12-2008 20:58:29 Distribution completed
+ 08-12-2008 20:58:29 In PostProcess
+ 08-12-2008 20:58:29 g_bExportCompleted = False
I need to kickoff a post process based on the job completion status(success/failure). Is there a way to obtain process/job status during postprocess? Any help/pointer is highly appreciated. Thanks![/QUOTE]