Skip to content

Commit cd4db2f

Browse files
committed
split flow service
1 parent b14693c commit cd4db2f

File tree

16 files changed

+1056
-603
lines changed

16 files changed

+1056
-603
lines changed

example/example-application/src/main/java/com/codingapi/example/command/FlowRecordCmdController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ public SingleResponse<FlowResult> submitFlow(@RequestBody FlowCmd.SubmitFlow req
4949
}
5050

5151
@PostMapping("/custom")
52-
public SingleResponse<String> customFlow(@RequestBody FlowCmd.CustomFlow request) {
52+
public SingleResponse<String> customFlowEvent(@RequestBody FlowCmd.CustomFlow request) {
5353
User current = userRepository.getUserByUsername(request.getUserName());
54-
return SingleResponse.of(flowService.customFlow(request.getRecordId(), current, request.getButtonId(), request.getBindData(), request.getOpinion()));
54+
return SingleResponse.of(flowService.customFlowEvent(request.getRecordId(), current, request.getButtonId(), request.getBindData(), request.getOpinion()));
5555
}
5656

5757

springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/pojo/FlowDetail.java

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ public class FlowDetail {
4444
private final List<? extends IFlowOperator> operators;
4545

4646
/**
47-
* 创建者
47+
* 流程创建者
4848
*/
4949
private final IFlowOperator flowCreator;
5050

5151
/**
52-
* 创建时间
52+
* 流程创建时间
5353
*/
5454
private final long flowCreateTime;
5555

@@ -75,6 +75,19 @@ public FlowDetail(FlowRecord flowRecord,
7575
this.flowNode = flowWork.getNodeByCode(flowRecord.getNodeCode());
7676
}
7777

78+
public FlowDetail(FlowWork flowWork,
79+
FlowNode flowNode,
80+
List<? extends IFlowOperator> operators) {
81+
this.flowWork = flowWork;
82+
this.flowNode = flowNode;
83+
this.operators = operators;
84+
this.flowCreateTime = 0;
85+
this.flowRecord = null;
86+
this.historyRecords = null;
87+
this.bindData = null;
88+
this.opinions = null;
89+
this.flowCreator = null;
90+
}
7891

7992
@Getter
8093
public final class FlowOpinion {

springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/service/FlowDirectionService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
/**
1313
* 流程方向服务
1414
*/
15-
class FlowDirectionService {
15+
public class FlowDirectionService {
1616

1717
private final FlowWork flowWork;
1818
private final FlowNode flowNode;

springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/service/FlowNodeService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
/**
2424
* 流程节点服务
2525
*/
26-
class FlowNodeService {
26+
public class FlowNodeService {
2727

2828
@Getter
2929
private FlowNode nextNode;

springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/service/FlowRecordVerifyService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
/**
1414
* 流程记录服务(流程内部服务)
1515
*/
16-
class FlowRecordVerifyService {
16+
public class FlowRecordVerifyService {
1717

1818
// constructor params
1919
private final long recordId;

0 commit comments

Comments
 (0)