Jelajahi Sumber

属性修改

caixiaofeng 6 bulan lalu
induk
melakukan
5e41f0a038
17 mengubah file dengan 96 tambahan dan 96 penghapusan
  1. 16 16
      flow-workflow/flow-workflow-entity/src/main/java/com/flow/entity/FlowDefine.java
  2. 5 5
      flow-workflow/flow-workflow-entity/src/main/java/com/flow/entity/node/ApprovalNode.java
  3. 5 5
      flow-workflow/flow-workflow-entity/src/main/java/com/flow/entity/node/BranchNode.java
  4. 5 5
      flow-workflow/flow-workflow-entity/src/main/java/com/flow/entity/node/CcNode.java
  5. 5 5
      flow-workflow/flow-workflow-entity/src/main/java/com/flow/entity/node/ConditionNode.java
  6. 8 8
      flow-workflow/flow-workflow-entity/src/main/java/com/flow/entity/node/ExclusiveNode.java
  7. 5 5
      flow-workflow/flow-workflow-entity/src/main/java/com/flow/entity/node/HttpNode.java
  8. 8 8
      flow-workflow/flow-workflow-entity/src/main/java/com/flow/entity/node/InclusiveNode.java
  9. 5 5
      flow-workflow/flow-workflow-entity/src/main/java/com/flow/entity/node/JumpNode.java
  10. 1 1
      flow-workflow/flow-workflow-entity/src/main/java/com/flow/entity/node/Node.java
  11. 5 5
      flow-workflow/flow-workflow-entity/src/main/java/com/flow/entity/node/NotifyNode.java
  12. 7 7
      flow-workflow/flow-workflow-entity/src/main/java/com/flow/entity/node/ParallelNode.java
  13. 5 5
      flow-workflow/flow-workflow-entity/src/main/java/com/flow/entity/node/ServiceNode.java
  14. 3 3
      flow-workflow/flow-workflow-entity/src/main/java/com/flow/entity/node/StartNode.java
  15. 3 3
      flow-workflow/flow-workflow-entity/src/main/java/com/flow/entity/node/StartTaskNode.java
  16. 5 5
      flow-workflow/flow-workflow-entity/src/main/java/com/flow/entity/node/TimerNode.java
  17. 5 5
      flow-workflow/flow-workflow-entity/src/main/java/com/flow/entity/node/TimerStartNode.java

+ 16 - 16
flow-workflow/flow-workflow-entity/src/main/java/com/flow/entity/FlowDefine.java

