on 05-17-2013 4:28 PM
Hello
I have one big chain.
Within in this one big chain there are 3 others.
Step 1 is a chain
Step 2 is a chain
Step 3 is a chain.
Within step 1, there are 10 jobs, if any of them fail, within step 1, they are all set to continue however, I do not want step 2 to start if this is the case.
The issue is that within step 1 chain, these 10 jobs must run one after another, and not side by side.
if any fail - they continue... to the end of the chain., but I MUST make step 2 ( which is another chain ) stop at that point.
How do I do that?
Lets call
step 1 chain A
step 2 chain B
step 3 chain C.
All these three steps are within one big chain called Mega_Chain.
I assume that you don't want to run B, if any one job fails in A.
But all 10 jobs in A should complete no matter what.
There are two solutions i can think of
Solution 1:
Now go on with your regular schedule, (you will have to decide when to run Mega_chain, as it now contains only B and C).
Solution 2:
Now go on with your schedule. Chain A(Step 1) will run all 10 jobs no matter what, but Chain B(Step 2) will not start, even if one job fails in A.
Thanks
Nanda
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
There are many ways to schedule this kind of jobs
A) schedule mster chain with Job-A jo as last step , which contains 10 steps, with status handlers set, and in action tab write pece of code as post running action to check status of child jobs of Job-A,
you can write your owne ;logic, i prefer to set flag value to zero, and increment count for each child job run. at the end writ if loop and if the count is equal to number of step then start Job-B, else end the job with out put all steps are not completed.
B) add raise event to each step of job-A ,a dn maintain all these events as wait event for job-B, so if all steps completed in A, then wait events of Job_B will be raised, else not. but here you must be care full to clear all pending events if any of the step of Job-A failes. and the other option would be using status handlers.
KR
Muhammad Asif.
Hi Cindy,
here is post running action for you, copy past this in action tab--> Type: Post Running
Only you need to change the partition and Jab Name : in the code line:
Session.getJobDefinitionByName(jcsSession.getPartitionByName("GLOBAL"), "Jabname_B");
{
int flg = 0;
int flg1 = 0;
Iterator s = (Iterator) jcsJob.getChildJobs();
while (s.hasNext()) {
flg1 = flg1 + 1;
Job jc1 = (Job) s.next();
jcsOut.println(jc1.getJobDefinition().getName());
Iterator s1 = (Iterator) jc1.getChildJobs();
while (s1.hasNext()) {
Job jc2 = (Job) s1.next();
jcsOut.println(jc2.getJobDefinition().getName());
if (jc2.getStatus().toString() == "Completed"){
flg = flg + 1;}
}
}
if (flg1 == flg) {
jcsOut.println("All jobs completed" + " No of completion: " + flg);
JobDefinition jd = jcsSession.getJobDefinitionByName(jcsSession.getPartitionByName("GLOBAL"), "Test_Sleep_A");
Job j = jd.prepare();
}
else {jcsOut.println("Not all jobs completed" + "No of completion: " + flg);}
}
Hope this helps.
KR
Muhammad Asif.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.