diff --git a/backend/README.md b/backend/README.md index 276958cd..f5bad918 100644 --- a/backend/README.md +++ b/backend/README.md @@ -910,4 +910,130 @@ workflow_log(工作流日志表) 提供了更丰富的元数据和状态信息 支持更细粒度的日志记录 可以存储自定义的业务数据 -这样的设计让我们可以在使用Flowable强大的工作流引擎的同时,也能满足特定的业务需求。 \ No newline at end of file +这样的设计让我们可以在使用Flowable强大的工作流引擎的同时,也能满足特定的业务需求。 + + +{ + "name": "Simple Shell Workflow6", + "key": "simple_shell_workflow", + "description": "A simple workflow with shell task", + "graphJson": { + "cells": [ + { + "id": "start", + "shape": "start", + "data": { + "label": "开始" + }, + "position": { + "x": 100, + "y": 100 + } + }, + { + "id": "shell", + "shape": "serviceTask", + "data": { + "label": "Shell脚本", + "serviceTask": { + "type": "shell", + "implementation": "${shellTaskDelegate}", + "fields": { + "script": "timeout 10000000", + "workDir": "/tmp", + "env": { + "TEST_VAR": "test_value" + } + } + } + }, + "position": { + "x": 300, + "y": 100 + } + }, + { + "id": "shellErrorBoundary", + "shape": "boundaryEvent", + "data": { + "label": "Shell错误", + "boundaryEvent": { + "type": "error", + "attachedToRef": "shell", + "errorRef": "SHELL_EXECUTION_ERROR" + } + }, + "position": { + "x": 300, + "y": 160 + } + }, + { + "id": "errorHandler", + "shape": "serviceTask", + "data": { + "label": "错误处理", + "serviceTask": { + "type": "service", + "implementation": "${errorHandlerDelegate}" + } + }, + "position": { + "x": 300, + "y": 220 + } + }, + { + "id": "end", + "shape": "end", + "data": { + "label": "结束" + }, + "position": { + "x": 500, + "y": 100 + } + }, + { + "id": "flow1", + "shape": "edge", + "source": "start", + "target": "shell", + "data": { + "label": "流转到Shell" + } + }, + { + "id": "flow2", + "shape": "edge", + "source": "shell", + "target": "end", + "data": { + "label": "完成" + } + }, + { + "id": "flow_error", + "shape": "edge", + "source": "shellErrorBoundary", + "target": "errorHandler", + "data": { + "label": "错误处理" + } + }, + { + "id": "flow_error_end", + "shape": "edge", + "source": "errorHandler", + "target": "end", + "data": { + "label": "处理完成" + } + } + ] + } +} + +死信队列的问题: +需要再异常里直接移除: +runtimeService.deleteProcessInstance(processInstanceId, errorMessage); \ No newline at end of file diff --git a/backend/pom.xml b/backend/pom.xml index 28ff6804..ac48ac2c 100644 --- a/backend/pom.xml +++ b/backend/pom.xml @@ -70,7 +70,7 @@ mysql-connector-j runtime - + com.vladmihalcea @@ -220,6 +220,11 @@ flowable-bpmn-layout ${flowable.version} + + + + + diff --git a/backend/src/main/java/com/qqchen/deploy/backend/workflow/config/FlowableConfig.java b/backend/src/main/java/com/qqchen/deploy/backend/workflow/config/FlowableConfig.java index 3e869b5d..eb6f1f39 100644 --- a/backend/src/main/java/com/qqchen/deploy/backend/workflow/config/FlowableConfig.java +++ b/backend/src/main/java/com/qqchen/deploy/backend/workflow/config/FlowableConfig.java @@ -16,5 +16,25 @@ public class FlowableConfig implements EngineConfigurationConfigurer