@logicflow/engine 0.0.10-beta.0 → 0.0.11-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.
- package/README.md +2 -5
- package/cjs/EventEmitter.js +70 -0
- package/cjs/FlowModel.js +277 -0
- package/cjs/Scheduler.js +252 -0
- package/{lib/constant/logCode.js → cjs/constant/LogCode.js} +13 -16
- package/{lib/constant/index.js → cjs/constant/constant.js} +3 -4
- package/cjs/expression/browserVm.js +81 -0
- package/cjs/expression/index.js +57 -0
- package/cjs/index.js +210 -0
- package/cjs/nodes/BaseNode.js +252 -0
- package/cjs/nodes/StartNode.js +27 -0
- package/cjs/nodes/TaskNode.js +27 -0
- package/cjs/recorder/index.js +168 -0
- package/cjs/util/ID.js +16 -0
- package/cjs/util/global.js +32 -0
- package/{lib/utils → cjs/util}/storage.js +17 -18
- package/es/EventEmitter.d.ts +4 -34
- package/es/EventEmitter.js +48 -70
- package/es/FlowModel.d.ts +73 -75
- package/es/FlowModel.js +173 -130
- package/es/Scheduler.d.ts +34 -50
- package/es/Scheduler.js +209 -134
- package/es/constant/LogCode.js +28 -0
- package/es/constant/{index.js → constant.js} +7 -8
- package/es/expression/browserVm.d.ts +4 -0
- package/es/expression/browserVm.js +76 -0
- package/es/expression/index.d.ts +1 -1
- package/es/expression/index.js +53 -16
- package/es/index.d.ts +38 -135
- package/es/index.js +144 -92
- package/es/nodes/BaseNode.d.ts +110 -0
- package/es/nodes/BaseNode.js +250 -0
- package/es/nodes/{start.d.ts → StartNode.d.ts} +2 -3
- package/es/nodes/StartNode.js +25 -0
- package/es/nodes/{task.d.ts → TaskNode.d.ts} +2 -3
- package/es/nodes/TaskNode.js +25 -0
- package/es/recorder/index.d.ts +10 -36
- package/es/recorder/index.js +135 -82
- package/es/util/ID.js +13 -0
- package/es/util/global.d.ts +5 -0
- package/es/util/global.js +26 -0
- package/es/{utils → util}/storage.js +16 -17
- package/lib/main.js +1 -0
- package/package.json +71 -30
- package/dist/index.js +0 -2
- package/dist/index.js.map +0 -1
- package/es/EventEmitter.js.map +0 -1
- package/es/FlowModel.js.map +0 -1
- package/es/Scheduler.js.map +0 -1
- package/es/constant/index.js.map +0 -1
- package/es/constant/logCode.js +0 -29
- package/es/constant/logCode.js.map +0 -1
- package/es/expression/brewserVm.d.ts +0 -2
- package/es/expression/brewserVm.js +0 -30
- package/es/expression/brewserVm.js.map +0 -1
- package/es/expression/index.js.map +0 -1
- package/es/expression/nodeVm.d.ts +0 -4
- package/es/expression/nodeVm.js +0 -10
- package/es/expression/nodeVm.js.map +0 -1
- package/es/index.js.map +0 -1
- package/es/nodes/base.d.ts +0 -108
- package/es/nodes/base.js +0 -149
- package/es/nodes/base.js.map +0 -1
- package/es/nodes/index.d.ts +0 -3
- package/es/nodes/index.js +0 -4
- package/es/nodes/index.js.map +0 -1
- package/es/nodes/start.js +0 -11
- package/es/nodes/start.js.map +0 -1
- package/es/nodes/task.js +0 -11
- package/es/nodes/task.js.map +0 -1
- package/es/platform/browser/browserVm.d.ts +0 -4
- package/es/platform/browser/browserVm.js +0 -44
- package/es/platform/browser/browserVm.js.map +0 -1
- package/es/platform/browser/index.d.ts +0 -4
- package/es/platform/browser/index.js +0 -23
- package/es/platform/browser/index.js.map +0 -1
- package/es/platform/index.d.ts +0 -1
- package/es/platform/index.js +0 -2
- package/es/platform/index.js.map +0 -1
- package/es/platform/node/index.d.ts +0 -4
- package/es/platform/node/index.js +0 -23
- package/es/platform/node/index.js.map +0 -1
- package/es/platform/node/nodeVm.d.ts +0 -1
- package/es/platform/node/nodeVm.js +0 -9
- package/es/platform/node/nodeVm.js.map +0 -1
- package/es/recorder/index.js.map +0 -1
- package/es/utils/global.d.ts +0 -5
- package/es/utils/global.js +0 -27
- package/es/utils/global.js.map +0 -1
- package/es/utils/id.js +0 -14
- package/es/utils/id.js.map +0 -1
- package/es/utils/index.d.ts +0 -4
- package/es/utils/index.js +0 -5
- package/es/utils/index.js.map +0 -1
- package/es/utils/storage.js.map +0 -1
- package/lib/EventEmitter.d.ts +0 -37
- package/lib/EventEmitter.js +0 -94
- package/lib/EventEmitter.js.map +0 -1
- package/lib/FlowModel.d.ts +0 -146
- package/lib/FlowModel.js +0 -236
- package/lib/FlowModel.js.map +0 -1
- package/lib/Scheduler.d.ts +0 -78
- package/lib/Scheduler.js +0 -179
- package/lib/Scheduler.js.map +0 -1
- package/lib/constant/index.d.ts +0 -16
- package/lib/constant/index.js.map +0 -1
- package/lib/constant/logCode.d.ts +0 -12
- package/lib/constant/logCode.js.map +0 -1
- package/lib/expression/brewserVm.d.ts +0 -2
- package/lib/expression/brewserVm.js +0 -33
- package/lib/expression/brewserVm.js.map +0 -1
- package/lib/expression/index.d.ts +0 -2
- package/lib/expression/index.js +0 -20
- package/lib/expression/index.js.map +0 -1
- package/lib/expression/nodeVm.d.ts +0 -4
- package/lib/expression/nodeVm.js +0 -13
- package/lib/expression/nodeVm.js.map +0 -1
- package/lib/index.d.ts +0 -157
- package/lib/index.js +0 -159
- package/lib/index.js.map +0 -1
- package/lib/nodes/base.d.ts +0 -108
- package/lib/nodes/base.js +0 -152
- package/lib/nodes/base.js.map +0 -1
- package/lib/nodes/index.d.ts +0 -3
- package/lib/nodes/index.js +0 -7
- package/lib/nodes/index.js.map +0 -1
- package/lib/nodes/start.d.ts +0 -6
- package/lib/nodes/start.js +0 -15
- package/lib/nodes/start.js.map +0 -1
- package/lib/nodes/task.d.ts +0 -6
- package/lib/nodes/task.js +0 -15
- package/lib/nodes/task.js.map +0 -1
- package/lib/platform/browser/browserVm.d.ts +0 -4
- package/lib/platform/browser/browserVm.js +0 -49
- package/lib/platform/browser/browserVm.js.map +0 -1
- package/lib/platform/browser/index.d.ts +0 -4
- package/lib/platform/browser/index.js +0 -28
- package/lib/platform/browser/index.js.map +0 -1
- package/lib/platform/index.d.ts +0 -1
- package/lib/platform/index.js +0 -5
- package/lib/platform/index.js.map +0 -1
- package/lib/platform/node/index.d.ts +0 -4
- package/lib/platform/node/index.js +0 -28
- package/lib/platform/node/index.js.map +0 -1
- package/lib/platform/node/nodeVm.d.ts +0 -1
- package/lib/platform/node/nodeVm.js +0 -13
- package/lib/platform/node/nodeVm.js.map +0 -1
- package/lib/recorder/index.d.ts +0 -46
- package/lib/recorder/index.js +0 -117
- package/lib/recorder/index.js.map +0 -1
- package/lib/utils/global.d.ts +0 -5
- package/lib/utils/global.js +0 -31
- package/lib/utils/global.js.map +0 -1
- package/lib/utils/id.d.ts +0 -3
- package/lib/utils/id.js +0 -20
- package/lib/utils/id.js.map +0 -1
- package/lib/utils/index.d.ts +0 -4
- package/lib/utils/index.js +0 -9
- package/lib/utils/index.js.map +0 -1
- package/lib/utils/storage.d.ts +0 -7
- package/lib/utils/storage.js.map +0 -1
- package/src/EventEmitter.ts +0 -103
- package/src/FlowModel.ts +0 -325
- package/src/Scheduler.ts +0 -244
- package/src/constant/index.ts +0 -23
- package/src/constant/logCode.ts +0 -34
- package/src/expression/brewserVm.ts +0 -36
- package/src/expression/index.ts +0 -17
- package/src/expression/nodeVm.ts +0 -14
- package/src/index.ts +0 -300
- package/src/nodes/base.ts +0 -234
- package/src/nodes/index.ts +0 -3
- package/src/nodes/start.ts +0 -8
- package/src/nodes/task.ts +0 -8
- package/src/platform/browser/browserVm.ts +0 -52
- package/src/platform/browser/index.ts +0 -28
- package/src/platform/index.ts +0 -1
- package/src/platform/node/index.ts +0 -28
- package/src/platform/node/nodeVm.ts +0 -12
- package/src/recorder/index.ts +0 -137
- package/src/typings.d.ts +0 -0
- package/src/utils/global.ts +0 -41
- package/src/utils/id.ts +0 -16
- package/src/utils/index.ts +0 -5
- package/src/utils/storage.ts +0 -55
- /package/es/constant/{logCode.d.ts → LogCode.d.ts} +0 -0
- /package/es/constant/{index.d.ts → constant.d.ts} +0 -0
- /package/es/{utils/id.d.ts → util/ID.d.ts} +0 -0
- /package/es/{utils → util}/storage.d.ts +0 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
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;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.runInContext = exports.createContext = exports.runInBrowserContext = void 0;
|
|
40
|
+
var LogCode_1 = require("../constant/LogCode");
|
|
41
|
+
var createContext = function (globalData) {
|
|
42
|
+
var iframe = document.createElement('iframe');
|
|
43
|
+
iframe.style.display = 'none';
|
|
44
|
+
if (!document || !document.body) {
|
|
45
|
+
console.error(LogCode_1.getErrorMsg(LogCode_1.ErrorCode.NO_DOCUMENT_BODY));
|
|
46
|
+
}
|
|
47
|
+
document.body.appendChild(iframe);
|
|
48
|
+
var iframeWindow = iframe.contentWindow;
|
|
49
|
+
iframeWindow.parent = null;
|
|
50
|
+
Object.keys(globalData).forEach(function (key) {
|
|
51
|
+
iframeWindow[key] = globalData[key];
|
|
52
|
+
});
|
|
53
|
+
return iframeWindow;
|
|
54
|
+
};
|
|
55
|
+
exports.createContext = createContext;
|
|
56
|
+
var runInContext = function (code, context) {
|
|
57
|
+
try {
|
|
58
|
+
var iframeEval = context.eval;
|
|
59
|
+
iframeEval.call(context, code);
|
|
60
|
+
if (context.frameElement) {
|
|
61
|
+
document.body.removeChild(context.frameElement);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
catch (e) {
|
|
65
|
+
console.warn(LogCode_1.getWarningMsg(LogCode_1.WarningCode.EXPRESSION_EXEC_ERROR), { code: code, context: context, e: e });
|
|
66
|
+
}
|
|
67
|
+
return context;
|
|
68
|
+
};
|
|
69
|
+
exports.runInContext = runInContext;
|
|
70
|
+
var runInBrowserContext = function (code, globalData) {
|
|
71
|
+
if (globalData === void 0) { globalData = {}; }
|
|
72
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
73
|
+
var context;
|
|
74
|
+
return __generator(this, function (_a) {
|
|
75
|
+
context = createContext(globalData);
|
|
76
|
+
runInContext(code, context);
|
|
77
|
+
return [2 /*return*/, context];
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
exports.runInBrowserContext = runInBrowserContext;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
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;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.getExpressionResult = void 0;
|
|
40
|
+
// import { runInNewContext } from './nodeVm';
|
|
41
|
+
var browserVm_1 = require("./browserVm");
|
|
42
|
+
var global_1 = require("../util/global");
|
|
43
|
+
var getExpressionResult = function (code, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
44
|
+
var r;
|
|
45
|
+
return __generator(this, function (_a) {
|
|
46
|
+
switch (_a.label) {
|
|
47
|
+
case 0:
|
|
48
|
+
if (!global_1.isInBrowser) return [3 /*break*/, 2];
|
|
49
|
+
return [4 /*yield*/, browserVm_1.runInBrowserContext(code, context)];
|
|
50
|
+
case 1:
|
|
51
|
+
r = _a.sent();
|
|
52
|
+
return [2 /*return*/, r];
|
|
53
|
+
case 2: return [2 /*return*/, global_1.globalScope.eval(code)]; // eslint-disable-line no-eval
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}); };
|
|
57
|
+
exports.getExpressionResult = getExpressionResult;
|
package/cjs/index.js
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
+
function step(op) {
|
|
27
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
+
while (_) try {
|
|
29
|
+
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;
|
|
30
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
+
switch (op[0]) {
|
|
32
|
+
case 0: case 1: t = op; break;
|
|
33
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
+
default:
|
|
37
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
+
if (t[2]) _.ops.pop();
|
|
42
|
+
_.trys.pop(); continue;
|
|
43
|
+
}
|
|
44
|
+
op = body.call(thisArg, _);
|
|
45
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
+
exports.Recorder = exports.StartNode = exports.TaskNode = exports.Engine = void 0;
|
|
51
|
+
var FlowModel_1 = require("./FlowModel");
|
|
52
|
+
var StartNode_1 = require("./nodes/StartNode");
|
|
53
|
+
exports.StartNode = StartNode_1.default;
|
|
54
|
+
var TaskNode_1 = require("./nodes/TaskNode");
|
|
55
|
+
exports.TaskNode = TaskNode_1.default;
|
|
56
|
+
var recorder_1 = require("./recorder");
|
|
57
|
+
exports.Recorder = recorder_1.default;
|
|
58
|
+
var ID_1 = require("./util/ID");
|
|
59
|
+
var Engine = /** @class */ (function () {
|
|
60
|
+
function Engine(options) {
|
|
61
|
+
this.nodeModelMap = new Map();
|
|
62
|
+
this.instanceId = ID_1.createEngineId();
|
|
63
|
+
if (options === null || options === void 0 ? void 0 : options.debug) {
|
|
64
|
+
this.recorder = new recorder_1.default({
|
|
65
|
+
instanceId: this.instanceId,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
this.register({
|
|
69
|
+
type: StartNode_1.default.nodeTypeName,
|
|
70
|
+
model: StartNode_1.default,
|
|
71
|
+
});
|
|
72
|
+
this.register({
|
|
73
|
+
type: TaskNode_1.default.nodeTypeName,
|
|
74
|
+
model: TaskNode_1.default,
|
|
75
|
+
});
|
|
76
|
+
this.context = (options === null || options === void 0 ? void 0 : options.context) || {};
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* 注册节点
|
|
80
|
+
* @param nodeConfig { type: 'custom-node', model: NodeClass }
|
|
81
|
+
*/
|
|
82
|
+
Engine.prototype.register = function (nodeConfig) {
|
|
83
|
+
this.nodeModelMap.set(nodeConfig.type, nodeConfig.model);
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* 自定义执行记录的存储,默认浏览器使用 sessionStorage,nodejs 使用内存存储。
|
|
87
|
+
* 注意:由于执行记录不会主动删除,所以需要自行清理。
|
|
88
|
+
* nodejs环境建议自定义为持久化存储。
|
|
89
|
+
* engine.setCustomRecorder({
|
|
90
|
+
* async addActionRecord(task) {}
|
|
91
|
+
* async getTask(actionId) {}
|
|
92
|
+
* async getExecutionTasks(executionId) {}
|
|
93
|
+
* clear(instanceId) {}
|
|
94
|
+
* });
|
|
95
|
+
*/
|
|
96
|
+
Engine.prototype.setCustomRecorder = function (recorder) {
|
|
97
|
+
this.recorder = recorder;
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* 加载流程图数据
|
|
101
|
+
*/
|
|
102
|
+
Engine.prototype.load = function (_a) {
|
|
103
|
+
var graphData = _a.graphData, _b = _a.startNodeType, startNodeType = _b === void 0 ? 'StartNode' : _b, _c = _a.globalData, globalData = _c === void 0 ? {} : _c;
|
|
104
|
+
this.flowModel = new FlowModel_1.default({
|
|
105
|
+
nodeModelMap: this.nodeModelMap,
|
|
106
|
+
recorder: this.recorder,
|
|
107
|
+
context: this.context,
|
|
108
|
+
globalData: globalData,
|
|
109
|
+
startNodeType: startNodeType,
|
|
110
|
+
});
|
|
111
|
+
this.flowModel.load(graphData);
|
|
112
|
+
return this.flowModel;
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* 执行流程,允许多次调用。
|
|
116
|
+
*/
|
|
117
|
+
Engine.prototype.execute = function (execParam) {
|
|
118
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
119
|
+
var _this = this;
|
|
120
|
+
return __generator(this, function (_a) {
|
|
121
|
+
return [2 /*return*/, new Promise(function (resolve, reject) {
|
|
122
|
+
if (!execParam) {
|
|
123
|
+
execParam = {};
|
|
124
|
+
}
|
|
125
|
+
_this.flowModel.execute(__assign(__assign({}, execParam), { callback: function (result) {
|
|
126
|
+
resolve(result);
|
|
127
|
+
}, onError: function (error) {
|
|
128
|
+
reject(error);
|
|
129
|
+
} }));
|
|
130
|
+
})];
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
};
|
|
134
|
+
/**
|
|
135
|
+
* 恢复执行
|
|
136
|
+
* 注意此方法只能恢复节点后面的执行,不能恢复流程其他分支的执行。
|
|
137
|
+
* 同理,中断执行也只能中断节点后面的执行,不会中断其他分支的执行。
|
|
138
|
+
* 在实际项目中,如果存在中断节点,建议流程所有的节点都是排他网关,这样可以保证执行的过程不存在分支。
|
|
139
|
+
*/
|
|
140
|
+
Engine.prototype.resume = function (resumeParam) {
|
|
141
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
142
|
+
var _this = this;
|
|
143
|
+
return __generator(this, function (_a) {
|
|
144
|
+
return [2 /*return*/, new Promise(function (resolve, reject) {
|
|
145
|
+
_this.flowModel.resume(__assign(__assign({}, resumeParam), { callback: function (result) {
|
|
146
|
+
resolve(result);
|
|
147
|
+
}, onError: function (error) {
|
|
148
|
+
reject(error);
|
|
149
|
+
} }));
|
|
150
|
+
})];
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
};
|
|
154
|
+
Engine.prototype.getExecutionList = function () {
|
|
155
|
+
var _a;
|
|
156
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
157
|
+
var executionIds;
|
|
158
|
+
return __generator(this, function (_b) {
|
|
159
|
+
switch (_b.label) {
|
|
160
|
+
case 0: return [4 /*yield*/, ((_a = this.recorder) === null || _a === void 0 ? void 0 : _a.getExecutionList())];
|
|
161
|
+
case 1:
|
|
162
|
+
executionIds = _b.sent();
|
|
163
|
+
return [2 /*return*/, executionIds];
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
};
|
|
168
|
+
Engine.prototype.getExecutionRecord = function (executionId) {
|
|
169
|
+
var _a, _b;
|
|
170
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
171
|
+
var tasks, records, i;
|
|
172
|
+
return __generator(this, function (_c) {
|
|
173
|
+
switch (_c.label) {
|
|
174
|
+
case 0: return [4 /*yield*/, ((_a = this.recorder) === null || _a === void 0 ? void 0 : _a.getExecutionActions(executionId))];
|
|
175
|
+
case 1:
|
|
176
|
+
tasks = _c.sent();
|
|
177
|
+
if (!tasks) {
|
|
178
|
+
return [2 /*return*/, null];
|
|
179
|
+
}
|
|
180
|
+
records = [];
|
|
181
|
+
for (i = 0; i < tasks.length; i++) {
|
|
182
|
+
records.push((_b = this.recorder) === null || _b === void 0 ? void 0 : _b.getActionRecord(tasks[i]));
|
|
183
|
+
}
|
|
184
|
+
return [2 /*return*/, Promise.all(records)];
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
});
|
|
188
|
+
};
|
|
189
|
+
Engine.prototype.destroy = function () {
|
|
190
|
+
var _a;
|
|
191
|
+
(_a = this.recorder) === null || _a === void 0 ? void 0 : _a.clear();
|
|
192
|
+
};
|
|
193
|
+
Engine.prototype.getGlobalData = function () {
|
|
194
|
+
var _a;
|
|
195
|
+
return (_a = this.flowModel) === null || _a === void 0 ? void 0 : _a.globalData;
|
|
196
|
+
};
|
|
197
|
+
Engine.prototype.setGlobalData = function (data) {
|
|
198
|
+
if (this.flowModel) {
|
|
199
|
+
this.flowModel.globalData = data;
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
Engine.prototype.updateGlobalData = function (data) {
|
|
203
|
+
if (this.flowModel) {
|
|
204
|
+
Object.assign(this.flowModel.globalData, data);
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
return Engine;
|
|
208
|
+
}());
|
|
209
|
+
exports.Engine = Engine;
|
|
210
|
+
exports.default = Engine;
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
+
function step(op) {
|
|
27
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
+
while (_) try {
|
|
29
|
+
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;
|
|
30
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
+
switch (op[0]) {
|
|
32
|
+
case 0: case 1: t = op; break;
|
|
33
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
+
default:
|
|
37
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
+
if (t[2]) _.ops.pop();
|
|
42
|
+
_.trys.pop(); continue;
|
|
43
|
+
}
|
|
44
|
+
op = body.call(thisArg, _);
|
|
45
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
var __values = (this && this.__values) || function(o) {
|
|
50
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
51
|
+
if (m) return m.call(o);
|
|
52
|
+
if (o && typeof o.length === "number") return {
|
|
53
|
+
next: function () {
|
|
54
|
+
if (o && i >= o.length) o = void 0;
|
|
55
|
+
return { value: o && o[i++], done: !o };
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
59
|
+
};
|
|
60
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
61
|
+
var constant_1 = require("../constant/constant");
|
|
62
|
+
var expression_1 = require("../expression");
|
|
63
|
+
var BaseNode = /** @class */ (function () {
|
|
64
|
+
function BaseNode(_a) {
|
|
65
|
+
var nodeConfig = _a.nodeConfig, context = _a.context, globalData = _a.globalData;
|
|
66
|
+
this.outgoing = nodeConfig.outgoing;
|
|
67
|
+
this.incoming = nodeConfig.incoming;
|
|
68
|
+
this.nodeId = nodeConfig.id;
|
|
69
|
+
this.type = nodeConfig.type;
|
|
70
|
+
this.properties = nodeConfig.properties || {};
|
|
71
|
+
this.context = context;
|
|
72
|
+
this.globalData = globalData;
|
|
73
|
+
this.baseType = 'base';
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* 节点的每一次执行都会生成一个唯一的actionId
|
|
77
|
+
*/
|
|
78
|
+
BaseNode.prototype.execute = function (params) {
|
|
79
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
80
|
+
var r, status, outgoing, detail;
|
|
81
|
+
return __generator(this, function (_a) {
|
|
82
|
+
switch (_a.label) {
|
|
83
|
+
case 0: return [4 /*yield*/, this.action({
|
|
84
|
+
executionId: params.executionId,
|
|
85
|
+
actionId: params.actionId,
|
|
86
|
+
nodeId: this.nodeId,
|
|
87
|
+
})];
|
|
88
|
+
case 1:
|
|
89
|
+
r = _a.sent();
|
|
90
|
+
status = r ? r.status : 'success';
|
|
91
|
+
if (!(status === constant_1.ActionStatus.SUCCESS)) return [3 /*break*/, 3];
|
|
92
|
+
return [4 /*yield*/, this.getOutgoing()];
|
|
93
|
+
case 2:
|
|
94
|
+
outgoing = _a.sent();
|
|
95
|
+
detail = r ? r.detail : {};
|
|
96
|
+
params.next({
|
|
97
|
+
status: constant_1.ActionStatus.SUCCESS,
|
|
98
|
+
detail: detail,
|
|
99
|
+
executionId: params.executionId,
|
|
100
|
+
actionId: params.actionId,
|
|
101
|
+
nodeId: this.nodeId,
|
|
102
|
+
nodeType: this.type,
|
|
103
|
+
properties: this.properties,
|
|
104
|
+
outgoing: outgoing,
|
|
105
|
+
});
|
|
106
|
+
_a.label = 3;
|
|
107
|
+
case 3: return [2 /*return*/, {
|
|
108
|
+
status: status,
|
|
109
|
+
detail: r && r.detail,
|
|
110
|
+
executionId: params.executionId,
|
|
111
|
+
actionId: params.actionId,
|
|
112
|
+
nodeId: this.nodeId,
|
|
113
|
+
nodeType: this.type,
|
|
114
|
+
properties: this.properties,
|
|
115
|
+
outgoing: [],
|
|
116
|
+
}];
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
};
|
|
121
|
+
/**
|
|
122
|
+
* 节点在执行中断后,可以通过resume方法恢复执行。
|
|
123
|
+
* 自定义节点时不建议重写此方法
|
|
124
|
+
*/
|
|
125
|
+
BaseNode.prototype.resume = function (params) {
|
|
126
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
127
|
+
var outgoing;
|
|
128
|
+
return __generator(this, function (_a) {
|
|
129
|
+
switch (_a.label) {
|
|
130
|
+
case 0: return [4 /*yield*/, this.getOutgoing()];
|
|
131
|
+
case 1:
|
|
132
|
+
outgoing = _a.sent();
|
|
133
|
+
return [4 /*yield*/, this.onResume({
|
|
134
|
+
executionId: params.executionId,
|
|
135
|
+
nodeId: params.nodeId,
|
|
136
|
+
actionId: params.actionId,
|
|
137
|
+
data: params.data,
|
|
138
|
+
})];
|
|
139
|
+
case 2:
|
|
140
|
+
_a.sent();
|
|
141
|
+
params.next({
|
|
142
|
+
executionId: params.executionId,
|
|
143
|
+
actionId: params.actionId,
|
|
144
|
+
nodeId: this.nodeId,
|
|
145
|
+
nodeType: this.type,
|
|
146
|
+
properties: this.properties,
|
|
147
|
+
outgoing: outgoing,
|
|
148
|
+
status: constant_1.ActionStatus.SUCCESS,
|
|
149
|
+
});
|
|
150
|
+
return [2 /*return*/, undefined];
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
});
|
|
154
|
+
};
|
|
155
|
+
BaseNode.prototype.getOutgoing = function () {
|
|
156
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
157
|
+
var outgoing, expressions, _a, _b, item, properties, result;
|
|
158
|
+
var e_1, _c;
|
|
159
|
+
var _this = this;
|
|
160
|
+
return __generator(this, function (_d) {
|
|
161
|
+
switch (_d.label) {
|
|
162
|
+
case 0:
|
|
163
|
+
outgoing = [];
|
|
164
|
+
expressions = [];
|
|
165
|
+
try {
|
|
166
|
+
for (_a = __values(this.outgoing), _b = _a.next(); !_b.done; _b = _a.next()) {
|
|
167
|
+
item = _b.value;
|
|
168
|
+
properties = item.properties;
|
|
169
|
+
expressions.push(this.isPass(properties));
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
173
|
+
finally {
|
|
174
|
+
try {
|
|
175
|
+
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
176
|
+
}
|
|
177
|
+
finally { if (e_1) throw e_1.error; }
|
|
178
|
+
}
|
|
179
|
+
return [4 /*yield*/, Promise.all(expressions)];
|
|
180
|
+
case 1:
|
|
181
|
+
result = _d.sent();
|
|
182
|
+
result.forEach(function (item, index) {
|
|
183
|
+
var out = _this.outgoing[index];
|
|
184
|
+
out.result = item;
|
|
185
|
+
outgoing.push(out);
|
|
186
|
+
});
|
|
187
|
+
return [2 /*return*/, outgoing];
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
});
|
|
191
|
+
};
|
|
192
|
+
BaseNode.prototype.isPass = function (properties) {
|
|
193
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
194
|
+
var conditionExpression, result, e_2;
|
|
195
|
+
return __generator(this, function (_a) {
|
|
196
|
+
switch (_a.label) {
|
|
197
|
+
case 0:
|
|
198
|
+
if (!properties)
|
|
199
|
+
return [2 /*return*/, true];
|
|
200
|
+
conditionExpression = properties.conditionExpression;
|
|
201
|
+
if (!conditionExpression)
|
|
202
|
+
return [2 /*return*/, true];
|
|
203
|
+
_a.label = 1;
|
|
204
|
+
case 1:
|
|
205
|
+
_a.trys.push([1, 3, , 4]);
|
|
206
|
+
return [4 /*yield*/, expression_1.getExpressionResult("isPassResult = (" + conditionExpression + ")", __assign({}, this.globalData))];
|
|
207
|
+
case 2:
|
|
208
|
+
result = _a.sent();
|
|
209
|
+
return [2 /*return*/, result.isPassResult];
|
|
210
|
+
case 3:
|
|
211
|
+
e_2 = _a.sent();
|
|
212
|
+
return [2 /*return*/, false];
|
|
213
|
+
case 4: return [2 /*return*/];
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
});
|
|
217
|
+
};
|
|
218
|
+
/**
|
|
219
|
+
* 节点的执行逻辑
|
|
220
|
+
* @overridable 可以自定义节点重写此方法。
|
|
221
|
+
* @param params.executionId 流程执行记录ID
|
|
222
|
+
* @param params.actionId 此节点执行记录ID
|
|
223
|
+
* @param params.nodeId 节点ID
|
|
224
|
+
* @returns 返回下一步的执行参数
|
|
225
|
+
* 当不返回时,表示此节点执行成功,流程会继续执行下一步。
|
|
226
|
+
* 当返回时,返回格式
|
|
227
|
+
*/
|
|
228
|
+
BaseNode.prototype.action = function (params) {
|
|
229
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
230
|
+
return __generator(this, function (_a) {
|
|
231
|
+
return [2 /*return*/, null];
|
|
232
|
+
});
|
|
233
|
+
});
|
|
234
|
+
};
|
|
235
|
+
/**
|
|
236
|
+
* 节点的重新恢复执行逻辑
|
|
237
|
+
* @overridable 可以自定义节点重写此方法。
|
|
238
|
+
* @param params.executionId 流程执行记录ID
|
|
239
|
+
* @param params.actionId 此节点执行记录ID
|
|
240
|
+
* @param params.nodeId 节点ID
|
|
241
|
+
*/
|
|
242
|
+
BaseNode.prototype.onResume = function (params) {
|
|
243
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
244
|
+
return __generator(this, function (_a) {
|
|
245
|
+
return [2 /*return*/, undefined];
|
|
246
|
+
});
|
|
247
|
+
});
|
|
248
|
+
};
|
|
249
|
+
BaseNode.nodeTypeName = 'BaseNode';
|
|
250
|
+
return BaseNode;
|
|
251
|
+
}());
|
|
252
|
+
exports.default = BaseNode;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
extendStatics(d, b);
|
|
11
|
+
function __() { this.constructor = d; }
|
|
12
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
var BaseNode_1 = require("./BaseNode");
|
|
17
|
+
var StartNode = /** @class */ (function (_super) {
|
|
18
|
+
__extends(StartNode, _super);
|
|
19
|
+
function StartNode() {
|
|
20
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
21
|
+
_this.baseType = 'start';
|
|
22
|
+
return _this;
|
|
23
|
+
}
|
|
24
|
+
StartNode.nodeTypeName = 'StartNode';
|
|
25
|
+
return StartNode;
|
|
26
|
+
}(BaseNode_1.default));
|
|
27
|
+
exports.default = StartNode;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
extendStatics(d, b);
|
|
11
|
+
function __() { this.constructor = d; }
|
|
12
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
var BaseNode_1 = require("./BaseNode");
|
|
17
|
+
var TaskNode = /** @class */ (function (_super) {
|
|
18
|
+
__extends(TaskNode, _super);
|
|
19
|
+
function TaskNode() {
|
|
20
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
21
|
+
_this.baseType = 'task';
|
|
22
|
+
return _this;
|
|
23
|
+
}
|
|
24
|
+
TaskNode.nodeTypeName = 'TaskNode';
|
|
25
|
+
return TaskNode;
|
|
26
|
+
}(BaseNode_1.default));
|
|
27
|
+
exports.default = TaskNode;
|