@Override public void run() throws ClientException { DocumentModel doc = session.getDocument(new IdRef(routeDocId)); GraphRoute route = doc.getAdapter(GraphRoute.class); GraphNode node = route.getNode(nodeId); HashMap<String, Serializable> map = new HashMap<String, Serializable>(); if (getFormVariables) { map.putAll(node.getVariables()); map.putAll(route.getVariables()); } res[0] = new TaskInfo(task.getId(), map, node.getTaskLayout(), node.getTaskButtons(), node.allowTaskReassignment(), task.getName()); } }.runUnrestricted();
/** * @since 5.8 - Define if action reassign task can be displayed. */ public boolean canBeReassign() throws ClientException { if (currentTask == null) { return false; } DocumentModel workflowInstance = documentManager.getDocument(new IdRef( currentTask.getProcessId())); GraphRoute workflow = workflowInstance.getAdapter(GraphRoute.class); if (workflow == null) { return false; } GraphNode node = workflow.getNode(currentTask.getType()); return node.allowTaskReassignment(); } }
jg.writeFieldName("taskInfo"); jg.writeStartObject(); jg.writeBooleanField("allowTaskReassignment", node.allowTaskReassignment());
"Invalid node " + routeId + " referenced by the task " + taskId); if (!node.allowTaskReassignment()) { throw new DocumentRouteException("Task " + taskId + " can not be reassigned. Node " + node.getId() + " doesn't allow reassignment.");