Пример #1
0
  private void mapEdges(Map<NodeAdaptor, Node> nodeMap) {
    for (EdgeAdaptor edge : this.edges) {
      if (edge.isSequenceFlow()) {
        Node source = nodeMap.get(edge.getSource());
        Node target = nodeMap.get(edge.getTarget());

        if (source != null && target != null) {
          Edge graphEdge = this.graph.createEdge(source, target);
          this.edgeMap.put(graphEdge, edge);
        }
      }
    }
  }
Пример #2
0
 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);
   }
 }
Пример #3
0
 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);
   }
 }