protected void finishTask(CoreSession session, GraphRoute graph, GraphNode node, Task task, boolean delete, String status) throws DocumentRouteException { DocumentRoutingService routing = Framework.getService(DocumentRoutingService.class); DocumentModelList docs = graph.getAttachedDocumentModels(); routing.removePermissionsForTaskActors(session, docs, task); // delete task if (delete) { session.removeDocument(new IdRef(task.getId())); } // get the last comment on the task, if there are several: // task might have been previously reassigned or delegated List<TaskComment> comments = task.getComments(); String comment = comments.size() > 0 ? comments.get(comments.size() - 1).getText() : ""; // actor NuxeoPrincipal principal = session.getPrincipal(); String actor = principal.getActingUser(); node.updateTaskInfo(task.getId(), true, status, actor, comment); }
DocumentModelList docs = graph.getAttachedDocumentModels(); TaskService taskService = Framework.getService(TaskService.class); DocumentRoutingService routing = Framework.getService(DocumentRoutingService.class);
"Invalid node " + routeId + " referenced by the task " + taskId); DocumentModelList docs = routeInstance.getAttachedDocumentModels(); Framework.getService(TaskService.class).delegateTask(session, taskId, delegatedActors, comment);
+ node.getId() + " doesn't allow reassignment."); DocumentModelList docs = routeInstance.getAttachedDocumentModels();
DocumentModelList docs = routeInstance.getAttachedDocumentModels(); removePermissionsForTaskActors(session, docs, task);