Hey folks,
I have a User task with a Boundary Timer event and i am trying to use a Task Listener or Execution Listener to retrieve the due date of the timer. In my listener i am saving the taskid and duedate in my database in a non Camunda table to save having to use the task query api at a later stage. The taskid and due date are added to a large complex table which is the basis my my GUI, here each item can poentially be tied to a specific camunda user task.
The Timer uses a duration of Minutes like “PT10M”
Currrently i am trying to use the management service to lookup the timer but unfortunately it seems that at the point of task creation (in my listener) the boundary timer is not created and so i recieve null.
public class TaskCreator implements JavaDelegate {
@Override
public void execute(DelegateExecution execution) throws Exception {
Map<String, Object> vars = execution.getVariables();
Job timerJob = execution.getProcessEngineServices().getManagementService().createJobQuery()
.processInstanceId(execution.getProcessInstanceId()).timers().singleResult();
}
}
The query itself still needs refining but as a rudementary check i tried to retrieve all timers using a simlified query of
createJobQuery().timers().list()
Inside my listener this returns nothing but if i use this later (ie in debugger before completion of my task ) the the timer is found and thats why i know that the timer im looking for is not available at the point of task creation.
Does anybody have any ideas how i can hook into another event that will allow me to retrieve ethe timer due date before the task is assigned completed etc
Thanks