|
1 | 1 | package com.codingapi.springboot.flow.pojo; |
2 | 2 |
|
3 | 3 | import com.codingapi.springboot.flow.domain.FlowNode; |
| 4 | +import com.codingapi.springboot.flow.em.NodeType; |
| 5 | +import com.codingapi.springboot.flow.user.IFlowOperator; |
4 | 6 | import lombok.Getter; |
5 | 7 |
|
6 | 8 | import java.util.ArrayList; |
|
9 | 11 | @Getter |
10 | 12 | public class FlowStepResult { |
11 | 13 |
|
12 | | - private final List<FlowNode> flowNodes; |
| 14 | + private final List<FlowStepNode> flowNodes; |
13 | 15 |
|
14 | 16 | public FlowStepResult() { |
15 | 17 | this.flowNodes = new ArrayList<>(); |
16 | 18 | } |
17 | 19 |
|
18 | | - public void addFlowNode(FlowNode flowNode) { |
19 | | - this.flowNodes.add(flowNode); |
| 20 | + public void addFlowNode(FlowNode flowNode,List<? extends IFlowOperator> operators) { |
| 21 | + this.flowNodes.add(new FlowStepNode(flowNode.getId(), flowNode.getCode(),flowNode.getName(),flowNode.getType(),operators)); |
20 | 22 | } |
21 | 23 |
|
22 | 24 |
|
23 | 25 | public void print(){ |
24 | | - for (FlowNode flowNode : flowNodes) { |
| 26 | + for (FlowStepNode flowNode : flowNodes) { |
25 | 27 | System.out.println("flowNode = " + flowNode.getName()); |
26 | 28 | } |
27 | 29 | } |
| 30 | + |
| 31 | + |
| 32 | + @Getter |
| 33 | + public static class FlowStepNode{ |
| 34 | + private final String id; |
| 35 | + private final String code; |
| 36 | + private final String name; |
| 37 | + private final NodeType type; |
| 38 | + private final List<? extends IFlowOperator> operators; |
| 39 | + |
| 40 | + public FlowStepNode(String id, String code, String name, NodeType type,List<? extends IFlowOperator> operators) { |
| 41 | + this.id = id; |
| 42 | + this.code = code; |
| 43 | + this.name = name; |
| 44 | + this.type = type; |
| 45 | + this.operators = operators; |
| 46 | + } |
| 47 | + } |
28 | 48 | } |
0 commit comments