The tPrejob and tPostjob components are designed to make the execution of tasks before and after a given job easier to manage. These components differ from other components in that they do not actually process data and they do not have any components properties to be configured. A key feature of these components is that they are always guaranteed to be executed, even if the main data Job fails. Therefore, they are very useful for setup and teardown actions for a given Job.
As tPrejob and tPostjob are not meant to take part in any data processing, they cannot be part of a multi-thread execution. They are meant to help you make your Job design clearer.
To use these tPrejob and tPostjob components, simply drop them onto the design workspace as you would do with any other components, and then connect tPrejob to a component or subjob that is meant to perform a pre-job task, and tPostjob to a component or subjob that is meant to perform a post-job task, using Trigger connections. An orange square on the pre- and post-job parts indicates that they are different types of subjobs.
Tasks that require the use of a tPrejob component include:
Loading context information required for the subjob execution.
Opening a database connection.
Making sure that a file exists.
Tasks that require the use of a tPostjob component include:
Cleaning up temporary files created during the processing of the main data Job.
Closing a database connection or a connection to an external service.
Any task required to be executed, even if the preceding Job or subjobs failed.
For use cases that use the tPrejob and tPostjob components, see Talend Open Studio Components Reference Guide.