When to use a Joblet
The Joblet code is automatically included in the main Job code at runtime, thus using less resources and improving performance. A Joblet is usually used to achieve the following needs:
- Output or print static messages. Sometimes, you want to trace the Job execution, print a
static message for each step, for example, create a Joblet and use a
tJava to print this message at the beginning of the Job
execution.
System.out.println("The job starts to run") - Load value of context variables from a file or a database. If a Job or multiple Jobs load the value of context variables from a file or a database, you should usually create a dedicated Joblet to accomplish this task.
- Manage custom logs with a tLogCatcher component or a tStatCatcher component as the first component in the Jobs.
-
Create a reusable transformation regardless of the type of input and output data source.
For example, you are reading data both from a file and a database in a Job, you need to process data in the same action.
For more information about Joblets, see What is Joblet.