@Override public void endTask(CoreSession session, Task task, Map<String, Object> data, String status) throws DocumentRouteException { DocumentRoutingService routing = Framework.getService(DocumentRoutingService.class); routing.endTask(session, task, data, status); }
@OperationMethod(collector = DocumentModelCollector.class) public DocumentModel completeTask(DocumentModel task) { Map<String, Object> data = new HashMap<String, Object>(); if (comment != null) { data.put("comment", comment); } // the service expects an unique map containing both worflow and // nodeVariables if (nodeVariables != null) { data.put(Constants.VAR_WORKFLOW_NODE, nodeVariables); } if (workflowVariables != null) { data.put(Constants.VAR_WORKFLOW, workflowVariables); } data.put(DocumentRoutingConstants._MAP_VAR_FORMAT_JSON, Boolean.TRUE); documentRoutingService.endTask(session, task.getAdapter(Task.class), data, status); return task; } }
@PUT @Path("{taskId}/{action}") public Response completeTask(@PathParam("taskId") String taskId, @PathParam("action") String action, TaskCompletionRequest taskCompletionRequest) { Map<String, Object> data = taskCompletionRequest.getDataMap(); CoreSession session = getContext().getCoreSession(); Framework.getService(DocumentRoutingService.class).endTask(session, session.getDocument(new IdRef(taskId)).getAdapter(Task.class), data, action); Task completedTask = session.getDocument(new IdRef(taskId)).getAdapter(Task.class); return Response.ok(completedTask).status(Status.OK).build(); }
@PUT @Path("{taskId}/{taskAction}") public Response completeTask(@PathParam("taskId") String taskId, @PathParam("taskAction") String action, TaskCompletionRequest taskCompletionRequest) { Map<String, Object> data = taskCompletionRequest.getDataMap(); CoreSession session = getContext().getCoreSession(); Framework.getService(DocumentRoutingService.class).endTask(session, session.getDocument(new IdRef(taskId)).getAdapter(Task.class), data, action); Task completedTask = session.getDocument(new IdRef(taskId)).getAdapter(Task.class); return Response.ok(completedTask).status(Status.OK).build(); }
@OperationMethod() public DocumentModel run(DocumentModel document) throws Exception { Task task = ToutaticeWorkflowHelper.getTaskByName(taskName, coreSession, document); Task taskForNotif = new TaskImpl(task.getDocument()); String initiator = ToutaticeWorkflowHelper.getOnLineWorkflowInitiator(document); if(StringUtils.isNotBlank(comment)){ Principal principal = coreSession.getPrincipal(); task.addComment(principal.getName(), comment); } //FIXME: no matter if formVariable = new HashMap<String, Object>(0)? routingService.endTask(coreSession, task, new HashMap<String, Object>(0), transition); ToutaticeWorkflowHelper.notifyRecipients(coreSession, taskForNotif, document, initiator, getEvent(transition)); return document; }
routing.endTask(documentManager, new TaskImpl(doc), data, buttonId); } catch (DocumentRouteException e) {
routing.endTask(documentManager, task, data, button); facesMessages.add(StatusMessage.Severity.INFO, messages.get("workflow.feedback.info.taskEnded"));