GithubHelp home page GithubHelp logo

go-workflow-ui's Introduction

Apache example


Go-Workflow

go-workflow 是一个超轻量级的工作流引擎,基本架构同Activiti工作流有些相似,但是它更精简,更轻量,它是一个工作流微服务,具体案例详见:example.md

前端流程生成工具:https://github.com/go-workflow/go-workflow-UI

一、特点:

1.它是一个工作流微服务

2.将所有的无关流程的数据,包括用户、用户组等信息从服务中解耦出去,go-workflow只纪录流程的流转

3.使用json数组替代bpmn来生成流程定义,简化流程定义的生成

二、go-workflow框架

1.go-workflow 数据库设计

1.1 流程定义表

表 procdef 用于保存流程的配置, 主要字段有:

 name: 流程定义的名称,如:"请假流程"
 
 version: 流程定义的版本

 resource: 保存流程定义的具体配置,它是一个json格式的字符串

 company: 保存该流程创建人所在公司

1.2 流程实例表

表 proc_inst 用于保存流程实例,当用户启动一个流程时,就会在这个表存入一个流程实例,

主要字段有:

procDefID: 对应表procdef的id,

title: 标题,如:"张三的请假流程"

department: 用户所在部门

nodeID: 当前所处于节点的名称

candidate: 当前审批人或者审批用户组

taskID: 当前任务id

1.3 执行流表

表 execution 用于保存执行流,当用户启动一个流程时,就会生成一条执行流,之后的流程就会按照执行流的顺序流转,

比如:开始-主管审批-财务审批-人事审批-结束 ,

主要的字段有:

procInstID: 流程实例id,对应表proc_inst

procDefID: 流程定义id,对应表procdef

nodeInfos: 是一个json数组,纪录流程实例会经过的所有节点

1.4 关系表

表 identitylink 用于保存任务task的候选用户组或者候选用户以及用户所参与的流程信息,

主要字段有

type: 表示关系类型,有:"candidate"和"participant"两种

group: 表示当前审批的用户组

userID: 表示当前审批的用户

taskID: 对应任务task表的id

step: 表示任务对应的执行流位置,比如:有一个执行流:开始-主管审批-财务审批-人事审批-结束,那么
step=0,则处于【开始】位置,step=1则处于【主管审批】位置

company: 表示公司

procInstID: 对应流程实例id

1.5 任务表

表 task 用于保存任务,

主要字段有:

nodeID: 表示节点,如:"主管审批"结点

step: 表示任务对应的执行流位置

assignee: 任务的处理人

memberCount: 表示当前任务需要多少人审批之后才能结束,默认是 1

unCompleteNum: 表示还有多少人没有审批,默认是1

agreeNum: 表示通过的人数

actType: 表示任务类型 "or"表示或签,即一个人通过或者驳回就结束,"and"表示会签,要所有人通过就流
转到下一步,如果有一个人驳回那么就跳转到上一步

1.6 历史数据表

历史数据表包括 execution_history,identitylink_history,proc_inst_history,task_history这些表字段同正常的表相同,每隔20秒,将已经结束的流程数据会自动迁移过来

2 流程的存储

2.1 添加流程资源

启动 go-workflow 微服务后,可以在浏览器中输入:http://localhost:8080/workflow/procdef/save 进行存储

具体见 example.md 说明文档

3.流程的启动

通过调用 StartProcessInstanceByID 方法来启动流程实例,

主要涉及:

获取流程定义

GetResourceByNameAndCompany()->启动流程实例CreateProcInstTx()->生成执行流GenerateExec() -> 生成新任务NewTaskTx() -> 流程流转 MoveStage()

4.任务审批

调用方法 Complete()方法来执行任务的审批, 涉及方法:

更新任务 UpdateTaskWhenComplete()-> 流转MoveStageByProcInstID()

调用方法 WithDrawTask() 方法来执行任务的撤回

go-workflow-ui's People

Contributors

dependabot[bot] avatar mumushuiding avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

go-workflow-ui's Issues

添加条件分支后再选择审批人报错。

1581918430462

选择一个分支条件,再点击审批人报错:Error in v-on handler: "TypeError: Cannot read property 'prevId' of undefined",
不懂前端,麻烦帮忙看看。
我是下载源码后,修改entry为main.js,npm i,npm run serve这样启动运行的。没看懂前面那三个步骤

新增节点、移除节点,多执行几次,会出现数据错乱。

原因是process.js里面的iteratorData方法有问题 应该直接去掉这段代码
if (temp.type === 'route') { resultArr.push(temp) } else { var item = { nodeId: temp.nodeId, name: temp.name, type: temp.type, properties: temp.properties } resultArr.push(item) }
在相同的位置加入
resultArr.push(temp)

项目启动不了

Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main resolved in C:\GoDevelop\go-workflow-UI\node_modules@babel\helper-compilation-targets\package.json
at applyExports (internal/modules/cjs/loader.js:490:9)
at resolveExports (internal/modules/cjs/loader.js:506:23)
at Function.Module._findPath (internal/modules/cjs/loader.js:634:31)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:952:27)
at Function.Module._load (internal/modules/cjs/loader.js:841:27)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object. (C:\GoDevelop\go-workflow-UI\node_modules@babel\preset-env\lib\debug.js:8:33)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object. (C:\GoDevelop\go-workflow-UI\node_modules@babel\preset-env\lib\index.js:11:14)
at Module._compile (internal/modules/cjs/loader.js:1137:30)

@ multi (webpack)-dev-server/client?http://192.168.1.103:8081/sockjs-node (webpack)/hot/dev-server.js ./src/index.js

您好 我clone了您的项目 npm run serve 无法启动

项目无法build

Use // eslint-disable-next-line to ignore the next line.
Use /* eslint-disable */ to ignore all warnings in a file.
⠸ Building for production as library (commonjs,umd,umd-min)...

ERROR Failed to compile with 1 error 下午2:22:38

error in ./src/components/Generator/Main.vue

Module Error (from ./node_modules/eslint-loader/index.js):

/home/dx/frotent/go-workflow-UI-master/src/components/Generator/Main.vue
134:5 error Unexpected console statement no-console

✖ 1 problem (1 error, 0 warnings)

@ ./src/components/Generator/index.js 1:0-31 3:0-27 4:15-24
@ ./src/components/index.js
@ ./src/index.js
@ ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js

ERROR Build failed with errors.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: vue-cli-service build --target lib --dest lib ./src/index.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/dx/.npm/_logs/2021-07-12T06_22_38_121Z-debug.log

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.