-
1. Re: TaskDeadlineService unschedule problem
swiderski.maciej Jun 11, 2014 1:28 AM (in response to b.r)do you mean that unschedule of a given task removes all other deadlines from timer service? If that's the case please file jira as it's certainly a bug.
-
2. Re: Re: TaskDeadlineService unschedule problem
b.r Jun 11, 2014 5:28 AM (in response to swiderski.maciej)In our case yes, it removes all deadlines from timer service but I am not sure if it's a bug as those deadlines stay unescalated on jbpm schema.
After debugging unschedule it turns out that our problem is coused by this piece of code in TaskDeadlinesServiceImpl.unschedule:
if (timerService != null && timerService instanceof GlobalTimerService) { if (type == DeadlineType.START) { List<Deadline> startDeadlines = deadlines.getStartDeadlines(); List<DeadlineSummaryImpl> resultList = (List<DeadlineSummaryImpl>)persistenceContext.queryInTransaction("UnescalatedStartDeadlines", ClassUtil.<List<DeadlineSummaryImpl>>castClass(List.class)); for (DeadlineSummaryImpl summary : resultList) { TaskDeadlineJob deadlineJob = new TaskDeadlineJob(summary.getTaskId(), summary.getDeadlineId(), DeadlineType.START); logger.debug("unscheduling timer job for deadline {} {} and task {} using timer service {}", deadlineJob.getId(), summary.getDeadlineId(), taskId, timerService); JobHandle jobHandle = jobHandles.remove(deadlineJob.getId()); if (jobHandle == null) { jobHandle = ((GlobalTimerService) timerService).buildJobHandleForContext(new TaskDeadlineJobContext(deadlineJob.getId())); } timerService.removeJob(jobHandle); (...)
resultList returns all deadlines for all active tasks and than in for loop there is .removeJob called on all of them.
UnescalatedStartDeadlines query in our application looks like this:
select new org.jbpm.services.task.query.DeadlineSummaryImpl( t.id, d.id, d.date) from TaskImpl t, DeadlineImpl d where t.archived = 0 and d in elements( t.deadlines.startDeadlines ) and d.escalated = 0 order by d.date
and from what i can see it's same in current master branch. Anyway I have filed the jira bug for this issue: [JBPM-4362] TaskDeadlinesServiceImpl unschedule method deletes triggers for all active deadlines in all tasks - JBoss Is…
-
3. Re: TaskDeadlineService unschedule problem
swiderski.maciej Jun 11, 2014 9:34 AM (in response to b.r)you're right, the main issue was that it did not filter out deadlines and unscheduled all of them, bug indeed. Already fixed on master. Thanks for reporting and detailed analysis.
-
4. Re: TaskDeadlineService unschedule problem
b.r Jun 11, 2014 10:31 AM (in response to swiderski.maciej)Fix has solved the issue.