@logicflow/engine 0.0.11-beta.0 → 0.0.12-beta.0

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.
Files changed (170) hide show
  1. package/README.md +5 -2
  2. package/dist/index.js +2 -0
  3. package/dist/index.js.map +1 -0
  4. package/es/EventEmitter.d.ts +34 -4
  5. package/es/EventEmitter.js +70 -48
  6. package/es/EventEmitter.js.map +1 -0
  7. package/es/FlowModel.d.ts +75 -73
  8. package/es/FlowModel.js +130 -173
  9. package/es/FlowModel.js.map +1 -0
  10. package/es/Scheduler.d.ts +50 -34
  11. package/es/Scheduler.js +134 -209
  12. package/es/Scheduler.js.map +1 -0
  13. package/es/constant/{constant.js → index.js} +8 -7
  14. package/es/constant/index.js.map +1 -0
  15. package/es/constant/logCode.js +29 -0
  16. package/es/constant/logCode.js.map +1 -0
  17. package/es/index.d.ts +135 -38
  18. package/es/index.js +92 -144
  19. package/es/index.js.map +1 -0
  20. package/es/nodes/base.d.ts +108 -0
  21. package/es/nodes/base.js +151 -0
  22. package/es/nodes/base.js.map +1 -0
  23. package/es/nodes/index.d.ts +3 -0
  24. package/es/nodes/index.js +4 -0
  25. package/es/nodes/index.js.map +1 -0
  26. package/es/nodes/{StartNode.d.ts → start.d.ts} +3 -2
  27. package/es/nodes/start.js +11 -0
  28. package/es/nodes/start.js.map +1 -0
  29. package/es/nodes/{TaskNode.d.ts → task.d.ts} +3 -2
  30. package/es/nodes/task.js +11 -0
  31. package/es/nodes/task.js.map +1 -0
  32. package/es/platform/browser/browserVm.d.ts +1 -0
  33. package/es/platform/browser/browserVm.js +66 -0
  34. package/es/platform/browser/browserVm.js.map +1 -0
  35. package/es/platform/browser/index.d.ts +4 -0
  36. package/es/platform/browser/index.js +23 -0
  37. package/es/platform/browser/index.js.map +1 -0
  38. package/es/platform/index.d.ts +1 -0
  39. package/es/platform/index.js +2 -0
  40. package/es/platform/index.js.map +1 -0
  41. package/es/platform/node/index.d.ts +4 -0
  42. package/es/platform/node/index.js +23 -0
  43. package/es/platform/node/index.js.map +1 -0
  44. package/es/platform/node/nodeVm.d.ts +1 -0
  45. package/es/platform/node/nodeVm.js +9 -0
  46. package/es/platform/node/nodeVm.js.map +1 -0
  47. package/es/recorder/index.d.ts +36 -10
  48. package/es/recorder/index.js +82 -135
  49. package/es/recorder/index.js.map +1 -0
  50. package/es/utils/global.d.ts +5 -0
  51. package/es/utils/global.js +27 -0
  52. package/es/utils/global.js.map +1 -0
  53. package/es/utils/id.js +14 -0
  54. package/es/utils/id.js.map +1 -0
  55. package/es/utils/index.d.ts +4 -0
  56. package/es/utils/index.js +5 -0
  57. package/es/utils/index.js.map +1 -0
  58. package/es/{util → utils}/storage.js +17 -16
  59. package/es/utils/storage.js.map +1 -0
  60. package/lib/EventEmitter.d.ts +37 -0
  61. package/lib/EventEmitter.js +94 -0
  62. package/lib/EventEmitter.js.map +1 -0
  63. package/lib/FlowModel.d.ts +146 -0
  64. package/lib/FlowModel.js +236 -0
  65. package/lib/FlowModel.js.map +1 -0
  66. package/lib/Scheduler.d.ts +78 -0
  67. package/lib/Scheduler.js +179 -0
  68. package/lib/Scheduler.js.map +1 -0
  69. package/lib/constant/index.d.ts +16 -0
  70. package/{cjs/constant/constant.js → lib/constant/index.js} +4 -3
  71. package/lib/constant/index.js.map +1 -0
  72. package/lib/constant/logCode.d.ts +12 -0
  73. package/{cjs/constant/LogCode.js → lib/constant/logCode.js} +16 -13
  74. package/lib/constant/logCode.js.map +1 -0
  75. package/lib/index.d.ts +157 -0
  76. package/lib/index.js +159 -0
  77. package/lib/index.js.map +1 -0
  78. package/lib/nodes/base.d.ts +108 -0
  79. package/lib/nodes/base.js +154 -0
  80. package/lib/nodes/base.js.map +1 -0
  81. package/lib/nodes/index.d.ts +3 -0
  82. package/lib/nodes/index.js +7 -0
  83. package/lib/nodes/index.js.map +1 -0
  84. package/lib/nodes/start.d.ts +6 -0
  85. package/lib/nodes/start.js +15 -0
  86. package/lib/nodes/start.js.map +1 -0
  87. package/lib/nodes/task.d.ts +6 -0
  88. package/lib/nodes/task.js +15 -0
  89. package/lib/nodes/task.js.map +1 -0
  90. package/lib/platform/browser/browserVm.d.ts +1 -0
  91. package/lib/platform/browser/browserVm.js +70 -0
  92. package/lib/platform/browser/browserVm.js.map +1 -0
  93. package/lib/platform/browser/index.d.ts +4 -0
  94. package/lib/platform/browser/index.js +28 -0
  95. package/lib/platform/browser/index.js.map +1 -0
  96. package/lib/platform/index.d.ts +1 -0
  97. package/lib/platform/index.js +5 -0
  98. package/lib/platform/index.js.map +1 -0
  99. package/lib/platform/node/index.d.ts +4 -0
  100. package/lib/platform/node/index.js +28 -0
  101. package/lib/platform/node/index.js.map +1 -0
  102. package/lib/platform/node/nodeVm.d.ts +1 -0
  103. package/lib/platform/node/nodeVm.js +13 -0
  104. package/lib/platform/node/nodeVm.js.map +1 -0
  105. package/lib/recorder/index.d.ts +46 -0
  106. package/lib/recorder/index.js +117 -0
  107. package/lib/recorder/index.js.map +1 -0
  108. package/lib/utils/global.d.ts +5 -0
  109. package/lib/utils/global.js +31 -0
  110. package/lib/utils/global.js.map +1 -0
  111. package/lib/utils/id.d.ts +3 -0
  112. package/lib/utils/id.js +20 -0
  113. package/lib/utils/id.js.map +1 -0
  114. package/lib/utils/index.d.ts +4 -0
  115. package/lib/utils/index.js +9 -0
  116. package/lib/utils/index.js.map +1 -0
  117. package/lib/utils/storage.d.ts +7 -0
  118. package/{cjs/util → lib/utils}/storage.js +18 -17
  119. package/lib/utils/storage.js.map +1 -0
  120. package/package.json +31 -71
  121. package/src/EventEmitter.ts +103 -0
  122. package/src/FlowModel.ts +325 -0
  123. package/src/Scheduler.ts +244 -0
  124. package/src/constant/index.ts +23 -0
  125. package/src/constant/logCode.ts +34 -0
  126. package/src/index.ts +300 -0
  127. package/src/nodes/base.ts +236 -0
  128. package/src/nodes/index.ts +3 -0
  129. package/src/nodes/start.ts +8 -0
  130. package/src/nodes/task.ts +8 -0
  131. package/src/platform/browser/browserVm.ts +68 -0
  132. package/src/platform/browser/index.ts +28 -0
  133. package/src/platform/index.ts +1 -0
  134. package/src/platform/node/index.ts +28 -0
  135. package/src/platform/node/nodeVm.ts +12 -0
  136. package/src/recorder/index.ts +137 -0
  137. package/src/typings.d.ts +0 -0
  138. package/src/utils/global.ts +41 -0
  139. package/src/utils/id.ts +16 -0
  140. package/src/utils/index.ts +5 -0
  141. package/src/utils/storage.ts +55 -0
  142. package/cjs/EventEmitter.js +0 -70
  143. package/cjs/FlowModel.js +0 -277
  144. package/cjs/Scheduler.js +0 -252
  145. package/cjs/expression/browserVm.js +0 -81
  146. package/cjs/expression/index.js +0 -57
  147. package/cjs/index.js +0 -210
  148. package/cjs/nodes/BaseNode.js +0 -252
  149. package/cjs/nodes/StartNode.js +0 -27
  150. package/cjs/nodes/TaskNode.js +0 -27
  151. package/cjs/recorder/index.js +0 -168
  152. package/cjs/util/ID.js +0 -16
  153. package/cjs/util/global.js +0 -32
  154. package/es/constant/LogCode.js +0 -28
  155. package/es/expression/browserVm.d.ts +0 -4
  156. package/es/expression/browserVm.js +0 -76
  157. package/es/expression/index.d.ts +0 -2
  158. package/es/expression/index.js +0 -54
  159. package/es/nodes/BaseNode.d.ts +0 -110
  160. package/es/nodes/BaseNode.js +0 -250
  161. package/es/nodes/StartNode.js +0 -25
  162. package/es/nodes/TaskNode.js +0 -25
  163. package/es/util/ID.js +0 -13
  164. package/es/util/global.d.ts +0 -5
  165. package/es/util/global.js +0 -26
  166. package/lib/main.js +0 -1
  167. /package/es/constant/{constant.d.ts → index.d.ts} +0 -0
  168. /package/es/constant/{LogCode.d.ts → logCode.d.ts} +0 -0
  169. /package/es/{util/ID.d.ts → utils/id.d.ts} +0 -0
  170. /package/es/{util → utils}/storage.d.ts +0 -0
