on 02-10-2016 6:56 PM
I need to be able to kill JOBCHAIN_A if it is still running when JOBCHAIN_B is submitted. Is there a way to do this in CPS?
Hi Dave, you can use below redwood script. //************Query to get Running instance of the job chain query = "Select a.* from Job a, JobDefinition b where a.JobDefinition = b.UniqueId and b.Name = '" + sJobChainName + "' and a.Status in ('R')"; //************Table iteration for (Iterator it = jcsSession.executeObjectQuery(query, null); it.hasNext();) { Job j = (Job) it.next(); //************Checking for non null instances // if (j != null) { //************Cancelling the job chain j.kill();
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
//************Query to get Running instance of the job chain
query = "Select a.* from Job a, JobDefinition b where a.JobDefinition = b.UniqueId and b.Name = '" + sJobChainName + "' and a.Status in ('R')";
//************Table iteration
for (Iterator it = jcsSession.executeObjectQuery(query, null); it.hasNext();)
{
Job j = (Job) it.next();
//************Checking for non null instances
// if (j != null)
{
//************Cancelling the job chain
j.kill();
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
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.