protected FlowElement convertJsonToElement(JsonNode elementNode, JsonNode modelNode, Map<String, JsonNode> shapeMap) { ExclusiveGateway gateway = new ExclusiveGateway(); return gateway; } }
ActivitiEventBuilder.createActivityEvent(ActivitiEventType.ACTIVITY_COMPLETED, exclusiveGateway.getId(), exclusiveGateway.getName(), execution.getId(), execution.getProcessInstanceId(), execution.getProcessDefinitionId(), exclusiveGateway)); String defaultSequenceFlowId = exclusiveGateway.getDefaultFlow(); Iterator<SequenceFlow> sequenceFlowIterator = exclusiveGateway.getOutgoingFlows().iterator(); while (outgoingSequenceFlow == null && sequenceFlowIterator.hasNext()) { SequenceFlow sequenceFlow = sequenceFlowIterator.next(); throw new ActivitiException("No outgoing sequence flow of the exclusive gateway '" + exclusiveGateway.getId() + "' could be selected for continuing the process");
protected void executeParse(BpmnParse bpmnParse, ExclusiveGateway gateway) { gateway.setBehavior(bpmnParse.getActivityBehaviorFactory().createExclusiveGatewayActivityBehavior(gateway)); }
public void validateExclusiveGateway(Process process, ExclusiveGateway exclusiveGateway, List<ValidationError> errors) { if (exclusiveGateway.getOutgoingFlows().isEmpty()) { addError(errors, Problems.EXCLUSIVE_GATEWAY_NO_OUTGOING_SEQ_FLOW, process, exclusiveGateway, "Exclusive gateway has no outgoing sequence flow"); } else if (exclusiveGateway.getOutgoingFlows().size() == 1) { SequenceFlow sequenceFlow = exclusiveGateway.getOutgoingFlows().get(0); if (StringUtils.isNotEmpty(sequenceFlow.getConditionExpression())) { addError(errors, Problems.EXCLUSIVE_GATEWAY_CONDITION_NOT_ALLOWED_ON_SINGLE_SEQ_FLOW, process, exclusiveGateway, "Exclusive gateway has only one outgoing sequence flow. This is not allowed to have a condition."); } } else { String defaultSequenceFlow = exclusiveGateway.getDefaultFlow(); List<SequenceFlow> flowsWithoutCondition = new ArrayList<SequenceFlow>(); for (SequenceFlow flow : exclusiveGateway.getOutgoingFlows()) { String condition = flow.getConditionExpression(); boolean isDefaultFlow = flow.getId() != null && flow.getId().equals(defaultSequenceFlow); boolean hasConditon = StringUtils.isNotEmpty(condition); if (!hasConditon && !isDefaultFlow) { flowsWithoutCondition.add(flow); } if (hasConditon && isDefaultFlow) { addError(errors, Problems.EXCLUSIVE_GATEWAY_CONDITION_ON_DEFAULT_SEQ_FLOW, process, exclusiveGateway, "Default sequenceflow has a condition, which is not allowed"); } } if (!flowsWithoutCondition.isEmpty()) { addWarning(errors, Problems.EXCLUSIVE_GATEWAY_SEQ_FLOW_WITHOUT_CONDITIONS, process, exclusiveGateway, "Exclusive gateway has at least one outgoing sequence flow without a condition (which isn't the default one)"); } } }
protected ExclusiveGateway createMergingExclusiveGateway(WorkflowDefinitionConversion conversion) { ExclusiveGateway mergingExclusiveGateway = new ExclusiveGateway(); mergingExclusiveGateway.setId(conversion.getUniqueNumberedId(ConversionConstants.GATEWAY_ID_PREFIX)); addFlowElement(conversion, mergingExclusiveGateway); return mergingExclusiveGateway; }
if (sourceFlowElement instanceof ExclusiveGateway) { ExclusiveGateway parentExclusiveGateway = (ExclusiveGateway) sourceFlowElement; defaultFlowId = parentExclusiveGateway.getDefaultFlow(); } else if (sourceFlowElement instanceof Activity) { Activity parentActivity = (Activity) sourceFlowElement;
addSequenceFlow(conversion, conversion.getLastActivityId(), forkGateway.getId()); conversion.setLastActivityId(forkGateway.getId()); if (conditionBuilder.length() > 0) { conditionBuilder.append("}"); SequenceFlow mainFlow = addSequenceFlow(conversion, forkGateway.getId(), flowElement.getId(), conditionBuilder.toString()); if(stepListDefinition.getName() != null) { mainFlow.setName(stepListDefinition.getName()); addSequenceFlow(conversion, forkGateway.getId(), flowElement.getId()); if (conditionBuilder.length() > 0) { conditionBuilder.append("}"); created = addSequenceFlow(conversion, forkGateway.getId(), null, conditionBuilder.toString()); } else { created = addSequenceFlow(conversion, forkGateway.getId(), null); conversion.setLastActivityId(joinGateway.getId()); addSequenceFlow(conversion, endElement.getId(), joinGateway.getId()); bypassingFlow.setTargetRef(joinGateway.getId());
public void validateExclusiveGateway(Process process, ExclusiveGateway exclusiveGateway, List<ValidationError> errors) { if (exclusiveGateway.getOutgoingFlows().isEmpty()) { addError(errors, Problems.EXCLUSIVE_GATEWAY_NO_OUTGOING_SEQ_FLOW, process, exclusiveGateway, "Exclusive gateway has no outgoing sequence flow"); } else if (exclusiveGateway.getOutgoingFlows().size() == 1) { SequenceFlow sequenceFlow = exclusiveGateway.getOutgoingFlows().get(0); if (StringUtils.isNotEmpty(sequenceFlow.getConditionExpression())) { addError(errors, Problems.EXCLUSIVE_GATEWAY_CONDITION_NOT_ALLOWED_ON_SINGLE_SEQ_FLOW, process, exclusiveGateway, "Exclusive gateway has only one outgoing sequence flow. This is not allowed to have a condition."); } } else { String defaultSequenceFlow = exclusiveGateway.getDefaultFlow(); List<SequenceFlow> flowsWithoutCondition = new ArrayList<SequenceFlow>(); for (SequenceFlow flow : exclusiveGateway.getOutgoingFlows()) { String condition = flow.getConditionExpression(); boolean isDefaultFlow = flow.getId() != null && flow.getId().equals(defaultSequenceFlow); boolean hasConditon = StringUtils.isNotEmpty(condition); if (!hasConditon && !isDefaultFlow) { flowsWithoutCondition.add(flow); } if (hasConditon && isDefaultFlow) { addError(errors, Problems.EXCLUSIVE_GATEWAY_CONDITION_ON_DEFAULT_SEQ_FLOW, process, exclusiveGateway, "Default sequenceflow has a condition, which is not allowed"); } } if (!flowsWithoutCondition.isEmpty()) { addWarning(errors, Problems.EXCLUSIVE_GATEWAY_SEQ_FLOW_WITHOUT_CONDITIONS, process, exclusiveGateway, "Exclusive gateway has at least one outgoing sequence flow without a condition (which isn't the default one)"); } } }
protected ExclusiveGateway createExclusiveGateway(WorkflowDefinitionConversion conversion) { ExclusiveGateway exclusiveGateway = new ExclusiveGateway(); exclusiveGateway.setId(conversion.getUniqueNumberedId(EXLCUSIVE_GATEWAY_PREFIX)); conversion.getProcess().addFlowElement(exclusiveGateway); return exclusiveGateway; }
protected void addExclusiveGateway(ExclusiveGateway exclusiveGateway) { Node exclusiveGwNode = createNode(exclusiveGateway); exclusiveGwNode.setProperty("type", Constants.TYPE_EXCLUSIVE_GATEWAY); if (exclusiveGateway.getDefaultFlow() != null) { exclusiveGwNode.setProperty("defaultFlow", exclusiveGateway.getDefaultFlow()); } }
ActivitiEventBuilder.createActivityEvent(ActivitiEventType.ACTIVITY_COMPLETED, exclusiveGateway.getId(), exclusiveGateway.getName(), execution.getId(), execution.getProcessInstanceId(), execution.getProcessDefinitionId(), exclusiveGateway)); String defaultSequenceFlowId = exclusiveGateway.getDefaultFlow(); Iterator<SequenceFlow> sequenceFlowIterator = exclusiveGateway.getOutgoingFlows().iterator(); while (outgoingSequenceFlow == null && sequenceFlowIterator.hasNext()) { SequenceFlow sequenceFlow = sequenceFlowIterator.next(); throw new ActivitiException("No outgoing sequence flow of the exclusive gateway '" + exclusiveGateway.getId() + "' could be selected for continuing the process");
@Override protected BaseElement convertXMLToElement(XMLStreamReader xtr, BpmnModel model) throws Exception { ExclusiveGateway gateway = new ExclusiveGateway(); BpmnXMLUtil.addXMLLocation(gateway, xtr); parseChildElements(getXMLElementName(), gateway, model, xtr); return gateway; }
if (sourceFlowElement instanceof ExclusiveGateway) { ExclusiveGateway parentExclusiveGateway = (ExclusiveGateway) sourceFlowElement; defaultFlowId = parentExclusiveGateway.getDefaultFlow(); } else if (sourceFlowElement instanceof Activity) { Activity parentActivity = (Activity) sourceFlowElement;
protected void executeParse(BpmnParse bpmnParse, ExclusiveGateway gateway) { gateway.setBehavior(bpmnParse.getActivityBehaviorFactory().createExclusiveGatewayActivityBehavior(gateway)); }
@Override protected BaseElement convertXMLToElement(XMLStreamReader xtr, BpmnModel model) throws Exception { ExclusiveGateway gateway = new ExclusiveGateway(); BpmnXMLUtil.addXMLLocation(gateway, xtr); parseChildElements(getXMLElementName(), gateway, model, xtr); return gateway; }
protected FlowElement convertJsonToElement(JsonNode elementNode, JsonNode modelNode, Map<String, JsonNode> shapeMap) { ExclusiveGateway gateway = new ExclusiveGateway(); return gateway; } }
@Override protected BaseElement convertXMLToElement(XMLStreamReader xtr) throws Exception { ExclusiveGateway gateway = new ExclusiveGateway(); BpmnXMLUtil.addXMLLocation(gateway, xtr); return gateway; }
@Override protected BaseElement convertXMLToElement(XMLStreamReader xtr, BpmnModel model) throws Exception { ExclusiveGateway gateway = new ExclusiveGateway(); BpmnXMLUtil.addXMLLocation(gateway, xtr); parseChildElements(getXMLElementName(), gateway, model, xtr); return gateway; }
@Override protected BaseElement convertXMLToElement(XMLStreamReader xtr, BpmnModel model) throws Exception { ExclusiveGateway gateway = new ExclusiveGateway(); BpmnXMLUtil.addXMLLocation(gateway, xtr); parseChildElements(getXMLElementName(), gateway, model, xtr); return gateway; }