package/es/index.js CHANGED
@@ -1,57 +1,11 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
- return new (P || (P = Promise))(function (resolve, reject) {
15
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
- step((generator = generator.apply(thisArg, _arguments || [])).next());
19
- });
20
- };
21
- var __generator = (this && this.__generator) || function (thisArg, body) {
22
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
23
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
- function verb(n) { return function (v) { return step([n, v]); }; }
25
- function step(op) {
26
- if (f) throw new TypeError("Generator is already executing.");
27
- while (_) try {
28
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
29
- if (y = 0, t) op = [op[0] & 2, t.value];
30
- switch (op[0]) {
31
- case 0: case 1: t = op; break;
32
- case 4: _.label++; return { value: op[1], done: false };
33
- case 5: _.label++; y = op[1]; op = [0]; continue;
34
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
- default:
36
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
- if (t[2]) _.ops.pop();
41
- _.trys.pop(); continue;
42
- }
43
- op = body.call(thisArg, _);
44
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
- }
47
- };
48
- import FlowModel from './FlowModel';
49
- import StartNode from './nodes/StartNode';
50
- import TaskNode from './nodes/TaskNode';
51
- import Recorder from './recorder';
52
- import { createEngineId } from './util/ID';
53
- var Engine = /** @class */ (function () {
54
- function Engine(options) {
1
+ import { __awaiter } from "tslib";
2
+ // import { LogicFlow } from '@logicflow/core';
3
+ import { BaseNode, StartNode, TaskNode } from './nodes';
4
+ import { FlowModel } from './FlowModel';
5
+ import { Recorder } from './recorder';
6
+ import { createEngineId } from './utils';
7
+ export class Engine {
8
+ constructor(options) {
55
9
  this.nodeModelMap = new Map();
56
10
  this.instanceId = createEngineId();
57
11
  if (options === null || options === void 0 ? void 0 : options.debug) {
@@ -59,6 +13,7 @@ var Engine = /** @class */ (function () {
59
13
  instanceId: this.instanceId,
60
14
  });
61
15
  }
16
+ // 默认注册节点 register default nodes
62
17
  this.register({
63
18
  type: StartNode.nodeTypeName,
64
19
  model: StartNode,
@@ -73,132 +28,125 @@ var Engine = /** @class */ (function () {
73
28
  * 注册节点
74
29
  * @param nodeConfig { type: 'custom-node', model: NodeClass }
75
30
  */
76
- Engine.prototype.register = function (nodeConfig) {
31
+ register(nodeConfig) {
77
32
  this.nodeModelMap.set(nodeConfig.type, nodeConfig.model);
78
- };
33
+ }
79
34
  /**
80
- * 自定义执行记录的存储,默认浏览器使用 sessionStoragenodejs 使用内存存储。
81
- * 注意:由于执行记录不会主动删除,所以需要自行清理。
82
- * nodejs环境建议自定义为持久化存储。
83
- * engine.setCustomRecorder({
35
+ * 自定义执行记录的存储,默认浏览器使用 sessionStorage, nodejs 使用内存存储
36
+ * 注意:由于执行记录不全会主动删除,所以需要自行清理。
37
+ * nodejs 环境建议自定义为持久化存储。
38
+ * engine.setCustomRecorder({{
84
39
  * async addActionRecord(task) {}
85
40
  * async getTask(actionId) {}
86
41
  * async getExecutionTasks(executionId) {}
87
42
  * clear(instanceId) {}
88
- * });
43
+ * }}
44
+ * @param recorder
89
45
  */
90
- Engine.prototype.setCustomRecorder = function (recorder) {
46
+ setCustomRecorder(recorder) {
91
47
  this.recorder = recorder;
92
- };
48
+ }
93
49
  /**
94
50
  * 加载流程图数据
95
51
  */
96
- Engine.prototype.load = function (_a) {
97
- var graphData = _a.graphData, _b = _a.startNodeType, startNodeType = _b === void 0 ? 'StartNode' : _b, _c = _a.globalData, globalData = _c === void 0 ? {} : _c;
98
- this.flowModel = new FlowModel({
52
+ load({ graphData, startNodeType = 'StartNode', globalData = {}, }) {
53
+ this.graphData = graphData;
54
+ const flowModel = new FlowModel({
99
55
  nodeModelMap: this.nodeModelMap,
100
56
  recorder: this.recorder,
101
57
  context: this.context,
102
- globalData: globalData,
103
- startNodeType: startNodeType,
58
+ globalData,
59
+ startNodeType,
104
60
  });
105
- this.flowModel.load(graphData);
106
- return this.flowModel;
107
- };
61
+ flowModel.load(graphData);
62
+ this.flowModel = flowModel;
63
+ return flowModel;
64
+ }
108
65
  /**
109
- * 执行流程,允许多次调用。
66
+ * 执行流程,允许多次调用
110
67
  */
111
- Engine.prototype.execute = function (execParam) {
112
- return __awaiter(this, void 0, void 0, function () {
113
- var _this = this;
114
- return __generator(this, function (_a) {
115
- return [2 /*return*/, new Promise(function (resolve, reject) {
116
- if (!execParam) {
117
- execParam = {};
118
- }
119
- _this.flowModel.execute(__assign(__assign({}, execParam), { callback: function (result) {
120
- resolve(result);
121
- }, onError: function (error) {
122
- reject(error);
123
- } }));
124
- })];
68
+ execute(param) {
69
+ return __awaiter(this, void 0, void 0, function* () {
70
+ return new Promise((resolve, reject) => {
71
+ var _a;
72
+ let execParam = param;
73
+ if (!param) {
74
+ execParam = {};
75
+ }
76
+ (_a = this.flowModel) === null || _a === void 0 ? void 0 : _a.execute(Object.assign(Object.assign({}, execParam), { callback: (result) => {
77
+ resolve(result);
78
+ }, onError: (error) => {
79
+ reject(error);
80
+ } }));
125
81
  });
126
82
  });
127
- };
83
+ }
128
84
  /**
129
- * 恢复执行
130
- * 注意此方法只能恢复节点后面的执行,不能恢复流程其他分支的执行。
131
- * 同理,中断执行也只能中断节点后面的执行,不会中断其他分支的执行。
132
- * 在实际项目中,如果存在中断节点,建议流程所有的节点都是排他网关,这样可以保证执行的过程不存在分支。
85
+ * 中断流程恢复
86
+ * @param resumeParam
87
+ * @returns
133
88
  */
134
- Engine.prototype.resume = function (resumeParam) {
135
- return __awaiter(this, void 0, void 0, function () {
136
- var _this = this;
137
- return __generator(this, function (_a) {
138
- return [2 /*return*/, new Promise(function (resolve, reject) {
139
- _this.flowModel.resume(__assign(__assign({}, resumeParam), { callback: function (result) {
140
- resolve(result);
141
- }, onError: function (error) {
142
- reject(error);
143
- } }));
144
- })];
89
+ resume(resumeParam) {
90
+ return __awaiter(this, void 0, void 0, function* () {
91
+ return new Promise((resolve, reject) => {
92
+ var _a;
93
+ (_a = this.flowModel) === null || _a === void 0 ? void 0 : _a.resume(Object.assign(Object.assign({}, resumeParam), { callback: (result) => {
94
+ resolve(result);
95
+ }, onError: (error) => {
96
+ reject(error);
97
+ } }));
145
98
  });
146
99
  });
147
- };
148
- Engine.prototype.getExecutionList = function () {
100
+ }
101
+ getExecutionList() {
149
102
  var _a;
150
- return __awaiter(this, void 0, void 0, function () {
151
- var executionIds;
152
- return __generator(this, function (_b) {
153
- switch (_b.label) {
154
- case 0: return [4 /*yield*/, ((_a = this.recorder) === null || _a === void 0 ? void 0 : _a.getExecutionList())];
155
- case 1:
156
- executionIds = _b.sent();
157
- return [2 /*return*/, executionIds];
158
- }
159
- });
103
+ return __awaiter(this, void 0, void 0, function* () {
104
+ return yield ((_a = this.recorder) === null || _a === void 0 ? void 0 : _a.getExecutionList());
160
105
  });
161
- };
162
- Engine.prototype.getExecutionRecord = function (executionId) {
106
+ }
107
+ /**
108
+ * 获取执行任务记录
109
+ * @param executionId
110
+ * @returns
111
+ */
112
+ getExecutionRecord(executionId) {
163
113
  var _a, _b;
164
- return __awaiter(this, void 0, void 0, function () {
165
- var tasks, records, i;
166
- return __generator(this, function (_c) {
167
- switch (_c.label) {
168
- case 0: return [4 /*yield*/, ((_a = this.recorder) === null || _a === void 0 ? void 0 : _a.getExecutionActions(executionId))];
169
- case 1:
170
- tasks = _c.sent();
171
- if (!tasks) {
172
- return [2 /*return*/, null];
173
- }
174
- records = [];
175
- for (i = 0; i < tasks.length; i++) {
176
- records.push((_b = this.recorder) === null || _b === void 0 ? void 0 : _b.getActionRecord(tasks[i]));
177
- }
178
- return [2 /*return*/, Promise.all(records)];
114
+ return __awaiter(this, void 0, void 0, function* () {
115
+ const actions = yield ((_a = this.recorder) === null || _a === void 0 ? void 0 : _a.getExecutionActions(executionId));
116
+ if (!actions) {
117
+ return null;
118
+ }
119
+ // DONE: 确认 records 的类型
120
+ const records = [];
121
+ for (let i = 0; i < (actions === null || actions === void 0 ? void 0 : actions.length); i++) {
122
+ const action = actions[i];
123
+ if (this.recorder) {
124
+ records.push((_b = this.recorder) === null || _b === void 0 ? void 0 : _b.getActionRecord(action));
179
125
  }
180
- });
126
+ }
127
+ return Promise.all(records);
181
128
  });
182
- };
183
- Engine.prototype.destroy = function () {
129
+ }
130
+ destroy() {
184
131
  var _a;
185
132
  (_a = this.recorder) === null || _a === void 0 ? void 0 : _a.clear();
186
- };
187
- Engine.prototype.getGlobalData = function () {
133
+ }
134
+ getGlobalData() {
188
135
  var _a;
189
136
  return (_a = this.flowModel) === null || _a === void 0 ? void 0 : _a.globalData;
190
- };
191
- Engine.prototype.setGlobalData = function (data) {
137
+ }
138
+ setGlobalData(data) {
192
139
  if (this.flowModel) {
193
140
  this.flowModel.globalData = data;
194
141
  }
195
- };
196
- Engine.prototype.updateGlobalData = function (data) {
142
+ }
143
+ updateGlobalData(data) {
197
144
  if (this.flowModel) {
198
145
  Object.assign(this.flowModel.globalData, data);
199
146
  }
200
- };
201
- return Engine;
202
- }());
147
+ }
148
+ }
149
+ export * from './constant';
150
+ export { BaseNode, StartNode, TaskNode, Recorder };
203
151
  export default Engine;
204
- export { Engine, TaskNode, StartNode, Recorder, };
152
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,+CAA+C;AAC/C,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAExC,MAAM,OAAO,MAAM;IASjB,YAAY,OAAwB;QAClC,IAAI,CAAC,YAAY,GAAG,IAAI,GAAG,EAAE,CAAA;QAC7B,IAAI,CAAC,UAAU,GAAG,cAAc,EAAE,CAAA;QAClC,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,EAAE;YAClB,IAAI,CAAC,QAAQ,GAAG,IAAI,QAAQ,CAAC;gBAC3B,UAAU,EAAE,IAAI,CAAC,UAAU;aAC5B,CAAC,CAAA;SACH;QACD,gCAAgC;QAChC,IAAI,CAAC,QAAQ,CAAC;YACZ,IAAI,EAAE,SAAS,CAAC,YAAY;YAC5B,KAAK,EAAE,SAAS;SACjB,CAAC,CAAA;QACF,IAAI,CAAC,QAAQ,CAAC;YACZ,IAAI,EAAE,QAAQ,CAAC,YAAY;YAC3B,KAAK,EAAE,QAAQ;SAChB,CAAC,CAAA;QACF,IAAI,CAAC,OAAO,GAAG,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,KAAI,EAAE,CAAA;IACvC,CAAC;IAED;;;OAGG;IACH,QAAQ,CAAC,UAA6B;QACpC,IAAI,C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E,UAAU,CAAA;IACnC,CAAC;IAED,aAAa,CAAC,IAA6B;QACzC,IAAI,IAAI,CAAC,SAAS,EAAE;YAClB,IAAI,CAAC,SAAS,CAAC,UAAU,GAAG,IAAI,CAAA;SACjC;IACH,CAAC;IAED,gBAAgB,CAAC,IAA6B;QAC5C,IAAI,IAAI,CAAC,SAAS,EAAE;YAClB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,IAAI,CAAC,CAAA;SAC/C;IACH,CAAC;CACF;AAyHD,cAAc,YAAY,CAAA;AAC1B,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAA;AAElD,eAAe,MAAM,CAAA"}
@@ -0,0 +1,108 @@
1
+ import { Engine } from '..';
2
+ import { ActionStatus } from '../constant';
3
+ export interface IBaseNodeProps {
4
+ nodeConfig: BaseNode.NodeConfig;
5
+ context: Record<string, any>;
6
+ globalData: Record<string, unknown>;
7
+ }
8
+ export declare class BaseNode implements BaseNode.Base {
9
+ readonly baseType: string;
10
+ static nodeTypeName: string;
11
+ /**
12
+ * 节点的入边
13
+ */
14
+ incoming: BaseNode.IncomingConfig[];
15
+ /**
16
+ * 节点的出边
17
+ */
18
+ outgoing: BaseNode.OutgoingConfig[];
19
+ /**
20
+ * 节点的属性
21
+ */
22
+ properties?: Record<string, unknown>;
23
+ nodeId: Engine.Key;
24
+ type: string;
25
+ /**
26
+ * 节点的上下文,是调用流程时传入的上下文
27
+ */
28
+ context: Record<string, any>;
29
+ /**
30
+ * 节点的全局数据,是调用流程时传入的全局数据
31
+ * 在计算表达式时,即基于全局数据进行计算
32
+ */
33
+ globalData: Record<string, unknown>;
34
+ constructor({ nodeConfig, context, globalData }: IBaseNodeProps);
35
+ /**
36
+ * 节点的执行逻辑
37
+ * @overridable 可以自定义节点重写此方法
38
+ * @param param.executionId 流程执行记录 ID
39
+ * @param param.actionId 此节点执行记录 ID
40
+ * @param param.nodeId 节点 ID
41
+ * @return 返回下一步的执行参数
42
+ * 当不返回时,表示此节点执行成功,流程会继续执行下一步。
43
+ * 当返回时,返回格式为
44
+ */
45
+ action(param?: Engine.ActionParam): Promise<BaseNode.ActionResult | undefined>;
46
+ /**
47
+ * 节点重新恢复执行的逻辑
48
+ * @overridable 可以自定义节点重写此方法
49
+ * @param params.executionId 流程执行记录 ID
50
+ * @param params.actionId 此节点执行记录 ID
51
+ * @param params.nodeId 节点 ID
52
+ */
53
+ onResume(params: Engine.ResumeParam): Promise<void>;
54
+ /**
55
+ * 判断该节点是否满足条件
56
+ */
57
+ private isPass;
58
+ /**
59
+ * 获取当前节点执行的下一个节点
60
+ */
61
+ private getOutgoing;
62
+ /**
63
+ * 节点的每一次执行都会生成一个唯一的 actionId
64
+ */
65
+ execute(params: Engine.ExecParam): Promise<Engine.NextActionParam>;
66
+ resume(params: Engine.ExecResumeParam): Promise<undefined>;
67
+ }
68
+ export declare namespace BaseNode {
69
+ interface Base {
70
+ incoming: IncomingConfig[];
71
+ outgoing: OutgoingConfig[];
72
+ properties?: Record<string, unknown>;
73
+ nodeId: Engine.Key;
74
+ type: string;
75
+ readonly baseType: string;
76
+ execute(actionParam: Engine.ActionParam): Promise<Engine.NextActionParam>;
77
+ }
78
+ type IncomingConfig = {
79
+ id: Engine.Key;
80
+ source: string;
81
+ properties?: Record<string, unknown>;
82
+ };
83
+ type OutgoingConfig = {
84
+ id: Engine.Key;
85
+ target: string;
86
+ properties?: Record<string, unknown>;
87
+ result?: string | boolean;
88
+ };
89
+ type NodeConfig = {
90
+ id: Engine.Key;
91
+ type: string;
92
+ properties?: Record<string, unknown>;
93
+ incoming: IncomingConfig[];
94
+ outgoing: OutgoingConfig[];
95
+ };
96
+ type NodeConstructor = {
97
+ new (config: {
98
+ nodeConfig: NodeConfig;
99
+ context: Record<string, any>;
100
+ globalData: Record<string, unknown>;
101
+ }): BaseNode;
102
+ };
103
+ type ActionResult = {
104
+ status: ActionStatus;
105
+ detail?: Record<string, unknown>;
106
+ };
107
+ }
108
+ export default BaseNode;
@@ -0,0 +1,151 @@
1
+ import { __awaiter } from "tslib";
2
+ import { ActionStatus } from '../constant';
3
+ import { getExpressionResult } from '../platform';
4
+ class BaseNode {
5
+ constructor({ nodeConfig, context, globalData }) {
6
+ const { outgoing, incoming, id, type, properties } = nodeConfig;
7
+ this.baseType = 'base';
8
+ this.outgoing = outgoing;
9
+ this.incoming = incoming;
10
+ this.nodeId = id;
11
+ this.type = type;
12
+ this.properties = properties;
13
+ this.context = context;
14
+ this.globalData = globalData;
15
+ }
16
+ /**
17
+ * 节点的执行逻辑
18
+ * @overridable 可以自定义节点重写此方法
19
+ * @param param.executionId 流程执行记录 ID
20
+ * @param param.actionId 此节点执行记录 ID
21
+ * @param param.nodeId 节点 ID
22
+ * @return 返回下一步的执行参数
23
+ * 当不返回时,表示此节点执行成功,流程会继续执行下一步。
24
+ * 当返回时,返回格式为
25
+ */
26
+ action(param) {
27
+ return __awaiter(this, void 0, void 0, function* () {
28
+ console.log('action param --->>>', param);
29
+ return undefined;
30
+ });
31
+ }
32
+ /**
33
+ * 节点重新恢复执行的逻辑
34
+ * @overridable 可以自定义节点重写此方法
35
+ * @param params.executionId 流程执行记录 ID
36
+ * @param params.actionId 此节点执行记录 ID
37
+ * @param params.nodeId 节点 ID
38
+ */
39
+ onResume(params) {
40
+ return __awaiter(this, void 0, void 0, function* () {
41
+ console.log('onResume params --->>>', params);
42
+ return undefined;
43
+ });
44
+ }
45
+ /**
46
+ * 判断该节点是否满足条件
47
+ */
48
+ isPass(properties) {
49
+ return __awaiter(this, void 0, void 0, function* () {
50
+ if (!properties)
51
+ return true;
52
+ const { conditionExpression } = properties;
53
+ if (!conditionExpression)
54
+ return true;
55
+ try {
56
+ // bug:uuid 创建的 NodeId 为 xxxx-xxxx-xxxx-zzzz 格式,eval 执行时会将 - 识别为数学减号,导致执行报错
57
+ // 解决方案: 赋值变量直接命名为 isPassResult, 因为每次执行 getExpressionResult 时,都会重新射程一个 context
58
+ return yield getExpressionResult(`
59
+ const isPassResult = (${conditionExpression})
60
+ return isPassResult
61
+ `, Object.assign({}, this.globalData));
62
+ }
63
+ catch (error) {
64
+ return false;
65
+ }
66
+ });
67
+ }
68
+ /**
69
+ * 获取当前节点执行的下一个节点
70
+ */
71
+ getOutgoing() {
72
+ return __awaiter(this, void 0, void 0, function* () {
73
+ const outgoing = [];
74
+ const expressions = [];
75
+ for (const item of this.outgoing) {
76
+ const { properties } = item;
77
+ expressions.push(this.isPass(properties));
78
+ }
79
+ const result = yield Promise.all(expressions);
80
+ result.forEach((item, index) => {
81
+ const out = this.outgoing[index];
82
+ out.result = item;
83
+ outgoing.push(out);
84
+ });
85
+ return outgoing;
86
+ });
87
+ }
88
+ /**
89
+ * 节点的每一次执行都会生成一个唯一的 actionId
90
+ */
91
+ execute(params) {
92
+ return __awaiter(this, void 0, void 0, function* () {
93
+ const { executionId, actionId } = params;
94
+ const res = yield this.action({
95
+ nodeId: this.nodeId,
96
+ executionId,
97
+ actionId,
98
+ });
99
+ const status = res ? res.status : 'success';
100
+ if (status === ActionStatus.SUCCESS) {
101
+ const outgoing = yield this.getOutgoing();
102
+ const detail = res ? res.detail : {};
103
+ params.next({
104
+ status: ActionStatus.SUCCESS,
105
+ detail,
106
+ nodeId: this.nodeId,
107
+ nodeType: this.type,
108
+ properties: this.properties,
109
+ executionId,
110
+ actionId,
111
+ outgoing,
112
+ });
113
+ }
114
+ return {
115
+ status,
116
+ detail: res === null || res === void 0 ? void 0 : res.detail,
117
+ executionId,
118
+ actionId,
119
+ nodeId: this.nodeId,
120
+ nodeType: this.type,
121
+ properties: this.properties,
122
+ outgoing: [],
123
+ };
124
+ });
125
+ }
126
+ resume(params) {
127
+ return __awaiter(this, void 0, void 0, function* () {
128
+ const outgoing = yield this.getOutgoing();
129
+ yield this.onResume({
130
+ executionId: params.executionId,
131
+ actionId: params.actionId,
132
+ nodeId: params.nodeId,
133
+ data: params.data,
134
+ });
135
+ params.next({
136
+ executionId: params.executionId,
137
+ actionId: params.actionId,
138
+ nodeId: this.nodeId,
139
+ nodeType: this.type,
140
+ properties: this.properties,
141
+ outgoing,
142
+ status: ActionStatus.SUCCESS,
143
+ });
144
+ return undefined;
145
+ });
146
+ }
147
+ }
148
+ BaseNode.nodeTypeName = 'BaseNode';
149
+ export { BaseNode };
150
+ export default BaseNode;
151
+ //# sourceMappingURL=base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/nodes/base.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAQjD,MAAa,QAAQ;IA4BnB,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAkB;QAC7D,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,UAAU,CAAA;QAC/D,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAA;QACtB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACxB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACxB,IAAI,CAAC,MAAM,GAAG,EAAE,CAAA;QAChB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAE5B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;IAC9B,CAAC;IAED;;;;;;;;;OASG;IACU,MAAM,CACjB,KAA0B;;YAE1B,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,KAAK,CAAC,CAAA;YACzC,OAAO,SAAS,CAAA;QAClB,CAAC;KAAA;IAED;;;;;;OAMG;IACU,QAAQ,CAAC,MAA0B;;YAC9C,OAAO,CAAC,GAAG,CAAC,wBAAwB,EAAE,MAAM,CAAC,CAAA;YAC7C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B,CAAC,CAAA;YAEF,MAAM,CAAC,IAAI,CAAC;gBACV,WAAW,EAAE,MAAM,CAAC,WAAW;gBAC/B,QAAQ,EAAE,MAAM,CAAC,QAAQ;gBACzB,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,QAAQ,EAAE,IAAI,CAAC,IAAI;gBACnB,UAAU,EAAE,IAAI,CAAC,UAAU;gBAC3B,QAAQ;gBACR,MAAM,EAAE,YAAY,CAAC,OAAO;aAC7B,CAAC,CAAA;YACF,OAAO,SAAS,CAAA;QAClB,CAAC;KAAA;;AA9KM,qBAAY,GAAG,UAAU,CAAA;SAFrB,QAAQ;AAiOrB,eAAe,QAAQ,CAAA"}
@@ -0,0 +1,3 @@
1
+ export * from './base';
2
+ export * from './start';
3
+ export * from './task';
@@ -0,0 +1,4 @@
1
+ export * from './base';
2
+ export * from './start';
3
+ export * from './task';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/nodes/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA;AACtB,cAAc,SAAS,CAAA;AACvB,cAAc,QAAQ,CAAA"}
@@ -1,5 +1,6 @@
1
- import BaseNode from './BaseNode';
1
+ import BaseNode from './base';
2
2
  export default class StartNode extends BaseNode {
3
- static nodeTypeName: string;
4
3
  readonly baseType = "start";
4
+ static nodeTypeName: string;
5
5
  }
6
+ export { StartNode };
@@ -0,0 +1,11 @@
1
+ import BaseNode from './base';
2
+ class StartNode extends BaseNode {
3
+ constructor() {
4
+ super(...arguments);
5
+ this.baseType = 'start';
6
+ }
7
+ }
8
+ StartNode.nodeTypeName = 'StartNode';
9
+ export default StartNode;
10
+ export { StartNode };
11
+ //# sourceMappingURL=start.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"start.js","sourceRoot":"","sources":["../../src/nodes/start.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,QAAQ,CAAA;AAE7B,MAAqB,SAAU,SAAQ,QAAQ;IAA/C;;QACW,aAAQ,GAAG,OAAO,CAAA;IAE7B,CAAC;;AADQ,sBAAY,GAAG,WAAW,AAAd,CAAc;eAFd,SAAS;AAK9B,OAAO,EAAE,SAAS,EAAE,CAAA"}
@@ -1,5 +1,6 @@
1
- import BaseNode from './BaseNode';
1
+ import BaseNode from './base';
2
2
  export default class TaskNode extends BaseNode {
3
- static nodeTypeName: string;
4
3
  readonly baseType = "task";
4
+ static nodeTypeName: string;
5
5
  }
6
+ export { TaskNode };
@@ -0,0 +1,11 @@
1
+ import BaseNode from './base';
2
+ class TaskNode extends BaseNode {
3
+ constructor() {
4
+ super(...arguments);
5
+ this.baseType = 'task';
6
+ }
7
+ }
8
+ TaskNode.nodeTypeName = 'TaskNode';
9
+ export default TaskNode;
10
+ export { TaskNode };
11
+ //# sourceMappingURL=task.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task.js","sourceRoot":"","sources":["../../src/nodes/task.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,QAAQ,CAAA;AAE7B,MAAqB,QAAS,SAAQ,QAAQ;IAA9C;;QACW,aAAQ,GAAG,MAAM,CAAA;IAE5B,CAAC;;AADQ,qBAAY,GAAG,UAAU,AAAb,CAAa;eAFb,QAAQ;AAK7B,OAAO,EAAE,QAAQ,EAAE,CAAA"}
@@ -0,0 +1 @@
1
+ export declare const runInBrowserContext: (code: string, globalData?: {}) => Promise<any>;