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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
desanip
Contributor
Contributor

Creation of Joblet for re-use

Hello Talendians,

I have a context subjob which loads all the database connection parameters from outside of Talend Job from Job server. I want to create a joblet for effective re-use. Joblet is the first step i want to run inside my job so that all the context will be loaded as i progress. I tried using trigger input -> Load context -> trigger output using onsubjob ok trigger. When i try to use the joblet inside my job, it is working as expected.Can someone tell me what is the best way to design a joblet?

Labels (6)
1 Reply
PhilHibbs
Creator II
Creator II

Looks ok to me, you say it is working, are you just after any other "best practice" design suggestions?

 

We have a very similar joblet that loads context variables from MySQL. Ours has a tLogRow component so that every job writes its context variables out to the log at the start, I added a tSort component to get them into sorted order.

 

Ours also has a tPreJob component, and we don't link it on the job canvas. I'm not entirely happy with that, as it makes it impossible to use a tPreJob component anywhere else. I think your method of linking it with an On Subjob Ok link is better.

 

Our design is this:

  1. tPreJob
  2. tWarn "***** Job Running: " + jobName + " *****"
  3. tMySqlInput
  4. tContextLoad
  5. tSetGlobalVar to set "JobStats_JOB_START", "JobStats_JOB_START_ISO", "JobStats_JOB_START_FILE_NAME", current timestamp with two different string representations (YYYY-MM-DD HH:MI:​SS and YYYYMMDD_HHMISS)
  6. tJava to print out JobStats_JOB_START
  7. tContextDump
  8. tSortRow
  9. tLogRow