public void doValidation() { if (gateway.isEventBasedGateway()) return; // they are validated by a more specialized validator checkForNeedlessness(); checkForOutgoingConditionalFlows(); validateOutgoingDefaultFlow(); }
private void validateOutgoingDefaultFlow() { Set<EdgeAdaptor> defaultFlows = new HashSet<EdgeAdaptor>(), conditionalFlows = new HashSet<EdgeAdaptor>(); for (EdgeAdaptor edge : gateway.getOutgoingSequenceFlow()) { if (edge.isDefaultSequenceFlow()) { defaultFlows.add(edge); } else if (gateway.isDecisionGateway()) { conditionalFlows.add(edge); } } if (defaultFlows.size() > 1) { validator.addMessage("multipleDefaultFlows", gateway, defaultFlows); } if (!defaultFlows.isEmpty() && conditionalFlows.isEmpty() && !gateway.isDecisionGateway()) { validator.addMessage("defaultFlowFromGatewayWithNoDecision", gateway, defaultFlows); } }
private void checkForOutgoingConditionalFlows() { if (gateway.isEventBasedGateway()) { return; } Set<EdgeAdaptor> conditionalFlows = new HashSet<EdgeAdaptor>(); for (EdgeAdaptor edge : gateway.getOutgoingSequenceFlow()) { if (edge.isConditionalSequenceFlow()) { conditionalFlows.add(edge); } } if (!conditionalFlows.isEmpty()) { String messageID = gateway.isDecisionGateway() ? "conditionalFlowFromDecisionGateway" : "conditionalFlowFromParallelGateway"; validator.addMessage(messageID, gateway, conditionalFlows); } }