Search in sources :

Example 1 with ListTimersCommand

use of org.jbpm.kie.services.impl.admin.commands.ListTimersCommand in project jbpm by kiegroup.

the class ProcessInstanceAdminServiceImpl method getTimerInstances.

@Override
public Collection<TimerInstance> getTimerInstances(long processInstanceId) throws ProcessInstanceNotFoundException {
    ProcessInstanceDesc pi = runtimeDataService.getProcessInstanceById(processInstanceId);
    if (pi == null) {
        throw new ProcessInstanceNotFoundException("Process instance with id " + processInstanceId + " not found");
    }
    Collection<TimerInstance> timers = processService.execute(pi.getDeploymentId(), ProcessInstanceIdContext.get(processInstanceId), new ListTimersCommand(processInstanceId));
    return timers;
}
Also used : TimerInstance(org.jbpm.services.api.admin.TimerInstance) ProcessInstanceDesc(org.jbpm.services.api.model.ProcessInstanceDesc) ListTimersCommand(org.jbpm.kie.services.impl.admin.commands.ListTimersCommand) ProcessInstanceNotFoundException(org.jbpm.services.api.ProcessInstanceNotFoundException)

Aggregations

ListTimersCommand (org.jbpm.kie.services.impl.admin.commands.ListTimersCommand)1 ProcessInstanceNotFoundException (org.jbpm.services.api.ProcessInstanceNotFoundException)1 TimerInstance (org.jbpm.services.api.admin.TimerInstance)1 ProcessInstanceDesc (org.jbpm.services.api.model.ProcessInstanceDesc)1