@Override public void cancelTasks() { CoreSession session = getSession(); List<TaskInfo> tasks = getTasksInfo(); for (TaskInfo task : tasks) { if (!task.isEnded()) { cancelTask(session, task.getTaskDocId()); } } }
@Override public void resumeInstance(String routeId, String nodeId, Map<String, Object> data, String status, CoreSession session) { AttachedDocumentsChecker adc = new AttachedDocumentsChecker(session, routeId); adc.runUnrestricted(); if (!adc.isWorkflowCanceled) { completeTask(routeId, nodeId, null, data, status, session); } }
/** * Deduce input transitions from output transitions. */ protected void computeTransitions() throws DocumentRouteException { for (GraphNode node : nodes) { List<Transition> tt = node.getOutputTransitions(); for (Transition t : tt) { GraphNode target = getNode(t.target); target.initAddInputTransition(t); } } }
protected void compute() { String startNodeId = computeNodes(); computeTransitions(); computeLoopTransitions(startNodeId); }
@Override public void importAllRouteModels(CoreSession session) { for (URL url : getRouteModelTemplateResources()) { importRouteModel(url, true, session); } }
@Override public void removePermissionFromTaskAssignees(CoreSession session, final List<DocumentModel> docs, Task task) { final String aclName = getRoutingACLName(task); new UnrestrictedSessionRunner(session) { @Override public void run() { for (DocumentModel doc : docs) { ACP acp = doc.getACP(); acp.removeACL(aclName); doc.setACP(acp, true); session.saveDocument(doc); } } }.runUnrestricted(); }
/** * Sets the variables of the workflow based on their JSON representation (especially for scalar lists). * * @since 5.9.3, 5.8.0-HF10 */ public static void setJSONVariables(DocumentModel doc, String facetProp, Map<String, String> map) { setJSONVariables(doc, facetProp, map, true); }
@Override public boolean isValidated() { return checkLifeCycleState(ElementLifeCycleState.validated); }
@Override public void setReady(CoreSession session) { followTransition(ElementLifeCycleTransistion.toReady, session, true); }
@Override public String getOutputChain() { return (String) getProperty(PROP_OUTPUT_CHAIN); }
@Override public String createNewInstance(String routeModelId, List<String> docIds, CoreSession session, boolean startInstance) { return createNewInstance(routeModelId, docIds, null, session, startInstance); }
@Override public List<EscalationRule> getEscalationRules() { if (escalationRules == null) { escalationRules = computeEscalationRules(); } return escalationRules; }
@Override public List<TaskInfo> getTasksInfo() { if (tasksInfo == null) { tasksInfo = computeTasksInfo(); } return tasksInfo; }
@Override public void setDone(CoreSession session) { followTransition(ElementLifeCycleTransistion.toDone, session, false); }
public DocumentModelList runQuery() { runUnrestricted(); return docs; } }
@Override public void setJSONVariables(Map<String, String> map) { GraphVariablesUtil.setJSONVariables(document, PROP_VARIABLES_FACET, map); }
@Override public boolean isDone() { return checkLifeCycleState(ElementLifeCycleState.done); }
@Override public void setCanceled(CoreSession session) { followTransition(ElementLifeCycleTransistion.toCanceled, session, false); }
@Override public String getTaskNotificationTemplate() { return (String) getProperty(PROP_TASK_NOTIFICATION_TEMPLATE); }