@nocobase/plugin-workflow 0.7.0-alpha.4 → 0.7.0-alpha.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/actions/index.d.ts +3 -1
- package/lib/actions/index.js +33 -26
- package/{esm/actions/flow_nodes.d.ts → lib/actions/nodes.d.ts} +1 -0
- package/lib/actions/nodes.js +321 -0
- package/lib/actions/workflows.d.ts +3 -0
- package/lib/actions/workflows.js +271 -0
- package/lib/calculators/index.js +143 -91
- package/lib/collections/executions.js +40 -38
- package/lib/collections/flow_nodes.js +60 -72
- package/lib/collections/jobs.js +45 -47
- package/lib/collections/workflows.js +78 -63
- package/lib/constants.js +22 -17
- package/lib/index.js +71 -22
- package/lib/instructions/calculation.js +34 -29
- package/lib/instructions/condition.js +94 -87
- package/lib/instructions/create.d.ts +1 -1
- package/lib/instructions/create.js +43 -25
- package/lib/instructions/destroy.js +42 -25
- package/lib/instructions/index.js +46 -25
- package/lib/instructions/parallel.js +99 -84
- package/lib/instructions/prompt.js +21 -13
- package/lib/instructions/query.js +46 -25
- package/lib/instructions/update.d.ts +2 -1
- package/lib/instructions/update.js +44 -25
- package/lib/models/Execution.d.ts +3 -2
- package/lib/models/Execution.js +400 -241
- package/lib/models/FlowNode.js +18 -5
- package/lib/models/Job.js +18 -5
- package/lib/models/Workflow.d.ts +4 -5
- package/lib/models/Workflow.js +95 -72
- package/lib/server.d.ts +7 -2
- package/lib/server.js +114 -65
- package/lib/triggers/collection.d.ts +16 -0
- package/lib/triggers/collection.js +162 -0
- package/lib/triggers/index.d.ts +3 -6
- package/lib/triggers/index.js +14 -11
- package/package.json +7 -12
- package/esm/actions/flow_nodes.js +0 -139
- package/esm/actions/flow_nodes.js.map +0 -1
- package/esm/actions/index.d.ts +0 -1
- package/esm/actions/index.js +0 -8
- package/esm/actions/index.js.map +0 -1
- package/esm/calculators/index.d.ts +0 -38
- package/esm/calculators/index.js +0 -128
- package/esm/calculators/index.js.map +0 -1
- package/esm/collections/executions.d.ts +0 -3
- package/esm/collections/executions.js +0 -38
- package/esm/collections/executions.js.map +0 -1
- package/esm/collections/flow_nodes.d.ts +0 -3
- package/esm/collections/flow_nodes.js +0 -72
- package/esm/collections/flow_nodes.js.map +0 -1
- package/esm/collections/jobs.d.ts +0 -3
- package/esm/collections/jobs.js +0 -47
- package/esm/collections/jobs.js.map +0 -1
- package/esm/collections/workflows.d.ts +0 -3
- package/esm/collections/workflows.js +0 -63
- package/esm/collections/workflows.js.map +0 -1
- package/esm/constants.d.ts +0 -17
- package/esm/constants.js +0 -18
- package/esm/constants.js.map +0 -1
- package/esm/index.d.ts +0 -5
- package/esm/index.js +0 -6
- package/esm/index.js.map +0 -1
- package/esm/instructions/calculation.d.ts +0 -8
- package/esm/instructions/calculation.js +0 -55
- package/esm/instructions/calculation.js.map +0 -1
- package/esm/instructions/condition.d.ts +0 -5
- package/esm/instructions/condition.js +0 -99
- package/esm/instructions/condition.js.map +0 -1
- package/esm/instructions/create.d.ts +0 -8
- package/esm/instructions/create.js +0 -25
- package/esm/instructions/create.js.map +0 -1
- package/esm/instructions/destroy.d.ts +0 -8
- package/esm/instructions/destroy.js +0 -25
- package/esm/instructions/destroy.js.map +0 -1
- package/esm/instructions/index.d.ts +0 -15
- package/esm/instructions/index.js +0 -20
- package/esm/instructions/index.js.map +0 -1
- package/esm/instructions/parallel.d.ts +0 -13
- package/esm/instructions/parallel.js +0 -88
- package/esm/instructions/parallel.js.map +0 -1
- package/esm/instructions/prompt.d.ts +0 -7
- package/esm/instructions/prompt.js +0 -13
- package/esm/instructions/prompt.js.map +0 -1
- package/esm/instructions/query.d.ts +0 -8
- package/esm/instructions/query.js +0 -25
- package/esm/instructions/query.js.map +0 -1
- package/esm/instructions/update.d.ts +0 -8
- package/esm/instructions/update.js +0 -25
- package/esm/instructions/update.js.map +0 -1
- package/esm/models/Execution.d.ts +0 -50
- package/esm/models/Execution.js +0 -250
- package/esm/models/Execution.js.map +0 -1
- package/esm/models/FlowNode.d.ts +0 -17
- package/esm/models/FlowNode.js +0 -4
- package/esm/models/FlowNode.js.map +0 -1
- package/esm/models/Job.d.ts +0 -15
- package/esm/models/Job.js +0 -4
- package/esm/models/Job.js.map +0 -1
- package/esm/models/Workflow.d.ts +0 -27
- package/esm/models/Workflow.js +0 -72
- package/esm/models/Workflow.js.map +0 -1
- package/esm/server.d.ts +0 -5
- package/esm/server.js +0 -62
- package/esm/server.js.map +0 -1
- package/esm/triggers/index.d.ts +0 -9
- package/esm/triggers/index.js +0 -6
- package/esm/triggers/index.js.map +0 -1
- package/esm/triggers/model.d.ts +0 -12
- package/esm/triggers/model.js +0 -47
- package/esm/triggers/model.js.map +0 -1
- package/lib/actions/flow_nodes.d.ts +0 -3
- package/lib/actions/flow_nodes.js +0 -163
- package/lib/actions/flow_nodes.js.map +0 -1
- package/lib/actions/index.js.map +0 -1
- package/lib/calculators/index.js.map +0 -1
- package/lib/collections/executions.js.map +0 -1
- package/lib/collections/flow_nodes.js.map +0 -1
- package/lib/collections/jobs.js.map +0 -1
- package/lib/collections/workflows.js.map +0 -1
- package/lib/constants.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/instructions/calculation.js.map +0 -1
- package/lib/instructions/condition.js.map +0 -1
- package/lib/instructions/create.js.map +0 -1
- package/lib/instructions/destroy.js.map +0 -1
- package/lib/instructions/index.js.map +0 -1
- package/lib/instructions/parallel.js.map +0 -1
- package/lib/instructions/prompt.js.map +0 -1
- package/lib/instructions/query.js.map +0 -1
- package/lib/instructions/update.js.map +0 -1
- package/lib/models/Execution.js.map +0 -1
- package/lib/models/FlowNode.js.map +0 -1
- package/lib/models/Job.js.map +0 -1
- package/lib/models/Workflow.js.map +0 -1
- package/lib/server.js.map +0 -1
- package/lib/triggers/index.js.map +0 -1
- package/lib/triggers/model.d.ts +0 -12
- package/lib/triggers/model.js +0 -49
- package/lib/triggers/model.js.map +0 -1
- package/tsconfig.build.json +0 -9
package/lib/calculators/index.js
CHANGED
|
@@ -1,132 +1,184 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
exports.
|
|
7
|
-
exports.default = exports.calculators;
|
|
8
|
-
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.calculate = calculate;
|
|
7
|
+
exports.default = exports.calculators = void 0;
|
|
8
|
+
|
|
9
|
+
function _lodash() {
|
|
10
|
+
const data = require("lodash");
|
|
11
|
+
|
|
12
|
+
_lodash = function _lodash() {
|
|
13
|
+
return data;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
return data;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function _utils() {
|
|
20
|
+
const data = require("@nocobase/utils");
|
|
21
|
+
|
|
22
|
+
_utils = function _utils() {
|
|
23
|
+
return data;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
return data;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const calculators = new (_utils().Registry)();
|
|
30
|
+
exports.calculators = calculators;
|
|
31
|
+
var _default = calculators; // @deprecated
|
|
9
32
|
// HACK: if no path provided, return self
|
|
10
33
|
// @see https://github.com/lodash/lodash/pull/1270
|
|
11
34
|
// TODO(question): should add default value as lodash?
|
|
35
|
+
|
|
36
|
+
exports.default = _default;
|
|
37
|
+
|
|
12
38
|
function get(object, path) {
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
// NOTE:
|
|
39
|
+
return path == null || !path.length ? object : (0, _lodash().get)(object, path);
|
|
40
|
+
} // NOTE:
|
|
16
41
|
// this method could only be used in executing nodes.
|
|
17
42
|
// because type of 'job' need loaded jobs in runtime execution.
|
|
18
43
|
// or the execution should be prepared first.
|
|
44
|
+
|
|
45
|
+
|
|
19
46
|
function calculate(operand, lastJob, execution) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
switch (operand.type) {
|
|
48
|
+
// @Deprecated
|
|
49
|
+
// from execution context
|
|
50
|
+
case '$context':
|
|
51
|
+
return get(execution.context, operand.options.path);
|
|
52
|
+
// @Deprecated
|
|
53
|
+
// from last job (or input job)
|
|
54
|
+
|
|
55
|
+
case '$input':
|
|
56
|
+
return lastJob !== null && lastJob !== void 0 ? lastJob : get(lastJob.result, operand.options.path);
|
|
57
|
+
// @Deprecated
|
|
58
|
+
// from job in execution
|
|
59
|
+
|
|
60
|
+
case '$jobsMapByNodeId':
|
|
61
|
+
// assume jobs have been fetched from execution before
|
|
62
|
+
const job = execution.jobsMapByNodeId[operand.options.nodeId];
|
|
63
|
+
return job && get(job, operand.options.path);
|
|
64
|
+
|
|
65
|
+
case '$calculation':
|
|
66
|
+
const fn = calculators.get(operand.options.calculator);
|
|
67
|
+
|
|
68
|
+
if (!fn) {
|
|
69
|
+
throw new Error(`no calculator function registered for "${operand.options.calculator}"`);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return fn(...operand.options.operands.map(item => calculate(item, lastJob, execution)));
|
|
73
|
+
// constant
|
|
74
|
+
|
|
75
|
+
default:
|
|
76
|
+
return operand.value;
|
|
77
|
+
}
|
|
78
|
+
} // built-in functions
|
|
79
|
+
|
|
80
|
+
|
|
48
81
|
function equal(a, b) {
|
|
49
|
-
|
|
82
|
+
return a === b;
|
|
50
83
|
}
|
|
84
|
+
|
|
51
85
|
function notEqual(a, b) {
|
|
52
|
-
|
|
86
|
+
return a !== b;
|
|
53
87
|
}
|
|
88
|
+
|
|
54
89
|
function gt(a, b) {
|
|
55
|
-
|
|
90
|
+
return a > b;
|
|
56
91
|
}
|
|
92
|
+
|
|
57
93
|
function gte(a, b) {
|
|
58
|
-
|
|
94
|
+
return a >= b;
|
|
59
95
|
}
|
|
96
|
+
|
|
60
97
|
function lt(a, b) {
|
|
61
|
-
|
|
98
|
+
return a < b;
|
|
62
99
|
}
|
|
100
|
+
|
|
63
101
|
function lte(a, b) {
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
102
|
+
return a <= b;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
calculators.register('equal', equal);
|
|
106
|
+
calculators.register('notEqual', notEqual);
|
|
107
|
+
calculators.register('gt', gt);
|
|
108
|
+
calculators.register('gte', gte);
|
|
109
|
+
calculators.register('lt', lt);
|
|
110
|
+
calculators.register('lte', lte);
|
|
111
|
+
calculators.register('===', equal);
|
|
112
|
+
calculators.register('!==', notEqual);
|
|
113
|
+
calculators.register('>', gt);
|
|
114
|
+
calculators.register('>=', gte);
|
|
115
|
+
calculators.register('<', lt);
|
|
116
|
+
calculators.register('<=', lte);
|
|
117
|
+
|
|
78
118
|
function add(...args) {
|
|
79
|
-
|
|
119
|
+
return args.reduce((sum, a) => sum + a, 0);
|
|
80
120
|
}
|
|
121
|
+
|
|
81
122
|
function minus(a, b) {
|
|
82
|
-
|
|
123
|
+
return a - b;
|
|
83
124
|
}
|
|
84
|
-
|
|
85
|
-
|
|
125
|
+
|
|
126
|
+
function multiple(...args) {
|
|
127
|
+
return args.reduce((result, a) => result * a, 1);
|
|
86
128
|
}
|
|
129
|
+
|
|
87
130
|
function divide(a, b) {
|
|
88
|
-
|
|
131
|
+
return a / b;
|
|
89
132
|
}
|
|
133
|
+
|
|
90
134
|
function mod(a, b) {
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
135
|
+
return a % b;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
calculators.register('add', add);
|
|
139
|
+
calculators.register('minus', minus);
|
|
140
|
+
calculators.register('multiple', multiple);
|
|
141
|
+
calculators.register('divide', divide);
|
|
142
|
+
calculators.register('mod', mod);
|
|
143
|
+
calculators.register('+', add);
|
|
144
|
+
calculators.register('-', minus);
|
|
145
|
+
calculators.register('*', multiple);
|
|
146
|
+
calculators.register('/', divide);
|
|
147
|
+
calculators.register('%', mod);
|
|
148
|
+
|
|
103
149
|
function includes(a, b) {
|
|
104
|
-
|
|
150
|
+
return a.includes(b);
|
|
105
151
|
}
|
|
152
|
+
|
|
106
153
|
function notIncludes(a, b) {
|
|
107
|
-
|
|
154
|
+
return !a.includes(b);
|
|
108
155
|
}
|
|
156
|
+
|
|
109
157
|
function startsWith(a, b) {
|
|
110
|
-
|
|
158
|
+
return a.startsWith(b);
|
|
111
159
|
}
|
|
160
|
+
|
|
112
161
|
function notStartsWith(a, b) {
|
|
113
|
-
|
|
162
|
+
return !a.startsWith(b);
|
|
114
163
|
}
|
|
164
|
+
|
|
115
165
|
function endsWith(a, b) {
|
|
116
|
-
|
|
166
|
+
return a.endsWith(b);
|
|
117
167
|
}
|
|
168
|
+
|
|
118
169
|
function notEndsWith(a, b) {
|
|
119
|
-
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
170
|
+
return !a.endsWith(b);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
calculators.register('includes', includes);
|
|
174
|
+
calculators.register('notIncludes', notIncludes);
|
|
175
|
+
calculators.register('startsWith', startsWith);
|
|
176
|
+
calculators.register('notStartsWith', notStartsWith);
|
|
177
|
+
calculators.register('endsWith', endsWith);
|
|
178
|
+
calculators.register('notEndsWith', notEndsWith);
|
|
179
|
+
|
|
127
180
|
function before(a, b) {
|
|
128
|
-
|
|
181
|
+
return a < b;
|
|
129
182
|
}
|
|
130
|
-
|
|
131
|
-
// TODO: add more common calculators
|
|
132
|
-
//# sourceMappingURL=index.js.map
|
|
183
|
+
|
|
184
|
+
calculators.register('now', () => new Date()); // TODO: add more common calculators
|
|
@@ -1,40 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
exports
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _default = {
|
|
8
|
+
name: 'executions',
|
|
9
|
+
model: 'ExecutionModel',
|
|
10
|
+
title: '执行流程',
|
|
11
|
+
fields: [{
|
|
12
|
+
interface: 'linkTo',
|
|
13
|
+
type: 'belongsTo',
|
|
14
|
+
name: 'workflow',
|
|
15
|
+
title: '所属工作流'
|
|
16
|
+
}, {
|
|
17
|
+
type: 'boolean',
|
|
18
|
+
name: 'useTransaction',
|
|
19
|
+
title: '使用事务',
|
|
20
|
+
defaultValue: false
|
|
21
|
+
}, {
|
|
22
|
+
type: 'uuid',
|
|
23
|
+
name: 'transaction',
|
|
24
|
+
defaultValue: null
|
|
25
|
+
}, {
|
|
26
|
+
interface: 'linkTo',
|
|
27
|
+
type: 'hasMany',
|
|
28
|
+
name: 'jobs',
|
|
29
|
+
title: '流程记录'
|
|
30
|
+
}, {
|
|
31
|
+
interface: 'json',
|
|
32
|
+
type: 'jsonb',
|
|
33
|
+
name: 'context',
|
|
34
|
+
title: '上下文数据'
|
|
35
|
+
}, {
|
|
36
|
+
interface: 'select',
|
|
37
|
+
type: 'integer',
|
|
38
|
+
name: 'status',
|
|
39
|
+
title: '状态'
|
|
40
|
+
}]
|
|
39
41
|
};
|
|
40
|
-
|
|
42
|
+
exports.default = _default;
|
|
@@ -1,74 +1,62 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
exports
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
{ label: '等待人工输入', value: 'prompt' },
|
|
62
|
-
{ label: '条件判断', value: 'condition' },
|
|
63
|
-
]
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
interface: 'json',
|
|
67
|
-
type: 'jsonb',
|
|
68
|
-
name: 'config',
|
|
69
|
-
title: '配置',
|
|
70
|
-
defaultValue: {}
|
|
71
|
-
}
|
|
72
|
-
]
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _default = {
|
|
8
|
+
name: 'flow_nodes',
|
|
9
|
+
// model: 'FlowNodeModel',
|
|
10
|
+
title: 'Workflow Nodes',
|
|
11
|
+
fields: [{
|
|
12
|
+
interface: 'string',
|
|
13
|
+
type: 'string',
|
|
14
|
+
name: 'title',
|
|
15
|
+
title: '名称'
|
|
16
|
+
}, // which workflow belongs to
|
|
17
|
+
{
|
|
18
|
+
interface: 'linkTo',
|
|
19
|
+
name: 'workflow',
|
|
20
|
+
type: 'belongsTo'
|
|
21
|
+
}, {
|
|
22
|
+
interface: 'linkTo',
|
|
23
|
+
name: 'upstream',
|
|
24
|
+
type: 'belongsTo',
|
|
25
|
+
target: 'flow_nodes'
|
|
26
|
+
}, {
|
|
27
|
+
interface: 'linkTo',
|
|
28
|
+
name: 'branches',
|
|
29
|
+
type: 'hasMany',
|
|
30
|
+
target: 'flow_nodes',
|
|
31
|
+
sourceKey: 'id',
|
|
32
|
+
foreignKey: 'upstreamId'
|
|
33
|
+
}, // only works when upstream node is branching type, such as condition and parallel.
|
|
34
|
+
// put here because the design of flow-links model is not really necessary for now.
|
|
35
|
+
// or it should be put into flow-links model.
|
|
36
|
+
{
|
|
37
|
+
interface: 'select',
|
|
38
|
+
name: 'branchIndex',
|
|
39
|
+
type: 'integer',
|
|
40
|
+
title: 'branch index'
|
|
41
|
+
}, // Note: for reasons:
|
|
42
|
+
// 1. redirect type node to solve cycle flow.
|
|
43
|
+
// 2. recognize as real next node after branches.
|
|
44
|
+
{
|
|
45
|
+
interface: 'linkTo',
|
|
46
|
+
name: 'downstream',
|
|
47
|
+
type: 'belongsTo',
|
|
48
|
+
target: 'flow_nodes'
|
|
49
|
+
}, {
|
|
50
|
+
interface: 'select',
|
|
51
|
+
type: 'string',
|
|
52
|
+
name: 'type',
|
|
53
|
+
title: '类型'
|
|
54
|
+
}, {
|
|
55
|
+
interface: 'json',
|
|
56
|
+
type: 'jsonb',
|
|
57
|
+
name: 'config',
|
|
58
|
+
title: '配置',
|
|
59
|
+
defaultValue: {}
|
|
60
|
+
}]
|
|
73
61
|
};
|
|
74
|
-
|
|
62
|
+
exports.default = _default;
|
package/lib/collections/jobs.js
CHANGED
|
@@ -1,49 +1,47 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
exports
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
// }
|
|
47
|
-
]
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _default = {
|
|
8
|
+
name: 'jobs',
|
|
9
|
+
title: '流程记录',
|
|
10
|
+
fields: [{
|
|
11
|
+
interface: 'linkTo',
|
|
12
|
+
type: 'belongsTo',
|
|
13
|
+
name: 'execution',
|
|
14
|
+
title: '所属流程'
|
|
15
|
+
}, {
|
|
16
|
+
interface: 'linkTo',
|
|
17
|
+
type: 'belongsTo',
|
|
18
|
+
name: 'node',
|
|
19
|
+
target: 'flow_nodes',
|
|
20
|
+
title: '所属节点'
|
|
21
|
+
}, {
|
|
22
|
+
interface: 'linkTo',
|
|
23
|
+
type: 'belongsTo',
|
|
24
|
+
name: 'upstream',
|
|
25
|
+
target: 'jobs',
|
|
26
|
+
title: '上游记录'
|
|
27
|
+
}, // pending / resolved / rejected
|
|
28
|
+
{
|
|
29
|
+
interface: 'status',
|
|
30
|
+
type: 'integer',
|
|
31
|
+
name: 'status',
|
|
32
|
+
title: '处理状态'
|
|
33
|
+
}, {
|
|
34
|
+
interface: 'json',
|
|
35
|
+
type: 'jsonb',
|
|
36
|
+
name: 'result',
|
|
37
|
+
title: '处理结果'
|
|
38
|
+
} // TODO: possibly need node snapshot in case if node has been changed
|
|
39
|
+
// {
|
|
40
|
+
// interface: 'json',
|
|
41
|
+
// type: 'jsonb',
|
|
42
|
+
// name: 'nodeSnapshot',
|
|
43
|
+
// title: 'node snapshot'
|
|
44
|
+
// }
|
|
45
|
+
]
|
|
48
46
|
};
|
|
49
|
-
|
|
47
|
+
exports.default = _default;
|