on 08-28-2014 2:25 AM
Hi All,
I could not remove duplicates in the report using the below query.
select Job.* from Job where JobDefinition in(select JobDefinition.UniqueId from JobDefinition where JobDefinition.BranchedLLPVersion = "+MASTER+") and Job.status in ('K','E') order by Job.RunStart;
Right now I am getting both the child job name and parent job name as same if there is error in the child jobs. I want only parent job name even there are more than one child job errors.
Please help me to get the report.
Hello,
You can easily just remove the steps from the query. Also, the whole 'master' check is not necessary here.
select Job.* from Job where Job.JobChainStep is null and Job.status in ('K','E') order by Job.RunStart
Regards Gerben
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi vishnu,
There is one error:
select Job.* from Job where Job.JobChainStep is null and Job.Status in ('K','E') order by Job.RunStart
instead of
select Job.* from Job where Job.JobChainStep is null and Job.status in ('K','E') order by Job.RunStart
How did I get to this conclusion ?
When I have a Java stack, I always first look at the "caused by" lines ... and here, I see :
Caused by: com.redwood.scheduler.persistence.api.PersistenceException$UnknownField: JCS-XXXXX: Unknown field status in Job debug: aliases=true {Job=Job}
So, I looked at the data model for Job and I saw that the column is named Status, not status. The important part here is "Unknown field status in Job".
Regards,
HP
Hi Vishnu,
The following is not necessary:
DateTimeZone startTime = jcsJob.getJobParameterByName("DATE_START").getInValueDate();
DateTimeZone endTime = jcsJob.getJobParameterByName("DATE_END").getInValueDate();
You can simply use DATE_START and DATE_END in your source, as in RedwoodScript jobs, the job parameters are declared as such for you.
In your code, you can safely remove those two lines, since you are using Gerben's SQL query (with Job.Status instead of Job.status).
Regards,
HP
You have to check where clause on JobDefinitionType for JobChain.
select Job.* from Job where JobDefinition in(select jd.UniqueueId from JobDefinition jd where jd.JobDefinitionType = (select jdt.UniqueId from JobDefinitionType jdt where jdt.Name = 'JOB_CHAIN')) and Job.status in ('K','E') order by Job.RunStart;
This will retrieve only job chains, but in case you have an indvidual job that is not part of a job chain, it will not be returned.
I would recommend getting all the jobs in an iterator(both job chains and the child jobs), and then
Job j = it.next();
while(j.getParentJob() != null)
{
j = j.getParentJob();
}
//print the output you want.
Thanks
Nanda
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
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.