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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
thomas_ciampagl
Contributor
Contributor

Run jobs sequentially based on input parameter

Sorry for the newbie question as I expected this to be pretty basic and easy but I have been spinning my wheels for some time.

 

Any advice would be appreciated.  My situation is simply this:

 

I want to accept one or more arguments that indicate a list of jobs to run sequentially and in order.   

 

So, I have JobA, JobB, JobC, JobD.  

 

Based on something that happened today, I want to run JobD then JobC.  Tomorrow, I need to run JobD, JobA and JobB.

 

What I have done so far is (which may or may not make sense, but this is what I've tried):

 

1. Added a -D argument called jobCodes (-DjobCodes="d,c") and a context variable called jobCodes.

 

2. I have a tJava component that does:

context.jobCodes = System.getProperty("jobCodes");

3. Next is a tFixedFlowInput to create a String in the flow called "codes" from the contexts

4. I used tNormalize to break it up the String (I have a tLogRow here to prove it's working so far, and it is)

5. Here is where I get stuck.  I tried a tFlowToIterate but really don't understand how to use iterate to accomplish my task.  Not sure what component(s) are need to get from the normalized list of strings to the running of the jobs.  

6. Obviously, tRunJob  component(s) will be needed at the end to kick off the actual jobs.

 

Basically, after the tNormalize, I have my codes, and I just need to do the following (pseudo-code):

 

while there are more codes to process{

    if (code="A") run JobA, wait until finished;

    if (code="B") run JobB, wait until finished;

    if (code="C") run JobC, wait until finished;

    if (code="D") run JobD, wait until finished;

}

 

 Seems like pretty basic stuff, but I'm so new to this, I just can't figure out the components to use.

 

Thanks in advance!

 

 

 

 

 

 

Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable

There is no code in my java, its just a placeholder as a job start location

In all honesty, you probably don't need the normalize component, but rather pass in the jobs you need to run as a string. 

ex: "abd"

then the run if will check this value using the contains method of String

 

 0683p000009M4fL.png

View solution in original post

4 Replies
Anonymous
Not applicable

Try using a Run if connection to each job (a-d). You can make the conditional something like:

 

0683p000009M4fG.png

As long as the "If order" is correct, these should run sequentially in that order. If order can change (eg. one day you run 'A' then 'D', and the following day 'D' then 'A', you'll have to get a little more creative.

thomas_ciampagl
Contributor
Contributor
Author

Thanks. I may be able to control but in this example how do I connect the tNormalize (In my example) to the tJava in yours? Meaning, what's the java code in there? Sorry, but I am very new to this and still learning these components.
Anonymous
Not applicable

There is no code in my java, its just a placeholder as a job start location

In all honesty, you probably don't need the normalize component, but rather pass in the jobs you need to run as a string. 

ex: "abd"

then the run if will check this value using the contains method of String

 

 0683p000009M4fL.png

thomas_ciampagl
Contributor
Contributor
Author

Oh! I get it now. Thanks. This is a different way of thinking I need to get used to. It worked for me.

Thanks again.