Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to Use tPrejob and tPostJob

tPrejob and tPostjob are great when you need execute given tasks, before and after your job. Unlike other components, these components do not process data and cannot be configured. They always execute, even if the main job fails, making them great for tasks that need to be completed even if the job is not successful.

 

Some scenarios in which you might need to use tPrejob include:

  • loading context information
  • logging the start of the job
  • ensuring that a file exists
  • creating a database connection

On the other hand, you might use tPostjob to:

  • delete any temporary files you created within the job
  • log the end of a job
  • close any connections that you may have created

These components are added to jobs the same way any other components are, simply click and drag them from the palette or search for them by clicking on the canvas. All you need to do after that is connect them to your subjob using an “OnComponentOk” connection. Bellow, is an example of tPrejob and tPostjob being utilized.

 

0683p000009Lsn7.png

Labels (1)
  • v6.x

13 Replies
martel
Creator
Creator

And the Advanced settings of tDie : Exit JVM immediately ? tPrejob_1 -> tPostgresqlConnection_1 --[OnSubjobError]--> tDie  

xrocq
Contributor III
Contributor III

Hi, i've got a problem with the Postjob execution

 

In my simple test case here :

0683p000009M86t.png

What i expect : Tdie Error then Only execute the Postjob part

 

Try 1 => tDie advanced option set with checked "Exit the JVM immediately"

What i got = Tdie Error and no Postjob execution

 

Try 2 => tDie advanced option set with unchecked "Exit the JVM immediately"

What i got = Tdie Error and Main Part execution and Postjob execution

 

The only solution i found to have what i expect is using a empty tJava with if link on the tDie CODE:

0683p000009M8CC.png

 

So the tPostjob isnt working in any case ?

martel
Creator
Creator

What i expect : Tdie Error then Only execute the Postjob part
??? why you dont add preJobMessagePrint in Prejob and finishing by tDie (and checked stop JVM immediately) ? more simple
xrocq
Contributor III
Contributor III

@martel This is just a simple test to deal with tDie and PostJob

 

In fact what i really need is that tPostjob part (whatever it contains) execute in anycase

 

But stopping job execution in case of tDie (DB connection error, missing file...)