on 09-14-2015 4:22 AM
I am really new to Redwood. I need to somehow read an application and track down the jobs associated with it. So far, I have done just the script below but do not know the object and method to get the jobs in it. The flow needs to be from application>jobs instead of jobs>application as that would give a problem as thousands of jobs are being checked whether it satisfies the application condition
--------------------------
Application app=jcsSession.getApplicationByName("Testing");
Hi Ballgantung Kurikuntao,
The call jcsSession.getApplicationByName("Testing").getChildJobDefinitions() will return an iterator over all job definitions in your application and with job definitions, you can get the jobs.
There are examples in the documentation, search for iterator and you should find examples how to "iterate" over the job definitions and get the jobs.
Regards,
HP
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, I have done this. But through this iteration, I get some duplication of the job definitions in the application. Am I doing the iteration right?
-----------------------------------
{
for (Iterator it = jcsSession.getApplicationByName("Testing").getChildJobDefinitions(); it.hasNext();)
{
JobDefinition jobdef=(JobDefinition) it.next();
jcsOut.println("Job Definiton --- " +jobdef.getName()+ " "+jobdef.getCreationTime());
}
}
Hello,
You only need the Master version definitions:
{
for (Iterator it = jcsSession.getApplicationByName("Testing").getChildJobDefinitions(); it.hasNext();)
{
JobDefinition jobdef=(JobDefinition) it.next();
if (jobdef.isMasterVersion())
{
jcsOut.println("Job Definiton --- " +jobdef.getName()+ " "+jobdef.getCreationTime());
}
}
Regards Gerben
Thanks G.Blom for your helpful help. It works. Do you know where I can read on how to get the jobs from the job definition obtained from the lines above?. I only know through query as below which I dont want to use earlier as it would check on all jobs.
----------------
String query="select Job.* from Job where Name<>'System'";
for (iterator it=jcsSession.executeObjectQuery(query,null); it.hasNext();
----------------
Is there an object and method like " jcsSession.getApplicationByName("Testing").getChildJobDefinitions() " but to get the jobs in job definition instead of getting job definitions in an application
Hello,
A probably easier approach is to create a Job filter to select the jobs you want. For instance, the 'where job is part of Application' is one of the filter items.
This filter then can potentially be used in Report etc.
Regards Gerben
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
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.