diff --git a/backend/src/main/java/com/qqchen/deploy/backend/workflow/dto/WorkflowNodeDefinitionDTO.java b/backend/src/main/java/com/qqchen/deploy/backend/workflow/dto/WorkflowNodeDefinitionDTO.java index da07193b..887b184a 100644 --- a/backend/src/main/java/com/qqchen/deploy/backend/workflow/dto/WorkflowNodeDefinitionDTO.java +++ b/backend/src/main/java/com/qqchen/deploy/backend/workflow/dto/WorkflowNodeDefinitionDTO.java @@ -33,9 +33,6 @@ public class WorkflowNodeDefinitionDTO extends BaseDTO { @Schema(description = "X6图形配置JSON") private JsonNode graphConfig; - @Schema(description = "表单配置JSON") - private JsonNode formConfig; - @Schema(description = "排序号") private Integer orderNum; diff --git a/backend/src/main/java/com/qqchen/deploy/backend/workflow/dto/graph/WorkflowDefinitionNode.java b/backend/src/main/java/com/qqchen/deploy/backend/workflow/dto/graph/WorkflowDefinitionNode.java index f639d8ce..eec42d25 100644 --- a/backend/src/main/java/com/qqchen/deploy/backend/workflow/dto/graph/WorkflowDefinitionNode.java +++ b/backend/src/main/java/com/qqchen/deploy/backend/workflow/dto/graph/WorkflowDefinitionNode.java @@ -18,6 +18,12 @@ public class WorkflowDefinitionNode { */ private String id; + + /** + * 节点Code + */ + private String code; + /** * 节点类型 */ diff --git a/backend/src/main/java/com/qqchen/deploy/backend/workflow/dto/graph/WorkflowNodeGraph.java b/backend/src/main/java/com/qqchen/deploy/backend/workflow/dto/graph/WorkflowNodeGraph.java index ddf8c0a8..7481bd9a 100644 --- a/backend/src/main/java/com/qqchen/deploy/backend/workflow/dto/graph/WorkflowNodeGraph.java +++ b/backend/src/main/java/com/qqchen/deploy/backend/workflow/dto/graph/WorkflowNodeGraph.java @@ -67,6 +67,10 @@ public class WorkflowNodeGraph { private int height; + public Size() { + // 默认构造函数 + } + public Size(int width, int height) { this.width = width; this.height = height; @@ -88,6 +92,10 @@ public class WorkflowNodeGraph { private int strokeWidth = 2;// 边框宽度 + public Style() { + // 默认构造函数 + } + public Style(String fill, String stroke, String icon) { this.fill = fill; this.stroke = stroke; @@ -103,6 +111,11 @@ public class WorkflowNodeGraph { public static class Ports { private Map groups; + public Ports() { + // 默认构造函数 + this.groups = new HashMap<>(); + } + /** * 获取端口类型列表 * @return 端口类型列表("in"/"out") @@ -119,11 +132,19 @@ public class WorkflowNodeGraph { public static class PortGroup { private String position; private PortAttrs attrs; + + public PortGroup() { + // 默认构造函数 + } } @Data public static class PortAttrs { private PortCircle circle; + + public PortAttrs() { + // 默认构造函数 + } } @Data @@ -131,5 +152,9 @@ public class WorkflowNodeGraph { private int r; private String fill; private String stroke; + + public PortCircle() { + // 默认构造函数 + } } } diff --git a/backend/src/main/java/com/qqchen/deploy/backend/workflow/entity/WorkflowNodeDefinition.java b/backend/src/main/java/com/qqchen/deploy/backend/workflow/entity/WorkflowNodeDefinition.java index 50a6d141..85b679b3 100644 --- a/backend/src/main/java/com/qqchen/deploy/backend/workflow/entity/WorkflowNodeDefinition.java +++ b/backend/src/main/java/com/qqchen/deploy/backend/workflow/entity/WorkflowNodeDefinition.java @@ -77,18 +77,6 @@ public class WorkflowNodeDefinition extends Entity { @Column(columnDefinition = "text", nullable = false) private JsonNode graphConfig; - /** - * 表单配置 JSON - * 定义节点的可配置属性,用于前端动态渲染表单 - * 包含: - * - 基础属性(名称、描述等) - * - 业务属性(具体节点类型的特定属性) - * - 表单验证规则 - */ - @Type(JsonType.class) - @Column(columnDefinition = "text") - private JsonNode formConfig; - /** * 排序号 */ diff --git a/backend/src/main/java/com/qqchen/deploy/backend/workflow/util/WorkflowDefinitionGraph.java b/backend/src/main/java/com/qqchen/deploy/backend/workflow/util/WorkflowDefinitionGraph.java index 81f98ac7..ddbd1306 100644 --- a/backend/src/main/java/com/qqchen/deploy/backend/workflow/util/WorkflowDefinitionGraph.java +++ b/backend/src/main/java/com/qqchen/deploy/backend/workflow/util/WorkflowDefinitionGraph.java @@ -309,6 +309,7 @@ public class WorkflowDefinitionGraph { private static WorkflowDefinitionNode createNode(String id, NodeTypeEnums type, String name, int x, int y, Map config) { WorkflowDefinitionNode node = new WorkflowDefinitionNode(); node.setId(id); + node.setCode(type.getCode()); // 直接使用枚举的code node.setType(type); node.setName(name); node.setConfig(config); diff --git a/backend/src/main/resources/db/migration/V1.0.1__init_data.sql b/backend/src/main/resources/db/migration/V1.0.1__init_data.sql index e542d678..ee47442c 100644 --- a/backend/src/main/resources/db/migration/V1.0.1__init_data.sql +++ b/backend/src/main/resources/db/migration/V1.0.1__init_data.sql @@ -155,55 +155,60 @@ INSERT INTO sys_external_system ( -- -------------------------------------------------------------------------------------- -- 初始化工作流相关数据 -- -------------------------------------------------------------------------------------- - -- 工作流定义测试数据 INSERT INTO workflow_definition ( + -- 基础信息 name, `key`, flow_version, description, category, - bpmn_xml, graph, form_config, tags, + -- 流程配置 + graph, form_config, tags, + -- 流程属性 status, is_executable, target_namespace, + -- 审计字段 created_at, updated_at, created_by, updated_by, is_deleted ) VALUES --- 简单流程:开始 -> 服务任务 -> 结束 +-- 简单脚本流程:开始 -> 脚本任务 -> 结束 ( - '简单服务任务流程', 'simple_service_flow', 1, '一个包含服务任务的简单流程', 'test', - '', - '{"nodes":[{"id":"startEvent1","type":"startEvent","name":"开始","position":{"x":100,"y":100},"config":{"type":"startEvent"},"properties":{},"size":{"width":40,"height":40}},{"id":"service1","type":"serviceTask","name":"服务任务","position":{"x":300,"y":100},"config":{"type":"serviceTask","implementation":"shell","fields":{"script":{"string":"echo \\"Hello World\\""}}},"properties":{},"size":{"width":100,"height":60}},{"id":"endEvent1","type":"endEvent","name":"结束","position":{"x":500,"y":100},"config":{"type":"endEvent"},"properties":{},"size":{"width":40,"height":40}}],"edges":[{"id":"flow1","source":"startEvent1","target":"service1","name":"","config":{"type":"sequenceFlow"},"properties":{}},{"id":"flow2","source":"service1","target":"endEvent1","name":"","config":{"type":"sequenceFlow"},"properties":{}}],"properties":{}}', + '简单脚本流程', 'simple_script_flow', 1, '一个包含脚本任务的简单流程', 'test', + '{ + "nodes": [{"id":"startEvent1","code":"START_EVENT","type":"START_EVENT","name":"开始","graph":{"shape":"circle","size":{"width":40,"height":40},"style":{"fill":"#e8f7ff","stroke":"#1890ff","icon":"play-circle","iconColor":"#1890ff","strokeWidth":2},"ports":{"groups":{"out":{"position":"right","attrs":{"circle":{"r":4,"fill":"#ffffff","stroke":"#1890ff"}}}},"types":["out"]}},"config":{"name":"开始节点","description":"启动流程"}},{"id":"scriptTask1","code":"SCRIPT_TASK","type":"SCRIPT_TASK","name":"执行脚本","graph":{"shape":"rectangle","size":{"width":120,"height":60},"style":{"fill":"#ffffff","stroke":"#1890ff","icon":"code","iconColor":"#1890ff","strokeWidth":2},"ports":{"groups":{"in":{"position":"left","attrs":{"circle":{"r":4,"fill":"#ffffff","stroke":"#1890ff"}}},"out":{"position":"right","attrs":{"circle":{"r":4,"fill":"#ffffff","stroke":"#1890ff"}}}},"types":["in","out"]}},"config":{"name":"脚本任务","description":"执行一个简单的Shell脚本","language":"shell","script":"echo ''Hello World''"}},{"id":"endEvent1","code":"END_EVENT","type":"END_EVENT","name":"结束","graph":{"shape":"circle","size":{"width":40,"height":40},"style":{"fill":"#fff1f0","stroke":"#ff4d4f","icon":"stop","iconColor":"#ff4d4f","strokeWidth":2},"ports":{"groups":{"in":{"position":"left","attrs":{"circle":{"r":4,"fill":"#ffffff","stroke":"#1890ff"}}}},"types":["in"]}},"config":{"name":"结束节点","description":"流程结束"}}],"edges":[{"id":"flow1","from":"startEvent1","to":"scriptTask1","name":"开始到脚本","config":{"type":"sequence"},"properties":null},{"id":"flow2","from":"scriptTask1","to":"endEvent1","name":"脚本到结束","config":{"type":"sequence"},"properties":null}]}', '{"formItems":[]}', - '["simple","test","service"]', - 'PUBLISHED', TRUE, 'http://www.flowable.org/test', + '["simple","script","test"]', + 'DRAFT', TRUE, 'http://www.flowable.org/test', NOW(), NOW(), 1, 1, FALSE ), --- 用户任务流程:开始 -> 用户任务 -> 结束 -( - '用户审批流程', 'user_approval_flow', 1, '一个简单的用户审批流程', 'approval', - '', - '{"nodes":[{"id":"startEvent1","type":"startEvent","name":"开始","position":{"x":100,"y":100},"config":{"type":"startEvent"},"properties":{},"size":{"width":40,"height":40}},{"id":"user1","type":"userTask","name":"审批任务","position":{"x":300,"y":100},"config":{"type":"userTask","assignee":"user1"},"properties":{},"size":{"width":100,"height":60}},{"id":"endEvent1","type":"endEvent","name":"结束","position":{"x":500,"y":100},"config":{"type":"endEvent"},"properties":{},"size":{"width":40,"height":40}}],"edges":[{"id":"flow1","source":"startEvent1","target":"user1","name":"提交审批","config":{"type":"sequenceFlow"},"properties":{}},{"id":"flow2","source":"user1","target":"endEvent1","name":"审批完成","config":{"type":"sequenceFlow"},"properties":{}}],"properties":{}}', - '{"formItems":[{"type":"input","label":"意见","name":"comment","required":true}]}', - '["approval","user-task"]', - 'PUBLISHED', TRUE, 'http://www.flowable.org/test', - NOW(), NOW(), 1, 1, FALSE -), - --- 复杂流程:开始 -> 服务任务 -> 用户任务 -> 脚本任务 -> 结束 +-- 复杂业务流程:开始 -> 服务任务 -> 用户任务 -> 脚本任务 -> 结束 ( '复杂业务流程', 'complex_business_flow', 1, '包含多种任务节点的复杂业务流程', 'business', - '', - '{"nodes":[{"id":"startEvent1","type":"startEvent","name":"开始","position":{"x":100,"y":100},"config":{"type":"startEvent"},"properties":{},"size":{"width":40,"height":40}},{"id":"service1","type":"serviceTask","name":"服务任务","position":{"x":300,"y":100},"config":{"type":"serviceTask","implementation":"com.example.ServiceTask"},"properties":{},"size":{"width":100,"height":60}},{"id":"user1","type":"userTask","name":"用户任务","position":{"x":500,"y":100},"config":{"type":"userTask","assignee":"user1"},"properties":{},"size":{"width":100,"height":60}},{"id":"script1","type":"scriptTask","name":"脚本任务","position":{"x":700,"y":100},"config":{"type":"scriptTask","scriptFormat":"groovy","script":"println \\"Hello\\""},"properties":{},"size":{"width":100,"height":60}},{"id":"endEvent1","type":"endEvent","name":"结束","position":{"x":900,"y":100},"config":{"type":"endEvent"},"properties":{},"size":{"width":40,"height":40}}],"edges":[{"id":"flow1","source":"startEvent1","target":"service1","name":"","config":{"type":"sequenceFlow"},"properties":{}},{"id":"flow2","source":"service1","target":"user1","name":"条件分支","config":{"type":"sequenceFlow","conditionExpression":"$${condition}"},"properties":{}},{"id":"flow3","source":"user1","target":"script1","name":"","config":{"type":"sequenceFlow"},"properties":{}},{"id":"flow4","source":"script1","target":"endEvent1","name":"","config":{"type":"sequenceFlow"},"properties":{}}],"properties":{}}', - '{"formItems":[{"type":"input","label":"业务参数","name":"businessParam","required":true},{"type":"select","label":"审批结果","name":"approvalResult","options":[{"label":"同意","value":"approve"},{"label":"拒绝","value":"reject"}]}]}', + '{ + "nodes": [{"id":"startEvent1","code":"START_EVENT","type":"START_EVENT","name":"开始","graph":{"shape":"circle","size":{"width":40,"height":40},"style":{"fill":"#e8f7ff","stroke":"#1890ff","icon":"play-circle","iconColor":"#1890ff","strokeWidth":2},"ports":{"groups":{"out":{"position":"right","attrs":{"circle":{"r":4,"fill":"#ffffff","stroke":"#1890ff"}}}},"types":["out"]}},"config":{"name":"开始节点","description":"启动流程"}},{"id":"serviceTask1","code":"SERVICE_TASK","type":"SERVICE_TASK","name":"调用服务","graph":{"shape":"rectangle","size":{"width":120,"height":60},"style":{"fill":"#ffffff","stroke":"#1890ff","icon":"api","iconColor":"#1890ff","strokeWidth":2},"ports":{"groups":{"in":{"position":"left","attrs":{"circle":{"r":4,"fill":"#ffffff","stroke":"#1890ff"}}},"out":{"position":"right","attrs":{"circle":{"r":4,"fill":"#ffffff","stroke":"#1890ff"}}}},"types":["in","out"]}},"config":{"method":"POST","name":"服务任务","description":"调用外部服务","url":"http://api.example.com/service"}},{"id":"userTask1","code":"USER_TASK","type":"USER_TASK","name":"人工审批","graph":{"shape":"rectangle","size":{"width":120,"height":60},"style":{"fill":"#ffffff","stroke":"#1890ff","icon":"user","iconColor":"#1890ff","strokeWidth":2},"ports":{"groups":{"in":{"position":"left","attrs":{"circle":{"r":4,"fill":"#ffffff","stroke":"#1890ff"}}},"out":{"position":"right","attrs":{"circle":{"r":4,"fill":"#ffffff","stroke":"#1890ff"}}}},"types":["in","out"]}},"config":{"name":"用户任务","description":"人工审批","assignee":"admin"}},{"id":"scriptTask1","code":"SCRIPT_TASK","type":"SCRIPT_TASK","name":"执行脚本","graph":{"shape":"rectangle","size":{"width":120,"height":60},"style":{"fill":"#ffffff","stroke":"#1890ff","icon":"code","iconColor":"#1890ff","strokeWidth":2},"ports":{"groups":{"in":{"position":"left","attrs":{"circle":{"r":4,"fill":"#ffffff","stroke":"#1890ff"}}},"out":{"position":"right","attrs":{"circle":{"r":4,"fill":"#ffffff","stroke":"#1890ff"}}}},"types":["in","out"]}},"config":{"name":"脚本任务","description":"执行脚本","language":"shell","script":"process_data.sh"}},{"id":"endEvent1","code":"END_EVENT","type":"END_EVENT","name":"结束","graph":{"shape":"circle","size":{"width":40,"height":40},"style":{"fill":"#fff1f0","stroke":"#ff4d4f","icon":"stop","iconColor":"#ff4d4f","strokeWidth":2},"ports":{"groups":{"in":{"position":"left","attrs":{"circle":{"r":4,"fill":"#ffffff","stroke":"#1890ff"}}}},"types":["in"]}},"config":{"name":"结束节点","description":"流程结束"}}],"edges":[{"id":"flow1","from":"startEvent1","to":"serviceTask1","name":"开始到服务","config":{"type":"sequence"},"properties":null},{"id":"flow2","from":"serviceTask1","to":"userTask1","name":"服务到用户","config":{"type":"sequence"},"properties":null},{"id":"flow3","from":"userTask1","to":"scriptTask1","name":"用户到脚本","config":{"type":"sequence"},"properties":null},{"id":"flow4","from":"scriptTask1","to":"endEvent1","name":"脚本到结束","config":{"type":"sequence"},"properties":null}]}', + '{"formItems":[{"type":"input","label":"业务参数","name":"businessParam","required":true}]}', '["complex","business","multi-task"]', - 'PUBLISHED', TRUE, 'http://www.flowable.org/test', + 'DRAFT', TRUE, 'http://www.flowable.org/test', + NOW(), NOW(), 1, 1, FALSE +), + +-- 网关工作流:包含排他网关和并行网关的复杂流程 +( + '网关处理流程', 'gateway_process_flow', 1, '包含排他网关和并行网关的数据处理流程', 'gateway', + '{ + "nodes": [{"id":"startEvent1","code":"START_EVENT","type":"START_EVENT","name":"开始","graph":{"shape":"circle","size":{"width":40,"height":40},"style":{"fill":"#e8f7ff","stroke":"#1890ff","icon":"play-circle","iconColor":"#1890ff","strokeWidth":2},"ports":{"groups":{"out":{"position":"right","attrs":{"circle":{"r":4,"fill":"#ffffff","stroke":"#1890ff"}}}},"types":["out"]}},"config":{"name":"开始节点","description":"启动流程"}},{"id":"serviceTask1","code":"SERVICE_TASK","type":"SERVICE_TASK","name":"获取数据","graph":{"shape":"rectangle","size":{"width":120,"height":60},"style":{"fill":"#ffffff","stroke":"#1890ff","icon":"api","iconColor":"#1890ff","strokeWidth":2},"ports":{"groups":{"in":{"position":"left","attrs":{"circle":{"r":4,"fill":"#ffffff","stroke":"#1890ff"}}},"out":{"position":"right","attrs":{"circle":{"r":4,"fill":"#ffffff","stroke":"#1890ff"}}}},"types":["in","out"]}},"config":{"method":"GET","name":"服务任务","description":"获取数据","url":"http://api.example.com/data"}},{"id":"exclusiveGateway1","code":"EXCLUSIVE_GATEWAY","type":"EXCLUSIVE_GATEWAY","name":"数据路由","graph":{"shape":"diamond","size":{"width":50,"height":50},"style":{"fill":"#fff7e6","stroke":"#faad14","icon":"fork","iconColor":"#faad14","strokeWidth":2},"ports":{"groups":{"in":{"position":"left","attrs":{"circle":{"r":4,"fill":"#ffffff","stroke":"#1890ff"}}},"out":{"position":"right","attrs":{"circle":{"r":4,"fill":"#ffffff","stroke":"#1890ff"}}}},"types":["in","out"]}},"config":{"name":"排他网关","description":"根据数据量选择处理方式"}},{"id":"userTask1","code":"USER_TASK","type":"USER_TASK","name":"人工处理","graph":{"shape":"rectangle","size":{"width":120,"height":60},"style":{"fill":"#ffffff","stroke":"#1890ff","icon":"user","iconColor":"#1890ff","strokeWidth":2},"ports":{"groups":{"in":{"position":"left","attrs":{"circle":{"r":4,"fill":"#ffffff","stroke":"#1890ff"}}},"out":{"position":"right","attrs":{"circle":{"r":4,"fill":"#ffffff","stroke":"#1890ff"}}}},"types":["in","out"]}},"config":{"name":"用户任务A","description":"人工处理","assignee":"expert"}},{"id":"userTask2","code":"USER_TASK","type":"USER_TASK","name":"快速处理","graph":{"shape":"rectangle","size":{"width":120,"height":60},"style":{"fill":"#ffffff","stroke":"#1890ff","icon":"user","iconColor":"#1890ff","strokeWidth":2},"ports":{"groups":{"in":{"position":"left","attrs":{"circle":{"r":4,"fill":"#ffffff","stroke":"#1890ff"}}},"out":{"position":"right","attrs":{"circle":{"r":4,"fill":"#ffffff","stroke":"#1890ff"}}}},"types":["in","out"]}},"config":{"name":"用户任务B","description":"快速处理","assignee":"operator"}},{"id":"parallelGateway1","code":"PARALLEL_GATEWAY","type":"PARALLEL_GATEWAY","name":"并行处理","graph":{"shape":"diamond","size":{"width":50,"height":50},"style":{"fill":"#fff7e6","stroke":"#faad14","icon":"branches","iconColor":"#faad14","strokeWidth":2},"ports":{"groups":{"in":{"position":"left","attrs":{"circle":{"r":4,"fill":"#ffffff","stroke":"#1890ff"}}},"out":{"position":"right","attrs":{"circle":{"r":4,"fill":"#ffffff","stroke":"#1890ff"}}}},"types":["in","out"]}},"config":{"name":"并行网关","description":"并行处理数据"}},{"id":"scriptTask1","code":"SCRIPT_TASK","type":"SCRIPT_TASK","name":"数据分析","graph":{"shape":"rectangle","size":{"width":120,"height":60},"style":{"fill":"#ffffff","stroke":"#1890ff","icon":"code","iconColor":"#1890ff","strokeWidth":2},"ports":{"groups":{"in":{"position":"left","attrs":{"circle":{"r":4,"fill":"#ffffff","stroke":"#1890ff"}}},"out":{"position":"right","attrs":{"circle":{"r":4,"fill":"#ffffff","stroke":"#1890ff"}}}},"types":["in","out"]}},"config":{"name":"脚本任务A","description":"数据分析","language":"python","script":"analyze_data.py"}},{"id":"scriptTask2","code":"SCRIPT_TASK","type":"SCRIPT_TASK","name":"生成报告","graph":{"shape":"rectangle","size":{"width":120,"height":60},"style":{"fill":"#ffffff","stroke":"#1890ff","icon":"code","iconColor":"#1890ff","strokeWidth":2},"ports":{"groups":{"in":{"position":"left","attrs":{"circle":{"r":4,"fill":"#ffffff","stroke":"#1890ff"}}},"out":{"position":"right","attrs":{"circle":{"r":4,"fill":"#ffffff","stroke":"#1890ff"}}}},"types":["in","out"]}},"config":{"name":"脚本任务B","description":"生成报告","language":"python","script":"generate_report.py"}},{"id":"endEvent1","code":"END_EVENT","type":"END_EVENT","name":"结束","graph":{"shape":"circle","size":{"width":40,"height":40},"style":{"fill":"#fff1f0","stroke":"#ff4d4f","icon":"stop","iconColor":"#ff4d4f","strokeWidth":2},"ports":{"groups":{"in":{"position":"left","attrs":{"circle":{"r":4,"fill":"#ffffff","stroke":"#1890ff"}}}},"types":["in"]}},"config":{"name":"结束节点","description":"流程结束"}}],"edges":[{"id":"flow1","from":"startEvent1","to":"serviceTask1","name":"开始到服务","config":{"type":"sequence"},"properties":null},{"id":"flow2","from":"serviceTask1","to":"exclusiveGateway1","name":"服务到网关","config":{"type":"sequence"},"properties":null},{"id":"flow3","from":"exclusiveGateway1","to":"userTask1","name":"大数据量处理","config":{"condition":"#{dataSize > 1000}","conditionExpression":"#{dataSize > 1000}","type":"sequence"},"properties":null},{"id":"flow4","from":"exclusiveGateway1","to":"userTask2","name":"小数据量处理","config":{"condition":"#{dataSize <= 1000}","conditionExpression":"#{dataSize <= 1000}","type":"sequence"},"properties":null},{"id":"flow5","from":"userTask1","to":"parallelGateway1","name":"处理完成","config":{"type":"sequence"},"properties":null},{"id":"flow6","from":"userTask2","to":"parallelGateway1","name":"处理完成","config":{"type":"sequence"},"properties":null},{"id":"flow7","from":"parallelGateway1","to":"scriptTask1","name":"执行分析","config":{"type":"sequence"},"properties":null},{"id":"flow8","from":"parallelGateway1","to":"scriptTask2","name":"生成报告","config":{"type":"sequence"},"properties":null},{"id":"flow9","from":"scriptTask1","to":"endEvent1","name":"分析完成","config":{"type":"sequence"},"properties":null},{"id":"flow10","from":"scriptTask2","to":"endEvent1","name":"报告完成","config":{"type":"sequence"},"properties":null}]}', + '{"formItems":[{"type":"input","label":"数据大小","name":"dataSize","required":true}]}', + '["gateway","parallel","exclusive"]', + 'DRAFT', TRUE, 'http://www.flowable.org/test', NOW(), NOW(), 1, 1, FALSE ); + -- -------------------------------------------------------------------------------------- -- 初始化工作流节点定义数据 -- -------------------------------------------------------------------------------------- - --- 事件节点 -INSERT INTO workflow_node_definition (id, create_time, type, name, description, category, graph_config, enabled) -VALUES -(1, NOW(), 'START_EVENT', '开始节点', '工作流的起点', 'EVENT', '{ +INSERT INTO workflow_node_definition (id, create_time, create_by, update_time, update_by, type, name, description, category, graph_config, enabled) +VALUES +(1, NOW(), + 'system', + NOW(), + 'system', 'START_EVENT', '开始节点', '工作流的起点', 'EVENT', '{ "code": "START_EVENT", "name": "开始节点", "description": "工作流的起点", @@ -246,9 +251,13 @@ VALUES } } } -}', 1), - -(2, NOW(), 'END_EVENT', '结束节点', '工作流的终点', 'EVENT', '{ +}', 1); +INSERT INTO workflow_node_definition (id, create_time, create_by, update_time, update_by, type, name, description, category, graph_config, enabled) +VALUES +(2, NOW(), + 'system', + NOW(), + 'system', 'END_EVENT', '结束节点', '工作流的终点', 'EVENT', '{ "code": "END_EVENT", "name": "结束节点", "description": "工作流的终点", @@ -294,9 +303,12 @@ VALUES }', 1); -- 任务节点 -INSERT INTO workflow_node_definition (id, create_time, type, name, description, category, graph_config, enabled) -VALUES -(3, NOW(), 'USER_TASK', '用户任务', '人工处理任务', 'TASK', '{ +INSERT INTO workflow_node_definition (id, create_time, create_by, update_time, update_by, type, name, description, category, graph_config, enabled) +VALUES +(3, NOW(), + 'system', + NOW(), + 'system', 'USER_TASK', '用户任务', '人工处理任务', 'TASK', '{ "code": "USER_TASK", "name": "用户任务", "description": "人工处理任务", @@ -349,9 +361,13 @@ VALUES } } } -}', 1), - -(4, NOW(), 'SERVICE_TASK', '服务任务', '系统服务调用', 'TASK', '{ +}', 1); +INSERT INTO workflow_node_definition (id, create_time, create_by, update_time, update_by, type, name, description, category, graph_config, enabled) +VALUES +(4, NOW(), + 'system', + NOW(), + 'system', 'SERVICE_TASK', '服务任务', '系统服务调用', 'TASK', '{ "code": "SERVICE_TASK", "name": "服务任务", "description": "系统服务调用", @@ -404,9 +420,13 @@ VALUES } } } -}', 1), - -(5, NOW(), 'SCRIPT_TASK', '脚本任务', '脚本执行任务', 'TASK', '{ +}', 1); +INSERT INTO workflow_node_definition (id, create_time, create_by, update_time, update_by, type, name, description, category, graph_config, enabled) +VALUES +(5, NOW(), + 'system', + NOW(), + 'system', 'SCRIPT_TASK', '脚本任务', '脚本执行任务', 'TASK', '{ "code": "SCRIPT_TASK", "name": "脚本任务", "description": "脚本执行任务", @@ -476,9 +496,12 @@ VALUES }', 1); -- 网关节点 -INSERT INTO workflow_node_definition (id, create_time, type, name, description, category, graph_config, enabled) -VALUES -(6, NOW(), 'EXCLUSIVE_GATEWAY', '排他网关', '条件分支控制', 'GATEWAY', '{ +INSERT INTO workflow_node_definition (id, create_time, create_by, update_time, update_by, type, name, description, category, graph_config, enabled) +VALUES +(6, NOW(), + 'system', + NOW(), + 'system', 'EXCLUSIVE_GATEWAY', '排他网关', '条件分支控制', 'GATEWAY', '{ "code": "EXCLUSIVE_GATEWAY", "name": "排他网关", "description": "条件分支控制", @@ -531,9 +554,13 @@ VALUES } } } -}', 1), - -(7, NOW(), 'PARALLEL_GATEWAY', '并行网关', '并行分支控制', 'GATEWAY', '{ +}', 1); +INSERT INTO workflow_node_definition (id, create_time, create_by, update_time, update_by, type, name, description, category, graph_config, enabled) +VALUES +(7, NOW(), + 'system', + NOW(), + 'system', 'PARALLEL_GATEWAY', '并行网关', '并行分支控制', 'GATEWAY', '{ "code": "PARALLEL_GATEWAY", "name": "并行网关", "description": "并行分支控制", @@ -589,9 +616,12 @@ VALUES }', 1); -- 容器节点 -INSERT INTO workflow_node_definition (id, create_time, type, name, description, category, graph_config, enabled) -VALUES -(8, NOW(), 'SUB_PROCESS', '子流程', '嵌入式子流程', 'CONTAINER', '{ +INSERT INTO workflow_node_definition (id, create_time, create_by, update_time, update_by, type, name, description, category, graph_config, enabled) +VALUES +(8, NOW(), + 'system', + NOW(), + 'system', 'SUB_PROCESS', '子流程', '嵌入式子流程', 'CONTAINER', '{ "code": "SUB_PROCESS", "name": "子流程", "description": "嵌入式子流程", @@ -644,9 +674,14 @@ VALUES } } } -}', 1), - -(9, NOW(), 'CALL_ACTIVITY', '调用活动', '外部流程调用', 'CONTAINER', '{ +}', 1); +-- 容器节点 +INSERT INTO workflow_node_definition (id, create_time, create_by, update_time, update_by, type, name, description, category, graph_config, enabled) +VALUES +(9, NOW(), + 'system', + NOW(), + 'system', 'CALL_ACTIVITY', '调用活动', '外部流程调用', 'CONTAINER', '{ "code": "CALL_ACTIVITY", "name": "调用活动", "description": "外部流程调用",