@@ -78,8 +78,8 @@ public class FlowDefine extends BaseEntity {
         if (Objects.nonNull(node)) {
             if (clazz.isInstance(node)) {
                 BranchNode branchNode = (BranchNode) node;
-                List<ConditionNode> children = branchNode.getChildren();
-                if (children.stream().anyMatch(c -> c.getId().equals(childId))) {
+                List<ConditionNode> branches = branchNode.getBranches();
+                if (branches.stream().anyMatch(c -> c.getId().equals(childId))) {
                     list.add(clazz.cast(node));
                 }
             }
@@ -100,13 +100,13 @@ public class FlowDefine extends BaseEntity {
         }
         if (node instanceof BranchNode) {
             BranchNode branchNode = (BranchNode) node;
-            for (Node branch : branchNode.getChildren()) {
+            for (Node branch : branchNode.getBranches()) {
                 foundFlowNodes.addAll(flatNodesOfType(branch, clazz));
             }
         }
-        Node child = node.getChild();
-        if (child != null) {
-            foundFlowNodes.addAll(flatNodesOfType(child, clazz));
+        Node next = node.getNext();
+        if (next != null) {
+            foundFlowNodes.addAll(flatNodesOfType(next, clazz));
         }
         return foundFlowNodes;
     }
@@ -122,13 +122,13 @@ public class FlowDefine extends BaseEntity {
         }
         if (node instanceof BranchNode) {
             BranchNode branchNode = (BranchNode) node;
-            for (Node branch : branchNode.getChildren()) {
+            for (Node branch : branchNode.getBranches()) {
                 foundFlowNodes.addAll(findFlowNodesOfType(clazz, branch));
             }
         }
-        Node child = node.getChild();
-        if (child != null) {
-            foundFlowNodes.addAll(findFlowNodesOfType(clazz, child));
+        Node next = node.getNext();
+        if (next != null) {
+            foundFlowNodes.addAll(findFlowNodesOfType(clazz, next));
         }
         return foundFlowNodes;
     }
@@ -146,14 +146,14 @@ public class FlowDefine extends BaseEntity {
         }
         if (node instanceof BranchNode) {
             BranchNode branchNode = (BranchNode) node;
-            for (Node branch : branchNode.getChildren()) {
+            for (Node branch : branchNode.getBranches()) {
                 T result = findFlowNodeOfType(clazz, nodeId, branch);
                 if (Objects.nonNull(result)) return result;
             }
         }
-        Node child = node.getChild();
-        if (child != null) {
-            T result = findFlowNodeOfType(clazz, nodeId, child);
+        Node next = node.getNext();
+        if (next != null) {
+            T result = findFlowNodeOfType(clazz, nodeId, next);
             if (Objects.nonNull(result)) return result;
         }
         return null;
@@ -204,11 +204,11 @@ public class FlowDefine extends BaseEntity {
             listOfAllNodes.add(node);
             if (node instanceof BranchNode) {
                 BranchNode branchNode = (BranchNode) node;
-                for (Node branch : branchNode.getChildren()) {
+                for (Node branch : branchNode.getBranches()) {
                     collectSubNodes(branch, listOfAllNodes);
                 }
             }
-            collectSubNodes(node.getChild(), listOfAllNodes);
+            collectSubNodes(node.getNext(), listOfAllNodes);
         }
     }
 

+ 5 - 5
flow-workflow/flow-workflow-entity/src/main/java/com/flow/entity/node/ApprovalNode.java

@@ -118,13 +118,13 @@ public class ApprovalNode extends AssigneeNode {
         }
         elements.add(userTask);
         // 下一个节点的连线
-        Node child = this.getChild();
-        SequenceFlow sequenceFlow = this.buildSequence(child);
+        Node next = this.getNext();
+        SequenceFlow sequenceFlow = this.buildSequence(next);
         elements.add(sequenceFlow);
         // 下一个节点
-        if (Objects.nonNull(child)) {
-            child.setBranchId(this.getBranchId());
-            List<FlowElement> flowElements = child.convert();
+        if (Objects.nonNull(next)) {
+            next.setBranchId(this.getBranchId());
+            List<FlowElement> flowElements = next.convert();
             elements.addAll(flowElements);
         }
         return elements;

+ 5 - 5
flow-workflow/flow-workflow-entity/src/main/java/com/flow/entity/node/BranchNode.java

@@ -16,7 +16,7 @@ import java.util.Optional;
 @EqualsAndHashCode(callSuper = true)
 @Data
 public abstract class BranchNode extends Node {
-    private List<ConditionNode> children;
+    private List<ConditionNode> branches;
 
     public abstract List<FlowElement> convert();
 
@@ -30,12 +30,12 @@ public abstract class BranchNode extends Node {
         ArrayList<FlowElement> elements = Lists.newArrayList(gateway);
         // 下一个节点的连线
         SequenceFlow sequenceFlow = new SequenceFlow();
-        Node child = this.getChild();
-        Optional<Node> optional = Optional.ofNullable(child);
+        Node next = this.getNext();
+        Optional<Node> optional = Optional.ofNullable(next);
         if (optional.isPresent()) {
             sequenceFlow.setSourceRef(gateway.getId());
-            sequenceFlow.setTargetRef(child.getId());
-            sequenceFlow.setId(String.format("%s-%s", gateway.getId(), child.getId()));
+            sequenceFlow.setTargetRef(next.getId());
+            sequenceFlow.setId(String.format("%s-%s", gateway.getId(), next.getId()));
         } else {
             if (StringUtils.isNotBlank(this.getBranchId())) {
                 sequenceFlow.setSourceRef(gateway.getId());

+ 5 - 5
flow-workflow/flow-workflow-entity/src/main/java/com/flow/entity/node/CcNode.java

@@ -46,13 +46,13 @@ public class CcNode extends AssigneeNode {
         copyServiceTask.getFieldExtensions().add(fieldExtension);
         elements.add(copyServiceTask);
         // 下一个节点的连线
-        Node child = this.getChild();
-        SequenceFlow sequenceFlow = this.buildSequence(child);
+        Node next = this.getNext();
+        SequenceFlow sequenceFlow = this.buildSequence(next);
         elements.add(sequenceFlow);
         // 下一个节点
-        if (Objects.nonNull(child)) {
-            child.setBranchId(this.getBranchId());
-            List<FlowElement> flowElements = child.convert();
+        if (Objects.nonNull(next)) {
+            next.setBranchId(this.getBranchId());
+            List<FlowElement> flowElements = next.convert();
             elements.addAll(flowElements);
         }
         return elements;

+ 5 - 5
flow-workflow/flow-workflow-entity/src/main/java/com/flow/entity/node/ConditionNode.java

@@ -119,7 +119,7 @@ public class ConditionNode extends Node {
         sequenceFlow.setName(this.getName());
         sequenceFlow.setExecutionListeners(this.buidEventListener());
         sequenceFlow.setTargetRef(
-                Optional.ofNullable(this.getChild()).map(Node::getId).orElse(this.getBranchId())
+                Optional.ofNullable(this.getNext()).map(Node::getId).orElse(this.getBranchId())
         );
         if (Objects.nonNull(conditions)) {
             String expression = this.toExpression(conditions);
@@ -129,10 +129,10 @@ public class ConditionNode extends Node {
         }
         elements.add(sequenceFlow);
         // 下一个节点
-        Node child = this.getChild();
-        if (Objects.nonNull(child)) {
-            child.setBranchId(this.getBranchId());
-            List<FlowElement> flowElements = child.convert();
+        Node next = this.getNext();
+        if (Objects.nonNull(next)) {
+            next.setBranchId(this.getBranchId());
+            List<FlowElement> flowElements = next.convert();
             elements.addAll(flowElements);
         }
         return elements;

+ 8 - 8
flow-workflow/flow-workflow-entity/src/main/java/com/flow/entity/node/ExclusiveNode.java

@@ -24,8 +24,8 @@ public class ExclusiveNode extends BranchNode {
         exclusiveGateway.setName(this.getName());
         exclusiveGateway.setExecutionListeners(this.buidEventListener());
         elements.add(exclusiveGateway);
-        List<ConditionNode> children = this.getChildren();
-        children.stream()
+        List<ConditionNode> branches = this.getBranches();
+        branches.stream()
                 .filter(ConditionNode::getDef)
                 .findFirst()
                 .ifPresent(conditionNode -> {
@@ -37,8 +37,8 @@ public class ExclusiveNode extends BranchNode {
         gateway.setName("独占聚合");
         elements.addAll(this.merge(gateway));
         // 子节点
-        if (CollectionUtils.isNotEmpty(children)) {
-            for (Node next : children) {
+        if (CollectionUtils.isNotEmpty(branches)) {
+            for (Node next : branches) {
                 String branchId = gateway.getId();
                 // String branchId = Optional.ofNullable(this.getChild()).map(Node::getId).orElse(this.getBranchId());
                 next.setBranchId(branchId);
@@ -46,10 +46,10 @@ public class ExclusiveNode extends BranchNode {
             }
         }
         // 下一个节点
-        Node child = this.getChild();
-        if (Objects.nonNull(child)) {
-            child.setBranchId(this.getBranchId());
-            List<FlowElement> flowElements = child.convert();
+        Node next = this.getNext();
+        if (Objects.nonNull(next)) {
+            next.setBranchId(this.getBranchId());
+            List<FlowElement> flowElements = next.convert();
             elements.addAll(flowElements);
         }
         return elements;

+ 5 - 5
flow-workflow/flow-workflow-entity/src/main/java/com/flow/entity/node/HttpNode.java

@@ -114,13 +114,13 @@ public class HttpNode extends Node {
         elements.add(httpServiceTask);
         elements.addAll(this.errorHandler(httpServiceTask));
         // 下一个节点的连线
-        Node child = this.getChild();
-        SequenceFlow sequenceFlow = this.buildSequence(child);
+        Node next = this.getNext();
+        SequenceFlow sequenceFlow = this.buildSequence(next);
         elements.add(sequenceFlow);
         // 下一个节点
-        if (Objects.nonNull(child)) {
-            child.setBranchId(this.getBranchId());
-            List<FlowElement> flowElements = child.convert();
+        if (Objects.nonNull(next)) {
+            next.setBranchId(this.getBranchId());
+            List<FlowElement> flowElements = next.convert();
             elements.addAll(flowElements);
         }
         return elements;

+ 8 - 8
flow-workflow/flow-workflow-entity/src/main/java/com/flow/entity/node/InclusiveNode.java

@@ -25,8 +25,8 @@ public class InclusiveNode extends BranchNode {
         inclusiveGateway.setName(this.getName());
         inclusiveGateway.setExecutionListeners(this.buidEventListener());
         elements.add(inclusiveGateway);
-        List<ConditionNode> children = this.getChildren();
-        children.stream()
+        List<ConditionNode> branches = this.getBranches();
+        branches.stream()
                 .filter(ConditionNode::getDef)
                 .findFirst()
                 .ifPresent(conditionNode -> {
@@ -38,17 +38,17 @@ public class InclusiveNode extends BranchNode {
         gateway.setName("包容聚合");
         elements.addAll(this.merge(gateway));
         // 子节点
-        if (CollectionUtils.isNotEmpty(children)) {
-            for (Node next : children) {
+        if (CollectionUtils.isNotEmpty(branches)) {
+            for (Node next : branches) {
                 next.setBranchId(gateway.getId());
                 elements.addAll(next.convert());
             }
         }
         // 下一个节点
-        Node child = this.getChild();
-        if (Objects.nonNull(child)) {
-            child.setBranchId(this.getBranchId());
-            List<FlowElement> flowElements = child.convert();
+        Node next = this.getNext();
+        if (Objects.nonNull(next)) {
+            next.setBranchId(this.getBranchId());
+            List<FlowElement> flowElements = next.convert();
             elements.addAll(flowElements);
         }
         return elements;

+ 5 - 5
flow-workflow/flow-workflow-entity/src/main/java/com/flow/entity/node/JumpNode.java

@@ -44,13 +44,13 @@ public class JumpNode extends Node {
         }
         elements.add(jumpServiceTask);
         // 下一个节点的连线
-        Node child = this.getChild();
-        SequenceFlow sequenceFlow = this.buildSequence(child);
+        Node next = this.getNext();
+        SequenceFlow sequenceFlow = this.buildSequence(next);
         elements.add(sequenceFlow);
         // 下一个节点
-        if (Objects.nonNull(child)) {
-            child.setBranchId(this.getBranchId());
-            List<FlowElement> flowElements = child.convert();
+        if (Objects.nonNull(next)) {
+            next.setBranchId(this.getBranchId());
+            List<FlowElement> flowElements = next.convert();
             elements.addAll(flowElements);
         }
         return elements;

+ 1 - 1
flow-workflow/flow-workflow-entity/src/main/java/com/flow/entity/node/Node.java

@@ -45,7 +45,7 @@ public abstract class Node implements Serializable {
     @JsonTypeId
     private String type;
     private List<NodeListener> executionListeners;
-    private Node child;
+    private Node next;
     @JsonIgnore
     private String branchId;
 

+ 5 - 5
flow-workflow/flow-workflow-entity/src/main/java/com/flow/entity/node/NotifyNode.java

@@ -51,13 +51,13 @@ public class NotifyNode extends AssigneeNode {
         serviceTask.getFieldExtensions().add(contentExtension);
         elements.add(serviceTask);
         // 下一个节点的连线
-        Node child = this.getChild();
-        SequenceFlow sequenceFlow = this.buildSequence(child);
+        Node next = this.getNext();
+        SequenceFlow sequenceFlow = this.buildSequence(next);
         elements.add(sequenceFlow);
         // 下一个节点
-        if (Objects.nonNull(child)) {
-            child.setBranchId(this.getBranchId());
-            List<FlowElement> flowElements = child.convert();
+        if (Objects.nonNull(next)) {
+            next.setBranchId(this.getBranchId());
+            List<FlowElement> flowElements = next.convert();
             elements.addAll(flowElements);
         }
         return elements;

+ 7 - 7
flow-workflow/flow-workflow-entity/src/main/java/com/flow/entity/node/ParallelNode.java

@@ -25,24 +25,24 @@ public class ParallelNode extends BranchNode {
         inclusiveGateway.setName(this.getName());
         inclusiveGateway.setExecutionListeners(this.buidEventListener());
         elements.add(inclusiveGateway);
-        List<ConditionNode> children = this.getChildren();
+        List<ConditionNode> branches = this.getBranches();
         // 分支聚合
         InclusiveGateway gateway = new InclusiveGateway();
         gateway.setId(String.format("%send", this.getId()));
         gateway.setName("并行聚合");
         elements.addAll(this.merge(gateway));
         // 子节点
-        if (CollectionUtils.isNotEmpty(children)) {
-            for (Node next : children) {
+        if (CollectionUtils.isNotEmpty(branches)) {
+            for (Node next : branches) {
                 next.setBranchId(gateway.getId());
                 elements.addAll(next.convert());
             }
         }
         // 下一个节点
-        Node child = this.getChild();
-        if (Objects.nonNull(child)) {
-            child.setBranchId(this.getBranchId());
-            List<FlowElement> flowElements = child.convert();
+        Node next = this.getNext();
+        if (Objects.nonNull(next)) {
+            next.setBranchId(this.getBranchId());
+            List<FlowElement> flowElements = next.convert();
             elements.addAll(flowElements);
         }
         return elements;

+ 5 - 5
flow-workflow/flow-workflow-entity/src/main/java/com/flow/entity/node/ServiceNode.java

@@ -58,13 +58,13 @@ public class ServiceNode extends Node {
         }
         elements.add(serviceTask);
         // 下一个节点的连线
-        Node child = this.getChild();
-        SequenceFlow sequenceFlow = this.buildSequence(child);
+        Node next = this.getNext();
+        SequenceFlow sequenceFlow = this.buildSequence(next);
         elements.add(sequenceFlow);
         // 下一个节点
-        if (Objects.nonNull(child)) {
-            child.setBranchId(this.getBranchId());
-            List<FlowElement> flowElements = child.convert();
+        if (Objects.nonNull(next)) {
+            next.setBranchId(this.getBranchId());
+            List<FlowElement> flowElements = next.convert();
             elements.addAll(flowElements);
         }
         return elements;

+ 3 - 3
flow-workflow/flow-workflow-entity/src/main/java/com/flow/entity/node/StartNode.java

@@ -45,11 +45,11 @@ public class StartNode extends Node {
         userTask.setSkipExpression("${_SKIP_INITIATOR == true}");
         elements.add(userTask);
         // 下一个节点的连线
-        Node child = this.getChild();
-        SequenceFlow sequence = this.buildSequence(child);
+        Node next = this.getNext();
+        SequenceFlow sequence = this.buildSequence(next);
         elements.add(sequence);
         // 下一个节点
-        List<FlowElement> flowElements = child.convert();
+        List<FlowElement> flowElements = next.convert();
         elements.addAll(flowElements);
         return elements;
     }

+ 3 - 3
flow-workflow/flow-workflow-entity/src/main/java/com/flow/entity/node/StartTaskNode.java

@@ -45,11 +45,11 @@ public class StartTaskNode extends Node {
         userTask.setSkipExpression("${_SKIP_INITIATOR == true}");
         elements.add(userTask);
         // 下一个节点的连线
-        Node child = this.getChild();
-        SequenceFlow sequence = this.buildSequence(child);
+        Node next = this.getNext();
+        SequenceFlow sequence = this.buildSequence(next);
         elements.add(sequence);
         // 下一个节点
-        List<FlowElement> flowElements = child.convert();
+        List<FlowElement> flowElements = next.convert();
         elements.addAll(flowElements);
         return elements;
     }

+ 5 - 5
flow-workflow/flow-workflow-entity/src/main/java/com/flow/entity/node/TimerNode.java

@@ -43,13 +43,13 @@ public class TimerNode extends Node {
         intermediateCatchEvent.setEventDefinitions(eventDefinitions);
         elements.add(intermediateCatchEvent);
         // 下一个节点的连线
-        Node child = this.getChild();
-        SequenceFlow sequenceFlow = this.buildSequence(child);
+        Node next = this.getNext();
+        SequenceFlow sequenceFlow = this.buildSequence(next);
         elements.add(sequenceFlow);
         // 下一个节点
-        if (Objects.nonNull(child)) {
-            child.setBranchId(this.getBranchId());
-            List<FlowElement> flowElements = child.convert();
+        if (Objects.nonNull(next)) {
+            next.setBranchId(this.getBranchId());
+            List<FlowElement> flowElements = next.convert();
             elements.addAll(flowElements);
         }
         return elements;

+ 5 - 5
flow-workflow/flow-workflow-entity/src/main/java/com/flow/entity/node/TimerStartNode.java

@@ -28,13 +28,13 @@ public class TimerStartNode extends Node {
         startEvent.setEventDefinitions(Lists.newArrayList(timerEventDefinition));
         elements.add(startEvent);
         // 下一个节点的连线
-        Node child = this.getChild();
-        SequenceFlow sequenceFlow = this.buildSequence(child);
+        Node next = this.getNext();
+        SequenceFlow sequenceFlow = this.buildSequence(next);
         elements.add(sequenceFlow);
         // 下一个节点
-        if (Objects.nonNull(child)) {
-            child.setBranchId(this.getBranchId());
-            List<FlowElement> flowElements = child.convert();
+        if (Objects.nonNull(next)) {
+            next.setBranchId(this.getBranchId());
+            List<FlowElement> flowElements = next.convert();
             elements.addAll(flowElements);
         }
         return elements;