As we all know, NodeJS, as a back-end development language and operating environment, is good in everything but one NodeJS工作流引擎
. CabloyJS 4.0 has been developed with emphasis NodeJS工作流引擎
, and as a built-in basic core module, it has further expanded the application scenarios of NodeJS in the back-end, providing basic support for the in-depth research and development of various business business logics
JSON
for process definition, bid farewell to the redundancy of XML configuration filesModule name | Description |
---|---|
a-flow | Process definition, process instance |
a-flownode | Process node (active node) |
a-flowtask | Process task |
业务流程
and审批流程
Atom三生三世
combined, built a set of Atom-based 审批工作流
. See: Atomic Phase (Sansheng III) 表单验证
combination of support nodes are arranged in different processes 读取字段权限
and 修改字段权限
. See: form validationAOP
Workflow logic can be customized by mechanismListener
Workflow logic can be customized by mechanism流程节点
customized development测试驱动
code, you can quickly get started using workflow采购订单
流程定义
, then submit it, and enter the draft into the corresponding审批流程
归档
src/module/test-flow/backend/src/config/static/flowDef/set00_simple.js
{ listener: null, process: { nodes: [ { id:'startEvent_1', name:'Start', type:'startEventNone', }, { id:'endEvent_1', name:'End', type:'endEventNone', }, ], edges: [ { id:'edge_1', source:'startEvent_1', target:'endEvent_1', }, ], }, }
name | Description |
---|---|
listener | Listener, which can monitor various events of flow/node/task |
process.nodes | Process node |
process.nodes.type | Process node type |
process.edges | Process transfer line |
process.edges.source | source |
process.edges.target | Whereabouts |
src/module/test-flow/backend/src/config/static/flowDef/set01_atomUserTask.js
{ listener: null, process: { nodes: [ { id:'startEvent_1', name:'Drafting', type:'startEventAtom', options: { atom: { module: moduleInfo.relativeName, atomClassName:'purchaseOrder', }, conditionExpression:'atom._flowDefKey===\'set01_atomUserTask\'', }, }, { id:'activity_1', name:'Review', type:'activityUserTask', options: { assignees: { //users: '1,2', //roles: '1,2', vars:'flowUser', }, confirmation: false, bidding: false, completionCondition: { //passed: 1, //rejected: '100%', }, //rejectedNode:null, //allowRejectTask: true, //allowCancelFlow: false, schema: { write: [ 'atomName', { name:'description', property: { type:'string', ebType:'text', ebTitle:'Description', }, }, ], }, }, }, { id:'endEvent_1', name:'End', type:'endEventNone', }, ], edges: [ { id:'edge_1', source:'startEvent_1', target:'activity_1', }, { id:'edge_2', source:'activity_1', target:'endEvent_1', }, ], }, }
name | Description |
---|---|
startEventAtom |
|
activityUserTask |
|
endEventNone |
|