@Override public ExclusiveGateway clone() { ExclusiveGateway clone = new ExclusiveGateway(); clone.setValues(this); return clone; }
FlowableEventBuilder.createActivityEvent(FlowableEngineEventType.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 FlowableException("No outgoing sequence flow of the exclusive gateway '" + exclusiveGateway.getId() + "' could be selected for continuing the process");
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<>(); for (SequenceFlow flow : exclusiveGateway.getOutgoingFlows()) { String condition = flow.getConditionExpression(); boolean isDefaultFlow = flow.getId() != null && flow.getId().equals(defaultSequenceFlow); boolean hasCondition = StringUtils.isNotEmpty(condition); if (!hasCondition && !isDefaultFlow) { flowsWithoutCondition.add(flow); } if (hasCondition && 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)"); } } }
@Override protected FlowElement convertJsonToElement(JsonNode elementNode, JsonNode modelNode, Map<String, JsonNode> shapeMap) { ExclusiveGateway gateway = new ExclusiveGateway(); return gateway; } }
if (sourceFlowElement instanceof ExclusiveGateway) { ExclusiveGateway parentExclusiveGateway = (ExclusiveGateway) sourceFlowElement; defaultFlowId = parentExclusiveGateway.getDefaultFlow(); } else if (sourceFlowElement instanceof InclusiveGateway) { InclusiveGateway parentInclusiveGateway = (InclusiveGateway) sourceFlowElement;
@Override protected void executeParse(BpmnParse bpmnParse, ExclusiveGateway gateway) { ActivityImpl activity = createActivityOnCurrentScope(bpmnParse, gateway, BpmnXMLConstants.ELEMENT_GATEWAY_EXCLUSIVE); activity.setAsync(gateway.isAsynchronous()); activity.setExclusive(!gateway.isNotExclusive()); activity.setActivityBehavior(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; }
@Override public ExclusiveGateway clone() { ExclusiveGateway clone = new ExclusiveGateway(); clone.setValues(this); return clone; }
@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; }