bpmn-client 1.0.3 → 1.2.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 (43) hide show
  1. package/.env +4 -0
  2. package/Sample/package.json +44 -0
  3. package/Sample/test.js +30 -0
  4. package/Sample/test.ts +27 -0
  5. package/Sample/tsconfig.json +17 -0
  6. package/bpmn-client-1.2.0.tgz +0 -0
  7. package/index.js +10 -141
  8. package/index.ts +1 -139
  9. package/package.json +8 -8
  10. package/{BPMNClient.js → src/BPMNClient.js} +124 -52
  11. package/src/BPMNClient.ts +219 -0
  12. package/src/index.js +15 -0
  13. package/src/index.ts +4 -0
  14. package/src/interfaces/DataObjects.js +2 -0
  15. package/src/interfaces/DataObjects.ts +97 -0
  16. package/src/interfaces/Enums.js +117 -0
  17. package/src/interfaces/Enums.ts +71 -0
  18. package/test/.eslintrc.json +20 -0
  19. package/test/feature/.env +5 -0
  20. package/test/feature/carServer.js +117 -0
  21. package/test/helpers/setup.js +9 -0
  22. package/test/logs/Buy Used Carrepairsfalse cleaning +0 -0
  23. package/test/logs/Buy Used Carrepairstrue cleaning +0 -0
  24. package/test/logs/Buy Used Carscenario CaseId +0 -0
  25. package/test/logs/carrepairsfalse cleaning +0 -0
  26. package/test/logs/carrepairstrue cleaning +0 -0
  27. package/test/mocha.opts +5 -0
  28. package/test/resources/Invoice.js +91 -0
  29. package/test/resources/car.js +69 -0
  30. package/test/resources/loop.js +50 -0
  31. package/test.js +14 -5
  32. package/test.ts +21 -4
  33. package/test2.js +270 -0
  34. package/test2.ts +326 -0
  35. package/tsconfig.json +4 -4
  36. package/BPMNClient.d.ts +0 -36
  37. package/BPMNClient.js.map +0 -1
  38. package/BPMNClient.ts +0 -139
  39. package/index.d.ts +0 -36
  40. package/index.js.map +0 -1
  41. package/npm.list +0 -579
  42. package/test.d.ts +0 -1
  43. package/test.js.map +0 -1
@@ -9,14 +9,57 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.Engine = exports.BPMNClient = void 0;
12
+ exports.ClientDefinitions = exports.ClientDatastore = exports.ClientEngine = exports.BPMNClient = void 0;
13
+ const dotenv = require('dotenv');
14
+ const res = dotenv.config();
15
+ console.log("BPMNClient 1.2");
16
+ const https = require('https');
13
17
  const http = require('http');
