use of org.jbpm.services.api.TaskNotFoundException in project jbpm by kiegroup.
the class UserTaskServiceImpl method start.
@Override
public void start(String deploymentId, Long taskId, String userId) {
UserTaskInstanceDesc task = dataService.getTaskById(taskId);
validateTask(deploymentId, taskId, task);
RuntimeManager manager = getRuntimeManager(task);
if (manager == null) {
logger.warn("Cannot find runtime manager for task {}", taskId);
return;
}
RuntimeEngine engine = manager.getRuntimeEngine(ProcessInstanceIdContext.get(task.getProcessInstanceId()));
try {
TaskService taskService = engine.getTaskService();
// perform actual operation
taskService.start(taskId, userId);
} catch (PermissionDeniedException e) {
throw new TaskNotFoundException(e.getMessage());
} finally {
disposeRuntimeEngine(manager, engine);
}
}
use of org.jbpm.services.api.TaskNotFoundException in project jbpm by kiegroup.
the class UserTaskServiceImpl method forward.
@Override
public void forward(String deploymentId, Long taskId, String userId, String targetEntityId) {
UserTaskInstanceDesc task = dataService.getTaskById(taskId);
validateTask(deploymentId, taskId, task);
RuntimeManager manager = getRuntimeManager(task);
if (manager == null) {
logger.warn("Cannot find runtime manager for task {}", taskId);
return;
}
RuntimeEngine engine = manager.getRuntimeEngine(ProcessInstanceIdContext.get(task.getProcessInstanceId()));
try {
TaskService taskService = engine.getTaskService();
// perform actual operation
taskService.forward(taskId, userId, targetEntityId);
} catch (PermissionDeniedException e) {
throw new TaskNotFoundException(e.getMessage());
} finally {
disposeRuntimeEngine(manager, engine);
}
}
Aggregations