on 10-19-2021 12:48 PM
{
String ident=" | ";
JobDefinition jDef = jcsSession.getJobDefinitionByName("Test_chain_NN");
if (jDef.getJobDefinitionType().getName().equals(JobDefinitionType.JOB_CHAIN))
{
jcsOut.println(jDef.getName());
JobChain jc = jcsSession.getJobChainByJobDefinition(jDef);
for (Iterator it1 = jc.getJobChainSteps(); it1.hasNext();)
{
JobChainStep js = (JobChainStep) it1.next();
jcsOut.println(js.getName());
jcsOut.println(ident + " | ");
for (Iterator it2 = js.getJobChainCalls(); it2.hasNext();)
{
JobChainCall ja = (JobChainCall) it2.next();
//JobChain jcc = jcsSession.getJobChainByJobDefinition(ja.getJobDefinition());
jcsOut.print(" +- " + ja.getJobDefinition().getName());
JobChainCallSchedulingParameter jccsp = ja.getJobChainCallSchedulingParameterByName(SchedulingParameterName.SubmitDisabled);
String exp=jccsp.getExpression();
jcsOut.println(" " +exp);
}
}
}
}
jobsteps.pngHello Gerben,
Yes it is not throwing any exception now but it goes only up level 1.
I have subchins within that I have again steps are there but it does do check on that.
Please refer Attached screen shot, I have further steps in Test_Script1 but this code does not go inside and check those steps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
JobChainCallSchedulingParameter jccsp = ja.getJobChainCallSchedulingParameterByName(SchedulingParameterName.SubmitDisabled);
String exp = "No";
if (jccsp != null)
{
exp = jccsp.getExpression();
}
jcsOut.println(" " + exp);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
I am not sure what you are trying to achieve, but I think this line
JobChainCallSchedulingParameter jccsp = ja.getJobChainCallSchedulingParameterByName(SchedulingParameterName.SubmitDisabled);
is not always returning an object, so the next line will throw an exception.
What are you trying to fetch here?
Regards Gerben
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Gerben,
I want all the process definition from job chain which has submit disabled.
I have to fetch all process definition from chain and their submit disabled( value are yes or No. )
Because we have lot of job chains and it won't be good idea to check each and every step of the job chain.
How can I catch the exception ?
User | Count |
---|---|
80 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.