Wednesday, August 5, 2015

Difference Between OnSubjobOk and OnComponentOk

The difference between OnSubjobOk and OnComponentOk lies in the execution order of linked subjob.

With OnSubjobOk, linked subjob starts only when the previous subjob completely finishes.
We should use OnSubJobOk when there are many jobs linked to each other and next subjob should be trigger only once the previous subjob is completed.

We can also use OnSubJobError to send any notification email incase of any job failure which will
help you to identify the job which has failed.

You can also use tDie component with on subjoberror trigger which will kill the process incase of any subjob failure.

With OnComponentOk, linked subjob starts when the previous component finishes.
OnComponentOk

On OnComponentOk trigger next component will trigger once the previous component is finished.

It is very difficult to say where to use both but based on your requirement both can be used.