Skip to content

Commit 458eb01

Browse files
committed
#72 remove schema
1 parent 86a9218 commit 458eb01

9 files changed

Lines changed: 5 additions & 42 deletions

File tree

flow-engine-framework/src/main/java/com/codingapi/flow/workflow/Workflow.java

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,6 @@ public class Workflow {
7777
*/
7878
private List<IFlowNode> nodes;
7979

80-
81-
/**
82-
* 流程设计
83-
*/
84-
private String schema;
85-
8680
/**
8781
* 流程策略
8882
*/
@@ -158,10 +152,6 @@ protected void setNodes(List<IFlowNode> nodes) {
158152
this.nodes = nodes;
159153
}
160154

161-
protected void setSchema(String schema) {
162-
this.schema = schema;
163-
}
164-
165155
protected void setCreatedTime(long createdTime) {
166156
this.createdTime = createdTime;
167157
}
@@ -180,7 +170,7 @@ protected void setStrategies(List<IWorkflowStrategy> strategies) {
180170
*
181171
* @return json
182172
*/
183-
public String toJson(boolean hasSchema) {
173+
public String toJson() {
184174
Map<String, Object> map = new HashMap<>();
185175
map.put("id", id);
186176
map.put("code", code);
@@ -195,7 +185,6 @@ public String toJson(boolean hasSchema) {
195185
map.put("nodes", nodes.stream().map(IFlowNode::toMap).toList());
196186
map.put("createdTime", String.valueOf(createdTime));
197187
map.put("updatedTime", String.valueOf(updatedTime));
198-
map.put("schema", hasSchema ? schema : null);
199188
map.put("strategies", strategies.stream().map(IWorkflowStrategy::toMap).toList());
200189
return JSON.toJSONString(map);
201190
}
@@ -210,7 +199,6 @@ public static Workflow formJson(String json) {
210199
workflow.setId((String) data.get("id"));
211200
workflow.setCode((String) data.get("code"));
212201
workflow.setTitle((String) data.get("title"));
213-
workflow.setSchema((String) data.get("schema"));
214202
workflow.setCreatedTime(Long.parseLong((String) data.get("createdTime")));
215203
workflow.setUpdatedTime(Long.parseLong((String) data.get("updatedTime")));
216204
workflow.setCreatedOperator(GatewayContext.getInstance().getFlowOperator(createOperator));

flow-engine-framework/src/main/java/com/codingapi/flow/workflow/WorkflowVersion.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,6 @@ public class WorkflowVersion {
7878
*/
7979
private List<IFlowNode> nodes;
8080

81-
/**
82-
* 流程设计
83-
*/
84-
private String schema;
8581

8682
/**
8783
* 流程策略
@@ -118,7 +114,6 @@ public WorkflowVersion(Workflow workflow) {
118114
this.form = workflow.getForm();
119115
this.operatorCreateScript = workflow.getOperatorCreateScript();
120116
this.nodes = workflow.getNodes();
121-
this.schema = workflow.getSchema();
122117
this.strategies = workflow.getStrategies();
123118
this.enable = workflow.isEnable();
124119
this.current = true;
@@ -135,7 +130,6 @@ public Workflow toWorkflow() {
135130
this.form,
136131
this.operatorCreateScript,
137132
this.nodes,
138-
this.schema,
139133
this.strategies,
140134
this.enable
141135
);

flow-engine-framework/src/main/java/com/codingapi/flow/workflow/runtime/WorkflowRuntime.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public class WorkflowRuntime {
4242

4343

4444
public WorkflowRuntime(Workflow workflow) {
45-
this.workflow = workflow.toJson(false);
45+
this.workflow = workflow.toJson();
4646
this.workId = workflow.getId();
4747
this.workCode = workflow.getCode();
4848
this.workTitle = workflow.getTitle();

flow-engine-framework/src/test/java/com/codingapi/flow/workflow/WorkflowBuilderTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ void buildBasicWorkflow() {
8888
assertEquals(3, workflow.getNodes().size());
8989

9090

91-
String json = workflow.toJson(true);
91+
String json = workflow.toJson();
9292
System.out.println(json);
9393

9494
Workflow workflowBck = Workflow.formJson(json);
@@ -100,7 +100,6 @@ void buildBasicWorkflow() {
100100
assertEquals(workflow.getCreatedOperator().getUserId(), workflowBck.getCreatedOperator().getUserId());
101101
assertEquals(workflow.getForm().getCode(), workflowBck.getForm().getCode());
102102
assertEquals(workflow.getNodes().size(), workflowBck.getNodes().size());
103-
assertEquals(workflow.getSchema(), workflowBck.getSchema());
104103
assertEquals(workflow.getNodes().get(0).getId(), workflowBck.getNodes().get(0).getId());
105104

106105
}

flow-engine-starter-api/src/main/java/com/codingapi/flow/api/controller/WorkflowController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public SingleResponse<JSONObject> create() {
6666
Workflow workflow = WorkflowBuilder.builder()
6767
.build(false);
6868
workflow.addDefaultNodesAndEdges();
69-
JSONObject jsonObject = JSONObject.parseObject(workflow.toJson(true));
69+
JSONObject jsonObject = JSONObject.parseObject(workflow.toJson());
7070
return SingleResponse.of(jsonObject);
7171
}
7272

@@ -95,7 +95,7 @@ public Response save(@RequestBody JSONObject request) {
9595
@GetMapping("/load")
9696
public SingleResponse<JSONObject> load(String id) {
9797
Workflow workflow = workflowService.getWorkflow(id);
98-
JSONObject jsonObject = JSONObject.parseObject(workflow.toJson(true));
98+
JSONObject jsonObject = JSONObject.parseObject(workflow.toJson());
9999
return SingleResponse.of(jsonObject);
100100
}
101101

flow-engine-starter-infra/src/main/java/com/codingapi/flow/infra/convert/WorkflowConvertor.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ public static WorkflowEntity convert(Workflow workflow){
2929
entity.setForm(formMetaConvertor.convertToDatabaseColumn(workflow.getForm()));
3030
entity.setOperatorCreateScript(operatorMatchScriptConvertor.convertToDatabaseColumn(workflow.getOperatorCreateScript()));
3131
entity.setNodes(flowNodeListConvertor.convertToDatabaseColumn(workflow.getNodes()));
32-
entity.setSchema(workflow.getSchema());
3332
entity.setStrategies(workflowStrategyListConvertor.convertToDatabaseColumn(workflow.getStrategies()));
3433
entity.setEnable(workflow.isEnable());
3534
return entity;
@@ -48,7 +47,6 @@ public static Workflow convert(WorkflowEntity entity){
4847
formMetaConvertor.convertToEntityAttribute(entity.getForm()),
4948
operatorMatchScriptConvertor.convertToEntityAttribute(entity.getOperatorCreateScript()),
5049
flowNodeListConvertor.convertToEntityAttribute(entity.getNodes()),
51-
entity.getSchema(),
5250
workflowStrategyListConvertor.convertToEntityAttribute(entity.getStrategies()),
5351
entity.getEnable());
5452
}

flow-engine-starter-infra/src/main/java/com/codingapi/flow/infra/convert/WorkflowVersionConvertor.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ public static WorkflowVersionEntity convert(WorkflowVersion workflowVersion){
3434
entity.setForm(formMetaConvertor.convertToDatabaseColumn(workflowVersion.getForm()));
3535
entity.setOperatorCreateScript(operatorMatchScriptConvertor.convertToDatabaseColumn(workflowVersion.getOperatorCreateScript()));
3636
entity.setNodes(flowNodeListConvertor.convertToDatabaseColumn(workflowVersion.getNodes()));
37-
entity.setSchema(workflowVersion.getSchema());
3837
entity.setStrategies(workflowStrategyListConvertor.convertToDatabaseColumn(workflowVersion.getStrategies()));
3938
entity.setEnable(workflowVersion.isEnable());
4039
return entity;
@@ -57,7 +56,6 @@ public static WorkflowVersion convert(WorkflowVersionEntity entity){
5756
formMetaConvertor.convertToEntityAttribute(entity.getForm()),
5857
operatorMatchScriptConvertor.convertToEntityAttribute(entity.getOperatorCreateScript()),
5958
flowNodeListConvertor.convertToEntityAttribute(entity.getNodes()),
60-
entity.getSchema(),
6159
workflowStrategyListConvertor.convertToEntityAttribute(entity.getStrategies()),
6260
entity.getEnable());
6361
}

flow-engine-starter-infra/src/main/java/com/codingapi/flow/infra/entity/WorkflowEntity.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,6 @@ public class WorkflowEntity {
5959
@Lob
6060
private String nodes;
6161

62-
/**
63-
* 流程设计
64-
*/
65-
@Lob
66-
@Column(name = "schema_meta")
67-
private String schema;
68-
6962
/**
7063
* 流程策略
7164
*/

flow-engine-starter-infra/src/main/java/com/codingapi/flow/infra/entity/WorkflowVersionEntity.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,6 @@ public class WorkflowVersionEntity {
7272
@Lob
7373
private String nodes;
7474

75-
/**
76-
* 流程设计
77-
*/
78-
@Lob
79-
@Column(name = "schema_meta")
80-
private String schema;
81-
8275
/**
8376
* 流程策略
8477
*/

0 commit comments

Comments
 (0)