Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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!
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
Try using a Run if connection to each job (a-d). You can make the conditional something like:
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.
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