May 1st, 2008, 08:06 AM
Forcing a step to execute on failure of previous step
I have the following batch -
step 1 - read 'tbl_unprocessed_data' and stage to 'batch_staging' table
step 2 - (multi-thread) invoke business services for each record in 'batch_staging'
On failure skip current record. Write error message to 'tbl_error'
step 3 - When all records in 'batch_staging' are processed - Invoke report service
step 4 - Write to 'tbl_log'
The behavior we see is that step 3 does not execute on failure of step 2.
Is there a way on failure of step 2, force execution of steps 3 and 4?
Last edited by vineetb; May 1st, 2008 at 08:08 AM.
Reason: more clarity
May 1st, 2008, 09:26 AM
Why would you want steps 3 and 4 to still run if step 2 failed? Wouldn't that mean you hadn't completely loaded the staging records with all records?
May 1st, 2008, 10:27 AM
In the steps mentioned above, what needs to be done:
1. If required to process only the records that were successfully processed in Step 2 and then go ahead with invoking report service for those processed records.
2. And also write to the tbl_log.
May 1st, 2008, 10:30 AM
I'm still a little bit confused. If you have configured Step 2 to allow skips, then it can still skip bad records and process only the good ones. You can decide which exceptions should be considered an actual failure of the job.