Using the tPrejob and tPostjob components - Cloud - 8.0

Talend Studio User Guide

Version
Cloud
8.0
Language
English
Product
Talend Big Data
Talend Big Data Platform
Talend Cloud
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Real-Time Big Data Platform
Module
Talend Studio
Content
Design and Development
Last publication date
2024-02-29

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.

Note: 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.

Design workspace with a tPrejob and a tPostjob components.
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 a use case that uses the tPrejob and tPostjob components, see Orchestration (Integration)