public void validateWorkItemResultVariable(String processName, List<DataAssociation> outputs, WorkItem workItem) { // in case work item results are skip validation as there is no notion of mandatory data outputs if (!variableStrictEnabled || workItem.getResults().isEmpty()) { return; } List<String> outputNames = new ArrayList<String>(); for (DataAssociation association : outputs) { if (association.getSources() != null) { outputNames.add(association.getSources().get(0)); } if (association.getAssignments() != null) { for (Iterator<Assignment> it = association.getAssignments().iterator(); it.hasNext();) { outputNames.add(it.next().getFrom()); } } } for (String outputName : workItem.getResults().keySet()) { if (!outputNames.contains(outputName) && !defaultOutputVariables.contains(outputName)) { throw new IllegalArgumentException("Data output '" + outputName + "' is not defined in process '" + processName + "' for task '" + workItem.getParameter("NodeName") + "'"); } } }
target = ((WorkItem) workItem).getParameter(targetExpr); } else { target = context.getVariable(targetExpr);
public String getNodeName() { Node node = getNode(); if (node == null) { String nodeName = "[Dynamic]"; WorkItem workItem = getWorkItem(); if (workItem != null) { nodeName += " " + workItem.getParameter("TaskName"); } return nodeName; } return super.getNodeName(); }
protected String assignWorkItem(WorkItem workItem) { String actorId = null; // if this human task node is part of a swimlane, check whether an actor // has already been assigned to this swimlane String swimlaneName = getHumanTaskNode().getSwimlane(); SwimlaneContextInstance swimlaneContextInstance = getSwimlaneContextInstance(swimlaneName); if (swimlaneContextInstance != null) { actorId = swimlaneContextInstance.getActorId(swimlaneName); workItem.setParameter("SwimlaneActorId", actorId); } // if no actor can be assigned based on the swimlane, check whether an // actor is specified for this human task if (actorId == null) { actorId = (String) workItem.getParameter("ActorId"); if (actorId != null && swimlaneContextInstance != null && actorId.split(separator).length == 1) { swimlaneContextInstance.setActorId(swimlaneName, actorId); workItem.setParameter("SwimlaneActorId", actorId); } } // always return ActorId from workitem as SwimlaneActorId is kept as separate parameter return (String) workItem.getParameter("ActorId"); }
public void validateWorkItemResultVariable(String processName, List<DataAssociation> outputs, WorkItem workItem) { // in case work item results are skip validation as there is no notion of mandatory data outputs if (!variableStrictEnabled || workItem.getResults().isEmpty()) { return; } List<String> outputNames = new ArrayList<String>(); for (DataAssociation association : outputs) { if (association.getSources() != null) { outputNames.add(association.getSources().get(0)); } if (association.getAssignments() != null) { for (Iterator<Assignment> it = association.getAssignments().iterator(); it.hasNext();) { outputNames.add(it.next().getFrom()); } } } for (String outputName : workItem.getResults().keySet()) { if (!outputNames.contains(outputName) && !defaultOutputVariables.contains(outputName)) { throw new IllegalArgumentException("Data output '" + outputName + "' is not defined in process '" + processName + "' for task '" + workItem.getParameter("NodeName") + "'"); } } }
public String getNodeName() { Node node = getNode(); if (node == null) { String nodeName = "[Dynamic]"; WorkItem workItem = getWorkItem(); if (workItem != null) { nodeName += " " + workItem.getParameter("TaskName"); } return nodeName; } return super.getNodeName(); }
target = ((WorkItem) workItem).getParameter(targetExpr); } else { target = context.getVariable(targetExpr);
protected String assignWorkItem(WorkItem workItem) { String actorId = null; // if this human task node is part of a swimlane, check whether an actor // has already been assigned to this swimlane String swimlaneName = getHumanTaskNode().getSwimlane(); SwimlaneContextInstance swimlaneContextInstance = getSwimlaneContextInstance(swimlaneName); if (swimlaneContextInstance != null) { actorId = swimlaneContextInstance.getActorId(swimlaneName); workItem.setParameter("SwimlaneActorId", actorId); } // if no actor can be assigned based on the swimlane, check whether an // actor is specified for this human task if (actorId == null) { actorId = (String) workItem.getParameter("ActorId"); if (actorId != null && swimlaneContextInstance != null && actorId.split(separator).length == 1) { swimlaneContextInstance.setActorId(swimlaneName, actorId); workItem.setParameter("SwimlaneActorId", actorId); } } // always return ActorId from workitem as SwimlaneActorId is kept as separate parameter return (String) workItem.getParameter("ActorId"); }