社区 - tPreJob & tPostJob Components
留言内容
2016年07月01日 - 19:30

laou

tPreJob & tPostJob Components

The tPreJob and tPostJob components are part of the Orchestration family of components. These components help to make your Jobs flow with more elegance, and provide the ability to perform some clean-up, should your Job failure.

tPreJob

The tPreJob component starts the first series of Subjobs that will be executed, when your Job starts. Functionally, it performs no action that you could not achieve by connection your components in the correct order; however, it does provide a clear demarcation between your Job's initialisation sequence, and the main tasks that the Job is intended to perform.

The following tasks could be considered as pre-Job tasks: -

  • Load Context
  • Validate external environment
  • Establish database connections
  • Test connectivity to external services
  • Check input files exist
  • logging the start of your Job

tPostJob

The tPostJob component starts the final series of Subjobs that will be executed, when your Job finishes; that is, after tPreJob has completed and any other Subjobs that you have defined. A key aspect to the execution of this component is that it is always executed, even when an Exception is thrown by any previous processing. This makes it ideal for controlling de-initialisation and clean-up.

The following tasks could be considered as post-Job tasks: -

  • Deletion of temporary files
  • Database disconnection
  • logging the finish of your Job

It is important to remember that the post-Job functions cannot make any assumptions about what has gone on before hand. If you attempt to disconnect from a database that you did not previously and successfully connect to, the disconnection will fail too. This in turn means that the remainder of the post-Job processing will not be completed.

As a minimum, you will want to ensure that the post-Job processing is executed in an appropriate order. To take it one stage further, you should ensure that the post-Job processing is as robust as you can make it, for example, don't attempt to disconnect from a database if you did not successfully connect to it in the first place. If you're deleting temporary files, gracefully handle the non-existence of these files.

Connectors

These two components only support an out connector of OnComponentOK. If you need to make decisions immediately following once of these components, connect to a tJava component. This can be seen from the screenshot, below.

A Simple Job

The following screenshot shows a simple Job, with some pre and post-Job processing.


回复内容
2021年10月06日 - 22:04

2022年04月19日 - 18:49

回复主题:温馨提示:需要登录/注册