bpmn-client 1.3.17 → 1.3.23

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/src/BPMNClient.ts CHANGED
@@ -1,104 +1,8 @@
1
1
  import { IInstanceData, IItemData , IDefinitionData} from './interfaces/DataObjects';
2
-
2
+ import {WebService} from './WebService';
3
3
  console.log("BPMNClient 1.2");
4
4
 
5
- const https = require('https');
6
- const http = require('http');
7
- const fs = require("fs");
8
-
9
- class WebService {
10
- statusCode;
11
- result;
12
- response;
13
- constructor() { }
14
-
15
- async invoke(params, options, postData = null) {
16
-
17
- var axios = require('axios');
18
-
19
- var data = JSON.stringify(params);
20
- var url = 'http://'+options.host+':'+options.port+options.path;
21
-
22
- if (options.port == 443)
23
- url = 'https://'+options.host+options.path;
24
-
25
- var config = {
26
- method: options.method,
27
- url: url,
28
- headers: options.headers,
29
- data: data
30
- };
31
-
32
- let self = this;
33
-
34
- let response = await axios(config);
35
- self.result = response.data;
36
-
37
- return response.data;
38
- }
39
- async invokeOld(params, options,postData=null) {
40
-
41
- var driver = http;
42
-
43
- var body = JSON.stringify(params);
44
- console.log('invoke:');
45
- console.log('options:',options, params);
46
- if (options.port == 443)
47
- driver = https;
48
-
49
- let data = '';
50
- let self = this;
51
- return new Promise(function (resolve, reject) {
52
- try {
53
-
54
- var req = driver.request(options, function (res) {
55
- console.log('STATUS: ' + res.statusCode);
56
- this.response = res;
57
- //console.log(res);
58
- self.statusCode = res.statusCode;
59
- res.setEncoding('utf8');
60
- res.on('data', function (chunk) {
61
- console.log('>>chunk', chunk);
62
- data += chunk;
63
- });
64
- res.on('end', () => {
65
- console.log('response end');
66
- try {
67
- if (data == null)
68
- console.log("empty response");
69
- console.log('data:', data);
70
-
71
- self.result = JSON.parse(data);
72
- resolve(self.result);
73
- }
74
- catch (exc) {
75
- console.log(data);
76
- console.log(exc);
77
- }
78
- });
79
-
80
-
81
- });
82
- req.on("error", (err) => {
83
- console.log("Error: " + err.message);
84
- reject(err);
85
- });
86
- if (postData !== null)
87
- req.write(postData);
88
- else
89
- req.write('');
90
- console.log('request ending',body);
91
- req.end(body);
92
- console.log('request ended');
93
- }
94
- catch (exc) {
95
- console.log(exc);
96
- }
97
-
98
- });
99
5
 
100
- }
101
- }
102
6
  class BPMNClient extends WebService {
103
7
  host;
104
8
  port;
@@ -109,7 +13,7 @@ class BPMNClient extends WebService {
109
13
 
110
14
  constructor(host, port, apiKey) {
111
15
  super();
112
- ;
16
+
113
17
  this.host = host;
114
18
  this.port = port;
115
19
  this.apiKey = apiKey;
@@ -135,49 +39,6 @@ class BPMNClient extends WebService {
135
39
 
136
40
  }
137
41
 
138
- async upload(url, fileName, path) {
139
- console.log('upload');
140
- var options = {
141
- 'method': 'POST',
142
- 'hostname': this.host,
143
- 'port': this.port,
144
- 'path': '/api/'+ url + '/' + fileName,
145
- 'headers': {
146
- 'x-api-key': this.apiKey
147
- },
148
- 'maxRedirects': 20
149
- };
150
- var req = http.request(options, function (res) {
151
- var chunks = [];
152
-
153
- res.on("data", function (chunk) {
154
- chunks.push(chunk);
155
- });
156
-
157
- res.on("end", function (chunk) {
158
- var body = Buffer.concat(chunks);
159
- console.log(body.toString());
160
- });
161
-
162
- res.on("error", function (error) {
163
- console.error(error);
164
- });
165
- });
166
-
167
- var postData = "------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"file\"; filename=\""
168
- + fileName + "\"\r\nContent-Type: \"text/plain\"\r\n\r\n" +
169
- fs.readFileSync(path) + "\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--";
170
-
171
- req.setHeader('content-type', 'multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW');
172
-
173
- req.write(postData);
174
-
175
- req.end();
176
-
177
- return req;
178
- }
179
-
180
-
181
42
  async request(url, method, params) {
182
43
 
183
44
  var body = JSON.stringify(params);
@@ -324,12 +185,24 @@ class ClientDefinitions {
324
185
  constructor(client) {
325
186
  this.client = client;
326
187
  }
327
-
328
188
 
329
189
  async import(name, path) {
330
190
 
331
- var res = await this.client.upload('definitions/import',name,path);
191
+ var options = {
192
+ 'method': 'POST',
193
+ 'hostname': this.client.host,
194
+ 'port': this.client.port,
195
+ 'path': '/api/definitions/import/' + name,
196
+ 'headers': {
197
+ 'x-api-key': this.client.apiKey
198
+ },
199
+ 'maxRedirects': 20
200
+ };
332
201
 
202
+ console.log('import ',name,path);
203
+ var res = await this.client.upload(name,path,options);
204
+ console.log('import done ',res);
205
+ this.checkErrors(res);
333
206
  return res;
334
207
 
335
208
  }
@@ -371,6 +244,12 @@ class ClientDefinitions {
371
244
  console.log(res);
372
245
  return res as IDefinitionData;
373
246
  }
247
+ checkErrors(res) {
248
+ if (res['errors']) {
249
+ console.log(res['errors']);
250
+ throw new Error(res['errors']);
251
+ }
252
+ }
374
253
  }
375
254
 
376
255
 
@@ -0,0 +1,78 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.WebService = void 0;
13
+ const https = require('https');
14
+ const http = require('http');
15
+ const fs = require("fs");
16
+ const axios = require('axios');
17
+ const FormData = require('form-data');
18
+ class WebService {
19
+ constructor() { }
20
+ invoke(params, options, postData = null) {
21
+ return __awaiter(this, void 0, void 0, function* () {
22
+ var data = JSON.stringify(params);
23
+ var url = 'http://' + options.host + ':' + options.port + options.path;
24
+ if (options.port == 443)
25
+ url = 'https://' + options.host + options.path;
26
+ var config = {
27
+ method: options.method,
28
+ url: url,
29
+ headers: options.headers,
30
+ data: data
31
+ };
32
+ let self = this;
33
+ try {
34
+ let response = yield axios(config);
35
+ self.result = response.data;
36
+ return response.data;
37
+ }
38
+ catch (err) {
39
+ console.log('** Connection failed ***', err);
40
+ }
41
+ });
42
+ }
43
+ upload(fileName, path, options) {
44
+ return __awaiter(this, void 0, void 0, function* () {
45
+ const fileContents = fs.createReadStream(path);
46
+ const title = fileName;
47
+ var url = 'http://' + options.hostname + ':' + options.port + options.path;
48
+ if (options.port == 443)
49
+ url = 'https://' + options.host + options.path;
50
+ const form = new FormData();
51
+ form.append('title', 'title');
52
+ form.append('file', fileContents);
53
+ try {
54
+ const response = yield axios.post(url, form, {
55
+ headers: options.headers
56
+ });
57
+ console.log('Response Status:', response.status, response.data);
58
+ return response.data;
59
+ }
60
+ catch (error) {
61
+ console.log('upload failed:', error.message);
62
+ throw new Error(error.message);
63
+ /*
64
+ if (error.response) { // get response with a status code not in range 2xx
65
+ console.log(error.response.data);
66
+ console.log(error.response.status);
67
+ console.log(error.response.headers);
68
+ } else if (error.request) { // no response
69
+ console.log(error.request);
70
+ } else { // Something wrong in setting up the request
71
+ console.log('Error', error.message);
72
+ }
73
+ console.log(error.config); */
74
+ }
75
+ });
76
+ }
77
+ }
78
+ exports.WebService = WebService;
@@ -0,0 +1,85 @@
1
+
2
+ const https = require('https');
3
+ const http = require('http');
4
+ const fs = require("fs");
5
+ const axios = require('axios');
6
+ const FormData = require('form-data');
7
+
8
+ class WebService {
9
+ statusCode;
10
+ result;
11
+ response;
12
+ constructor() { }
13
+
14
+ async invoke(params, options, postData = null) {
15
+
16
+
17
+ var data = JSON.stringify(params);
18
+ var url = 'http://'+options.host+':'+options.port+options.path;
19
+
20
+ if (options.port == 443)
21
+ url = 'https://'+options.host+options.path;
22
+
23
+ var config = {
24
+ method: options.method,
25
+ url: url,
26
+ headers: options.headers,
27
+ data: data
28
+ };
29
+
30
+ let self = this;
31
+ try {
32
+ let response = await axios(config);
33
+ self.result = response.data;
34
+
35
+ return response.data;
36
+ }
37
+ catch(err)
38
+ {
39
+ console.log('** Connection failed ***',err);
40
+ }
41
+ }
42
+
43
+ async upload(fileName, path, options) {
44
+
45
+ const fileContents = fs.createReadStream(path);
46
+ const title = fileName;
47
+
48
+ var url = 'http://'+options.hostname+':'+options.port+options.path;
49
+
50
+ if (options.port == 443)
51
+ url = 'https://'+options.host+options.path;
52
+
53
+
54
+ const form = new FormData();
55
+ form.append('title', 'title');
56
+ form.append('file', fileContents);
57
+
58
+ try {
59
+
60
+ const response = await axios.post(url, form, {
61
+ headers: options.headers });
62
+
63
+ console.log('Response Status:',response.status,response.data);
64
+ return response.data;
65
+
66
+ }
67
+ catch (error) {
68
+ console.log('upload failed:',error.message);
69
+ throw new Error(error.message);
70
+ /*
71
+ if (error.response) { // get response with a status code not in range 2xx
72
+ console.log(error.response.data);
73
+ console.log(error.response.status);
74
+ console.log(error.response.headers);
75
+ } else if (error.request) { // no response
76
+ console.log(error.request);
77
+ } else { // Something wrong in setting up the request
78
+ console.log('Error', error.message);
79
+ }
80
+ console.log(error.config); */
81
+ }
82
+ }
83
+
84
+ }
85
+ export {WebService }
package/src/index.js CHANGED
@@ -1,15 +1,19 @@
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);
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./interfaces/Enums"), exports);
18
+ __exportStar(require("./interfaces/DataObjects"), exports);
19
+ __exportStar(require("./BPMNClient"), exports);
@@ -1,2 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -6,6 +6,7 @@ interface IItemData {
6
6
  elementId: string; // bpmn element
7
7
  name: string; // name of bpmn element
8
8
  type: string; // bpmn element type
9
+ instanceId: string; // Instance Id of the item
9
10
  tokenId: any; // execution Token
10
11
  userId: any;
11
12
  startedAt: any;
@@ -19,6 +20,7 @@ interface IItemData {
19
20
  assignments;
20
21
  authorizations;
21
22
  notifications;
23
+ vars;
22
24
  }
23
25
  interface IInstanceData {
24
26
  id;
@@ -1,120 +1,112 @@
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:SubProcess";
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["cancel"] = "cancel";
35
- NODE_SUBTYPE["compensate"] = "compensate";
36
- })(NODE_SUBTYPE || (NODE_SUBTYPE = {}));
37
- exports.NODE_SUBTYPE = NODE_SUBTYPE;
38
- /*
39
- * ALL events
40
- */
41
- var EXECUTION_EVENT;
42
- (function (EXECUTION_EVENT) {
43
- EXECUTION_EVENT["node_enter"] = "enter";
44
- EXECUTION_EVENT["node_start"] = "start";
45
- EXECUTION_EVENT["node_wait"] = "wait";
46
- EXECUTION_EVENT["node_end"] = "end";
47
- EXECUTION_EVENT["node_terminated"] = "terminated";
48
- EXECUTION_EVENT["transform_input"] = "transformInput";
49
- EXECUTION_EVENT["transform_output"] = "transformOutput";
50
- EXECUTION_EVENT["flow_take"] = "take";
51
- EXECUTION_EVENT["flow_discard"] = "discard";
52
- EXECUTION_EVENT["process_loaded"] = "process.loaded";
53
- EXECUTION_EVENT["process_start"] = "process.start";
54
- EXECUTION_EVENT["process_started"] = "process.started";
55
- EXECUTION_EVENT["process_invoke"] = "process.invoke";
56
- EXECUTION_EVENT["process_invoked"] = "process.invoked";
57
- EXECUTION_EVENT["process_restored"] = "process.restored";
58
- EXECUTION_EVENT["process_resumed"] = "process_resumed";
59
- EXECUTION_EVENT["process_wait"] = "process.wait";
60
- EXECUTION_EVENT["process_end"] = "process.end";
61
- EXECUTION_EVENT["process_terminated"] = "process.terminated";
62
- EXECUTION_EVENT["token_start"] = "token.start";
63
- EXECUTION_EVENT["token_wait"] = "token.wait";
64
- EXECUTION_EVENT["token_end"] = "token.end";
65
- EXECUTION_EVENT["token_terminated"] = "token.terminated";
66
- })(EXECUTION_EVENT || (EXECUTION_EVENT = {}));
67
- exports.EXECUTION_EVENT = EXECUTION_EVENT;
68
- /*
69
- * possible actions by node
70
- */
71
- // must be same as above
72
- var NODE_ACTION;
73
- (function (NODE_ACTION) {
74
- NODE_ACTION[NODE_ACTION["continue"] = 1] = "continue";
75
- NODE_ACTION[NODE_ACTION["wait"] = 2] = "wait";
76
- NODE_ACTION[NODE_ACTION["end"] = 3] = "end";
77
- NODE_ACTION[NODE_ACTION["stop"] = 4] = "stop";
78
- NODE_ACTION[NODE_ACTION["error"] = 5] = "error";
79
- NODE_ACTION[NODE_ACTION["abort"] = 6] = "abort";
80
- })(NODE_ACTION || (NODE_ACTION = {}));
81
- exports.NODE_ACTION = NODE_ACTION;
82
- ;
83
- var ITEM_STATUS;
84
- (function (ITEM_STATUS) {
85
- ITEM_STATUS["enter"] = "enter";
86
- ITEM_STATUS["start"] = "start";
87
- ITEM_STATUS["wait"] = "wait";
88
- ITEM_STATUS["end"] = "end";
89
- ITEM_STATUS["terminated"] = "terminated";
90
- ITEM_STATUS["cancelled"] = "cancelled";
91
- ITEM_STATUS["discard"] = "discard";
92
- })(ITEM_STATUS || (ITEM_STATUS = {}));
93
- exports.ITEM_STATUS = ITEM_STATUS;
94
- //type ITEMSTATUS = 'enter' | 'start' | 'wait' | 'end' | 'terminated' | 'discard';
95
- var EXECUTION_STATUS;
96
- (function (EXECUTION_STATUS) {
97
- EXECUTION_STATUS["running"] = "running";
98
- EXECUTION_STATUS["wait"] = "wait";
99
- EXECUTION_STATUS["end"] = "end";
100
- EXECUTION_STATUS["terminated"] = "terminated";
101
- })(EXECUTION_STATUS || (EXECUTION_STATUS = {}));
102
- exports.EXECUTION_STATUS = EXECUTION_STATUS;
103
- var TOKEN_STATUS;
104
- (function (TOKEN_STATUS) {
105
- TOKEN_STATUS["running"] = "running";
106
- TOKEN_STATUS["wait"] = "wait";
107
- TOKEN_STATUS["end"] = "end";
108
- TOKEN_STATUS["terminated"] = "terminated";
109
- })(TOKEN_STATUS || (TOKEN_STATUS = {}));
110
- exports.TOKEN_STATUS = TOKEN_STATUS;
111
- /*
112
- * possible actions by flow
113
- */
114
- // must be same as above
115
- var FLOW_ACTION;
116
- (function (FLOW_ACTION) {
117
- FLOW_ACTION["take"] = "take";
118
- FLOW_ACTION["discard"] = "discard";
119
- })(FLOW_ACTION || (FLOW_ACTION = {}));
120
- exports.FLOW_ACTION = FLOW_ACTION;
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:SubProcess";
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 || (exports.BPMN_TYPE = BPMN_TYPE = {}));
26
+ var NODE_SUBTYPE;
27
+ (function (NODE_SUBTYPE) {
28
+ NODE_SUBTYPE["timer"] = "timer";
29
+ NODE_SUBTYPE["message"] = "message";
30
+ NODE_SUBTYPE["signal"] = "signal";
31
+ NODE_SUBTYPE["error"] = "error";
32
+ NODE_SUBTYPE["escalation"] = "escalation";
33
+ NODE_SUBTYPE["cancel"] = "cancel";
34
+ NODE_SUBTYPE["compensate"] = "compensate";
35
+ })(NODE_SUBTYPE || (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"] = "process.terminated";
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 || (exports.EXECUTION_EVENT = EXECUTION_EVENT = {}));
65
+ /*
66
+ * possible actions by node
67
+ */
68
+ // must be same as above
69
+ var NODE_ACTION;
70
+ (function (NODE_ACTION) {
71
+ NODE_ACTION[NODE_ACTION["continue"] = 1] = "continue";
72
+ NODE_ACTION[NODE_ACTION["wait"] = 2] = "wait";
73
+ NODE_ACTION[NODE_ACTION["end"] = 3] = "end";
74
+ NODE_ACTION[NODE_ACTION["stop"] = 4] = "stop";
75
+ NODE_ACTION[NODE_ACTION["error"] = 5] = "error";
76
+ NODE_ACTION[NODE_ACTION["abort"] = 6] = "abort";
77
+ })(NODE_ACTION || (exports.NODE_ACTION = NODE_ACTION = {}));
78
+ ;
79
+ var ITEM_STATUS;
80
+ (function (ITEM_STATUS) {
81
+ ITEM_STATUS["enter"] = "enter";
82
+ ITEM_STATUS["start"] = "start";
83
+ ITEM_STATUS["wait"] = "wait";
84
+ ITEM_STATUS["end"] = "end";
85
+ ITEM_STATUS["terminated"] = "terminated";
86
+ ITEM_STATUS["cancelled"] = "cancelled";
87
+ ITEM_STATUS["discard"] = "discard";
88
+ })(ITEM_STATUS || (exports.ITEM_STATUS = ITEM_STATUS = {}));
89
+ //type ITEMSTATUS = 'enter' | 'start' | 'wait' | 'end' | 'terminated' | 'discard';
90
+ var EXECUTION_STATUS;
91
+ (function (EXECUTION_STATUS) {
92
+ EXECUTION_STATUS["running"] = "running";
93
+ EXECUTION_STATUS["wait"] = "wait";
94
+ EXECUTION_STATUS["end"] = "end";
95
+ EXECUTION_STATUS["terminated"] = "terminated";
96
+ })(EXECUTION_STATUS || (exports.EXECUTION_STATUS = EXECUTION_STATUS = {}));
97
+ var TOKEN_STATUS;
98
+ (function (TOKEN_STATUS) {
99
+ TOKEN_STATUS["running"] = "running";
100
+ TOKEN_STATUS["wait"] = "wait";
101
+ TOKEN_STATUS["end"] = "end";
102
+ TOKEN_STATUS["terminated"] = "terminated";
103
+ })(TOKEN_STATUS || (exports.TOKEN_STATUS = TOKEN_STATUS = {}));
104
+ /*
105
+ * possible actions by flow
106
+ */
107
+ // must be same as above
108
+ var FLOW_ACTION;
109
+ (function (FLOW_ACTION) {
110
+ FLOW_ACTION["take"] = "take";
111
+ FLOW_ACTION["discard"] = "discard";
112
+ })(FLOW_ACTION || (exports.FLOW_ACTION = FLOW_ACTION = {}));