14
- class BPMNClient {
15
- constructor(host, port) {
18
+ class WebService {
19
+ constructor() { }
20
+ invoke(params, options) {
21
+ return __awaiter(this, void 0, void 0, function* () {
22
+ var driver = http;
23
+ var body = JSON.stringify(params);
24
+ console.log(options, params);
25
+ if (options.port == 443)
26
+ driver = https;
27
+ let data = '';
28
+ let self = this;
29
+ return new Promise(function (resolve, reject) {
30
+ try {
31
+ driver.request(options, function (res) {
32
+ console.log('STATUS: ' + res.statusCode);
33
+ //console.log(res);
34
+ self.statusCode = res.statusCode;
35
+ res.setEncoding('utf8');
36
+ res.on('data', function (chunk) {
37
+ data += chunk;
38
+ });
39
+ res.on('end', () => {
40
+ self.result = JSON.parse(data);
41
+ resolve(self.result);
42
+ });
43
+ }).on("error", (err) => {
44
+ console.log("Error: " + err.message);
45
+ reject(err);
46
+ }).end(body);
47
+ }
48
+ catch (exc) {
49
+ console.log(exc);
50
+ }
51
+ });
52
+ });
53
+ }
54
+ }
55
+ class BPMNClient extends WebService {
56
+ constructor(host, port, apiKey) {
57
+ super();
16
58
  this.host = host;
17
59
  this.port = port;
18
- this.engine = new Engine(this);
19
- this.datastore = new Datastore(this);
60
+ this.apiKey = apiKey;
61
+ this.engine = new ClientEngine(this);
62
+ this.datastore = new ClientDatastore(this);
20
63
  }
21
64
  get(url, data = {}) {
22
65
  return __awaiter(this, void 0, void 0, function* () {
@@ -40,8 +83,8 @@ class BPMNClient {
40
83
  }
41
84
  request(url, method, params) {
42
85
  return __awaiter(this, void 0, void 0, function* () {
43
- var options;
44
86
  var body = JSON.stringify(params);
87
+ var options;
45
88
  if (params) {
46
89
  options = {
47
90
  host: this.host,
@@ -50,6 +93,11 @@ class BPMNClient {
50
93
  method: method,
51
94
  headers: {
52
95
  "Content-Type": "application/json",
96
+ "x-api-key": this.apiKey,
97
+ "Accept": "*/*",
98
+ // "User-Agent": "PostmanRuntime/ 7.26.8",
99
+ // "Accept-Encoding": "gzip, deflate, br",
100
+ "Connection": "keep-alive",
53
101
  "Content-Length": Buffer.byteLength(body)
54
102
  }
55
103
  };
@@ -62,77 +110,74 @@ class BPMNClient {
62
110
  method: method
63
111
  };
64
112
  }
65
- console.log(options);
66
- let data = '';
67
- let self = this;
68
- return new Promise(function (resolve, reject) {
69
- try {
70
- http.request(options, function (res) {
71
- console.log('STATUS: ' + res.statusCode);
72
- // console.log('HEADERS: ' + JSON.stringify(res.headers));
73
- self.statusCode = res.statusCode;
74
- res.setEncoding('utf8');
75
- res.on('data', function (chunk) {
76
- data += chunk;
77
- });
78
- res.on('end', () => {
79
- // console.log(JSON.parse(data));
80
- self.result = JSON.parse(data);
81
- resolve(self.result);
82
- });
83
- }).on("error", (err) => {
84
- console.log("Error: " + err.message);
85
- reject(err);
86
- }).end(body);
87
- }
88
- catch (exc) {
89
- console.log(exc);
90
- }
91
- });
113
+ return yield this.invoke(params, options);
92
114
  });
93
115
  }
94
- getItem(id) {
95
- if (!this.result.instance) {
96
- console.log(this.result);
97
- return;
98
- }
99
- return this.result.instance.items.filter(item => { return item.elementId == id; })[0];
100
- }
101
116
  }
102
117
  exports.BPMNClient = BPMNClient;
103
- class Engine {
118
+ class ClientEngine {
104
119
  constructor(client) {
105
120
  this.client = client;
106
121
  }
107
- start({ name, data }) {
122
+ start(name, data) {
108
123
  return __awaiter(this, void 0, void 0, function* () {
109
- return yield this.client.post('engine/start', { name, data });
124
+ const ret = yield this.client.post('engine/start', { name, data });
125
+ if (ret['errors']) {
126
+ console.log(ret['errors']);
127
+ throw new Error(ret['errors']);
128
+ }
129
+ const instance = ret;
130
+ return instance;
110
131
  });
111
132
  }
112
- invoke({ query, data }) {
133
+ invoke(query, data) {
113
134
  return __awaiter(this, void 0, void 0, function* () {
114
- return yield this.client.put('engine/invoke', { query, data });
135
+ const ret = yield this.client.put('engine/invoke', { query, data });
136
+ if (ret['errors']) {
137
+ console.log(ret['errors']);
138
+ throw new Error(ret['errors']);
139
+ }
140
+ const instance = ret['instance'];
141
+ return instance;
115
142
  });
116
143
  }
117
144
  get(query) {
118
145
  return __awaiter(this, void 0, void 0, function* () {
119
- return yield this.client.get('engine/get', query);
146
+ const ret = yield this.client.get('engine/get', query);
147
+ if (ret['errors']) {
148
+ console.log(ret['errors']);
149
+ throw new Error(ret['errors']);
150
+ }
151
+ const instance = ret['instance'];
152
+ return instance;
120
153
  });
121
154
  }
122
155
  }
123
- exports.Engine = Engine;
124
- class Datastore {
156
+ exports.ClientEngine = ClientEngine;
157
+ class ClientDatastore {
125
158
  constructor(client) {
126
159
  this.client = client;
127
160
  }
128
161
  findItems(query) {
129
162
  return __awaiter(this, void 0, void 0, function* () {
130
- return yield this.client.get('datastore/findItems', query);
163
+ var res = yield this.client.get('datastore/findItems', query);
164
+ if (res['errors']) {
165
+ console.log(res['errors']);
166
+ throw new Error(res['errors']);
167
+ }
168
+ const items = res['items'];
169
+ return items;
131
170
  });
132
171
  }
133
- findInsances(query) {
172
+ findInstances(query) {
134
173
  return __awaiter(this, void 0, void 0, function* () {
135
- return yield this.client.get('datastore/findInstances', query);
174
+ const res = yield this.client.get('datastore/findInstances', query);
175
+ if (res['errors']) {
176
+ console.log(res['errors']);
177
+ throw new Error(res['errors']);
178
+ }
179
+ const instances = res['instances'];
180
+ return instances;
136
181
  });
137
182
  }
138
183
  deleteInstances(query) {
@@ -141,4 +186,31 @@ class Datastore {
141
186
  });
142
187
  }
143
188
  }
144
- //# sourceMappingURL=BPMNClient.js.map
189
+ exports.ClientDatastore = ClientDatastore;
190
+ class ClientDefinitions {
191
+ constructor(client) {
192
+ this.client = client;
193
+ }
194
+ list() {
195
+ return __awaiter(this, void 0, void 0, function* () {
196
+ var res = yield this.client.get('definitions/list', []);
197
+ if (res['errors']) {
198
+ console.log(res['errors']);
199
+ throw new Error(res['errors']);
200
+ }
201
+ return res;
202
+ });
203
+ }
204
+ load(name) {
205
+ return __awaiter(this, void 0, void 0, function* () {
206
+ const res = yield this.client.get(encodeURI('definitions/load/' + name), { name: name });
207
+ if (res['errors']) {
208
+ console.log(res['errors']);
209
+ throw new Error(res['errors']);
210
+ }
211
+ console.log(res);
212
+ return res;
213
+ });
214
+ }
215
+ }
216
+ exports.ClientDefinitions = ClientDefinitions;
@@ -0,0 +1,219 @@
1
+ import { IInstanceData, IItemData , IDefinitionData} from './interfaces/DataObjects';
2
+
3
+
4
+ const dotenv = require('dotenv');
5
+ const res = dotenv.config();
6
+
7
+ console.log("BPMNClient 1.2");
8
+
9
+ const https = require('https');
10
+ const http = require('http');
11
+
12
+ class WebService {
13
+ statusCode;
14
+ result;
15
+ constructor() { }
16
+ async invoke(params, options) {
17
+
18
+ var driver = http;
19
+ var body = JSON.stringify(params);
20
+
21
+ console.log(options, params);
22
+ if (options.port == 443)
23
+ driver = https;
24
+
25
+ let data = '';
26
+ let self = this;
27
+ return new Promise(function (resolve, reject) {
28
+ try {
29
+
30
+ driver.request(options, function (res) {
31
+ console.log('STATUS: ' + res.statusCode);
32
+ //console.log(res);
33
+ self.statusCode = res.statusCode;
34
+ res.setEncoding('utf8');
35
+ res.on('data', function (chunk) {
36
+ data += chunk;
37
+ });
38
+ res.on('end', () => {
39
+ self.result = JSON.parse(data);
40
+
41
+ resolve(self.result);
42
+ });
43
+
44
+
45
+ }).on("error", (err) => {
46
+ console.log("Error: " + err.message);
47
+ reject(err);
48
+ }).end(body);
49
+ }
50
+ catch (exc) {
51
+ console.log(exc);
52
+ }
53
+
54
+ });
55
+
56
+ }
57
+ }
58
+ class BPMNClient extends WebService {
59
+ host;
60
+ port;
61
+ apiKey;
62
+ engine: ClientEngine;
63
+ datastore: ClientDatastore;
64
+ constructor(host, port, apiKey) {
65
+ super();
66
+ this.host = host;
67
+ this.port = port;
68
+ this.apiKey = apiKey;
69
+ this.engine = new ClientEngine(this);
70
+ this.datastore = new ClientDatastore(this);
71
+ }
72
+
73
+ async get(url, data = {}) {
74
+ return await this.request(url, 'GET', data);
75
+
76
+ }
77
+ async post(url, data = {}) {
78
+ return await this.request(url, 'POST', data);
79
+
80
+ }
81
+ async put(url, data = {}) {
82
+ return await this.request(url, 'PUT', data);
83
+
84
+ }
85
+ async del(url, data = {}) {
86
+ return await this.request(url, 'DELETE', data);
87
+
88
+ }
89
+ async request(url, method, params) {
90
+
91
+ var body = JSON.stringify(params);
92
+
93
+ var options;
94
+
95
+ if (params) {
96
+ options = {
97
+ host: this.host,
98
+ port: this.port,
99
+ path: '/api/' + url,
100
+ method: method,
101
+ headers: {
102
+ "Content-Type": "application/json",
103
+ "x-api-key": this.apiKey,
104
+ "Accept": "*/*",
105
+ // "User-Agent": "PostmanRuntime/ 7.26.8",
106
+ // "Accept-Encoding": "gzip, deflate, br",
107
+ "Connection": "keep-alive",
108
+ "Content-Length": Buffer.byteLength(body)
109
+ }
110
+ };
111
+ }
112
+ else {
113
+ options = {
114
+ host: this.host,
115
+ port: this.port,
116
+ path: '/api/' + url,
117
+ method: method
118
+ };
119
+ }
120
+
121
+
122
+ return await this.invoke(params, options);
123
+
124
+ }
125
+
126
+ }
127
+
128
+ class ClientEngine {
129
+ private client: BPMNClient;
130
+
131
+ constructor(client) {
132
+ this.client = client;
133
+ }
134
+ async start(name, data): Promise<IInstanceData> {
135
+ const ret = await this.client.post('engine/start', { name, data });
136
+ if (ret['errors']) {
137
+ console.log(ret['errors']);
138
+ throw new Error(ret['errors']);
139
+ }
140
+ const instance = ret as IInstanceData;
141
+ return instance;
142
+ }
143
+ async invoke(query, data): Promise<IInstanceData> {
144
+ const ret = await this.client.put('engine/invoke', { query, data });
145
+ if (ret['errors']) {
146
+ console.log(ret['errors']);
147
+ throw new Error(ret['errors']);
148
+ }
149
+ const instance = ret['instance'] as IInstanceData;
150
+ return instance;
151
+ }
152
+
153
+ async get(query): Promise<IInstanceData> {
154
+ const ret = await this.client.get('engine/get', query);
155
+ if (ret['errors']) {
156
+ console.log(ret['errors']);
157
+ throw new Error(ret['errors']);
158
+ }
159
+ const instance = ret['instance'] as IInstanceData;
160
+ return instance;
161
+ }
162
+ }
163
+ class ClientDatastore {
164
+ private client: BPMNClient;
165
+
166
+ constructor(client) {
167
+ this.client = client;
168
+ }
169
+ async findItems(query): Promise<IItemData[]> {
170
+ var res = await this.client.get('datastore/findItems', query);
171
+ if (res['errors']) {
172
+ console.log(res['errors']);
173
+ throw new Error(res['errors']);
174
+ }
175
+ const items = res['items'] as IItemData[];
176
+ return items;
177
+
178
+ }
179
+ async findInstances(query): Promise<IInstanceData[]> {
180
+ const res = await this.client.get('datastore/findInstances', query);
181
+ if (res['errors']) {
182
+ console.log(res['errors']);
183
+ throw new Error(res['errors']);
184
+ }
185
+ const instances = res['instances'] as IInstanceData[];
186
+ return instances;
187
+ }
188
+ async deleteInstances(query) {
189
+ return await this.client.del('datastore/delete', query);
190
+ }
191
+ }
192
+ class ClientDefinitions {
193
+ private client: BPMNClient;
194
+
195
+ constructor(client) {
196
+ this.client = client;
197
+ }
198
+ async list(): Promise<string[]> {
199
+ var res = await this.client.get('definitions/list', []);
200
+ if (res['errors']) {
201
+ console.log(res['errors']);
202
+ throw new Error(res['errors']);
203
+ }
204
+ return res as string[];
205
+
206
+ }
207
+ async load(name): Promise<IDefinitionData> {
208
+ const res = await this.client.get(encodeURI('definitions/load/' + name), { name: name });
209
+ if (res['errors']) {
210
+ console.log(res['errors']);
211
+ throw new Error(res['errors']);
212
+ }
213
+ console.log(res);
214
+ return res as IDefinitionData;
215
+ }
216
+ }
217
+
218
+
219
+ export { BPMNClient , ClientEngine,ClientDatastore , ClientDefinitions}
package/src/index.js ADDED
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./interfaces/Enums"), exports);
14
+ __exportStar(require("./interfaces/DataObjects"), exports);
15
+ __exportStar(require("./BPMNClient"), exports);
package/src/index.ts ADDED
@@ -0,0 +1,4 @@
1
+ export * from './interfaces/Enums';
2
+ export * from './interfaces/DataObjects';
3
+ export * from './BPMNClient';
4
+
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,97 @@
1
+ import { ITEM_STATUS, } from './Enums';
2
+
3
+ interface IItemData {
4
+ id: string; // System generated unique Id
5
+ itemKey: string; // application assigned key to call the item by
6
+ elementId: string; // bpmn element
7
+ name: string; // name of bpmn element
8
+ type: string; // bpmn element type
9
+ tokenId: any; // execution Token
10
+ userId: any;
11
+ startedAt: any;
12
+ endedAt: any;
13
+ seq: any;
14
+ timeDue: Date;
15
+ status: ITEM_STATUS;
16
+ data: any;
17
+ messageId;
18
+ signalId;
19
+ assignments;
20
+ authorizations;
21
+ notifications;
22
+ }
23
+ interface IInstanceData {
24
+ id;
25
+ name;
26
+ status;
27
+ startedAt;
28
+ endedAt;
29
+ saved;
30
+ data;
31
+ items;
32
+ source;
33
+ logs;
34
+ tokens;
35
+ loops;
36
+ parentItemId; // used for subProcess Calls
37
+ involvements;
38
+ authorizations;
39
+ }
40
+
41
+
42
+
43
+ interface IDefinitionData {
44
+ name: any;
45
+ processes: Map<any, any>;
46
+ rootElements: any;
47
+ nodes: Map<any, any>;
48
+ flows: any[];
49
+ source: any;
50
+ logger: any;
51
+ accessRules: any[];
52
+ }
53
+
54
+
55
+ interface IElementData {
56
+ id: any;
57
+ type: any;
58
+ name: any;
59
+ behaviours: Map<any, any>;
60
+ }
61
+
62
+ interface IFlowData {
63
+
64
+ }
65
+
66
+ interface IEventData {
67
+ elementId: string;
68
+ processId: string;
69
+ type;
70
+ name;
71
+ subType;
72
+ signalId?: string;
73
+ messageId?: string;
74
+ // timer info
75
+ expression;
76
+ expressionFormat; // cron/iso
77
+ referenceDateTime; // start time of event or last time timer ran
78
+ maxRepeat;
79
+ repeatCount;
80
+ timeDue?: Date;
81
+
82
+ }
83
+ interface IBpmnModelData {
84
+ name;
85
+ source;
86
+ svg;
87
+ processes: IProcessData[];
88
+ events: IEventData[];
89
+ saved;
90
+ // parse(definition: IDefinition);
91
+ }
92
+ interface IProcessData {
93
+ id;
94
+ name;
95
+ isExecutable;
96
+ }
97
+ export { IItemData, IInstanceData , IDefinitionData, IElementData, IFlowData , IBpmnModelData, IProcessData, IEventData }
@@ -0,0 +1,117 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NODE_SUBTYPE = exports.EXECUTION_STATUS = exports.TOKEN_STATUS = exports.ITEM_STATUS = exports.FLOW_ACTION = exports.NODE_ACTION = exports.EXECUTION_EVENT = exports.BPMN_TYPE = void 0;
4
+ var BPMN_TYPE;
5
+ (function (BPMN_TYPE) {
6
+ BPMN_TYPE["UserTask"] = "bpmn:UserTask";
7
+ BPMN_TYPE["ScriptTask"] = "bpmn:ScriptTask";
8
+ BPMN_TYPE["ServiceTask"] = "bpmn:ServiceTask";
9
+ BPMN_TYPE["SendTask"] = "bpmn:SendTask";
10
+ BPMN_TYPE["ReceiveTask"] = "bpmn:ReceiveTask";
11
+ BPMN_TYPE["BusinessRuleTask"] = "bpmn:BusinessRuleTask";
12
+ BPMN_TYPE["SubProcess"] = "bpmn:SubProces";
13
+ BPMN_TYPE["ParallelGateway"] = "bpmn:ParallelGateway";
14
+ BPMN_TYPE["EventBasedGateway"] = "bpmn:EventBasedGateway";
15
+ BPMN_TYPE["InclusiveGateway"] = "bpmn:InclusiveGateway";
16
+ BPMN_TYPE["ExclusiveGateway"] = "bpmn:ExclusiveGateway";
17
+ BPMN_TYPE["BoundaryEvent"] = "bpmn:BoundaryEvent";
18
+ BPMN_TYPE["StartEvent"] = "bpmn:StartEvent";
19
+ BPMN_TYPE["IntermediateCatchEvent"] = "bpmn:IntermediateCatchEvent";
20
+ BPMN_TYPE["IntermediateThrowEvent"] = "bpmn:IntermediateThrowEvent";
21
+ BPMN_TYPE["EndEvent"] = "bpmn:EndEvent";
22
+ BPMN_TYPE["SequenceFlow"] = "bpmn:SequenceFlow";
23
+ BPMN_TYPE["MessageFlow"] = "bpmn:MessageFlow";
24
+ BPMN_TYPE["CallActivity"] = "bpmn:CallActivity";
25
+ })(BPMN_TYPE || (BPMN_TYPE = {}));
26
+ exports.BPMN_TYPE = BPMN_TYPE;
27
+ var NODE_SUBTYPE;
28
+ (function (NODE_SUBTYPE) {
29
+ NODE_SUBTYPE["timer"] = "timer";
30
+ NODE_SUBTYPE["message"] = "message";
31
+ NODE_SUBTYPE["signal"] = "signal";
32
+ NODE_SUBTYPE["error"] = "error";
33
+ NODE_SUBTYPE["escalation"] = "escalation";
34
+ })(NODE_SUBTYPE || (NODE_SUBTYPE = {}));
35
+ exports.NODE_SUBTYPE = NODE_SUBTYPE;
36
+ /*
37
+ * ALL events
38
+ */
39
+ var EXECUTION_EVENT;
40
+ (function (EXECUTION_EVENT) {
41
+ EXECUTION_EVENT["node_enter"] = "enter";
42
+ EXECUTION_EVENT["node_start"] = "start";
43
+ EXECUTION_EVENT["node_wait"] = "wait";
44
+ EXECUTION_EVENT["node_end"] = "end";
45
+ EXECUTION_EVENT["node_terminated"] = "terminated";
46
+ EXECUTION_EVENT["transform_input"] = "transformInput";
47
+ EXECUTION_EVENT["transform_output"] = "transformOutput";
48
+ EXECUTION_EVENT["flow_take"] = "take";
49
+ EXECUTION_EVENT["flow_discard"] = "discard";
50
+ EXECUTION_EVENT["process_loaded"] = "process.loaded";
51
+ EXECUTION_EVENT["process_start"] = "process.start";
52
+ EXECUTION_EVENT["process_started"] = "process.started";
53
+ EXECUTION_EVENT["process_invoke"] = "process.invoke";
54
+ EXECUTION_EVENT["process_invoked"] = "process.invoked";
55
+ EXECUTION_EVENT["process_restored"] = "process.restored";
56
+ EXECUTION_EVENT["process_resumed"] = "process_resumed";
57
+ EXECUTION_EVENT["process_wait"] = "process.wait";
58
+ EXECUTION_EVENT["process_end"] = "process.end";
59
+ EXECUTION_EVENT["process_terminated"] = "executeion.terminate";
60
+ EXECUTION_EVENT["token_start"] = "token.start";
61
+ EXECUTION_EVENT["token_wait"] = "token.wait";
62
+ EXECUTION_EVENT["token_end"] = "token.end";
63
+ EXECUTION_EVENT["token_terminated"] = "token.terminated";
64
+ })(EXECUTION_EVENT || (EXECUTION_EVENT = {}));
65
+ exports.EXECUTION_EVENT = EXECUTION_EVENT;
66
+ /*
67
+ * possible actions by node
68
+ */
69
+ // must be same as above
70
+ var NODE_ACTION;
71
+ (function (NODE_ACTION) {
72
+ NODE_ACTION[NODE_ACTION["continue"] = 1] = "continue";
73
+ NODE_ACTION[NODE_ACTION["wait"] = 2] = "wait";
74
+ NODE_ACTION[NODE_ACTION["end"] = 3] = "end";
75
+ NODE_ACTION[NODE_ACTION["stop"] = 4] = "stop";
76
+ NODE_ACTION[NODE_ACTION["error"] = 5] = "error";
77
+ NODE_ACTION[NODE_ACTION["abort"] = 6] = "abort";
78
+ })(NODE_ACTION || (NODE_ACTION = {}));
79
+ exports.NODE_ACTION = NODE_ACTION;
80
+ ;
81
+ var ITEM_STATUS;
82
+ (function (ITEM_STATUS) {
83
+ ITEM_STATUS["enter"] = "enter";
84
+ ITEM_STATUS["start"] = "start";
85
+ ITEM_STATUS["wait"] = "wait";
86
+ ITEM_STATUS["end"] = "end";
87
+ ITEM_STATUS["terminated"] = "terminated";
88
+ ITEM_STATUS["discard"] = "discard";
89
+ })(ITEM_STATUS || (ITEM_STATUS = {}));
90
+ exports.ITEM_STATUS = ITEM_STATUS;
91
+ //type ITEMSTATUS = 'enter' | 'start' | 'wait' | 'end' | 'terminated' | 'discard';
92
+ var EXECUTION_STATUS;
93
+ (function (EXECUTION_STATUS) {
94
+ EXECUTION_STATUS["running"] = "running";
95
+ EXECUTION_STATUS["wait"] = "wait";
96
+ EXECUTION_STATUS["end"] = "end";
97
+ EXECUTION_STATUS["terminated"] = "terminated";
98
+ })(EXECUTION_STATUS || (EXECUTION_STATUS = {}));
99
+ exports.EXECUTION_STATUS = EXECUTION_STATUS;
100
+ var TOKEN_STATUS;
101
+ (function (TOKEN_STATUS) {
102
+ TOKEN_STATUS["running"] = "running";
103
+ TOKEN_STATUS["wait"] = "wait";
104
+ TOKEN_STATUS["end"] = "end";
105
+ TOKEN_STATUS["terminated"] = "terminated";
106
+ })(TOKEN_STATUS || (TOKEN_STATUS = {}));
107
+ exports.TOKEN_STATUS = TOKEN_STATUS;
108
+ /*
109
+ * possible actions by flow
110
+ */
111
+ // must be same as above
112
+ var FLOW_ACTION;
113
+ (function (FLOW_ACTION) {
114
+ FLOW_ACTION["take"] = "take";
115
+ FLOW_ACTION["discard"] = "discard";
116
+ })(FLOW_ACTION || (FLOW_ACTION = {}));
117
+ exports.FLOW_ACTION = FLOW_ACTION;