cancel
Showing results for 
Search instead for 
Did you mean: 

How to get Related objects for Job chain,JobDefinition and event definition

former_member587730
Participant
0 Kudos

related-objects.pngHello Blom,

I want to check related objects for Job chain,JobDefinition and event definition(I can take do it with iterator) and if they are null or none then I will print the (Job chain,JobDefinition and event definition) with redwood script.

But I am unable to find the required method for that.

Please find attached screen snap to get better insight.(Related object highlighted in with Red square)

can you please help.

former_member587730
Participant
0 Kudos

Hello Blom,

I have tried below but it does give the correct result. What is method I can use to check the Related objects ?

Can you please help.

{
 
String jdName="Test_Job";
String pPartition = "SDI";
Partition partition = jcsSession.getPartitionByName(pPartition);
JobDefinition jd = jcsSession.getJobDefinitionByName(partition,jdName);
jcsOut.println(jd.getName());
//JobDefinitionRelatedObject jdro = jd.getJobDefinitionRelatedObject();
//Iterator it = (Iterator)jdro;
Iterator it = (Iterator)jd.getJobDefinitionRelatedObject();
 
Integer counter = 0;
 
while(it.hasNext())
{
 
JobDefinition jd1 = (JobDefinition)it.next();
counter++;
jcsOut.println(jd1.getName());
}
 
if(counter ==0)
{
jcsOut.println("There is no related object tagged to this job");
}
 
 
}

Accepted Solutions (0)

Answers (0)