bpmn-client 1.6.0 → 2.1.5
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 +3 -0
- package/bin/cli.js +245 -245
- package/bin/setup.js +24 -24
- package/dist/BPMNClient.js +295 -273
- package/dist/BPMNClient2.js +252 -0
- package/dist/WebService.js +82 -82
- package/dist/cli.js +281 -245
- package/dist/index.js +16 -19
- package/dist/interfaces/API.js +2 -2
- package/dist/interfaces/DataObjects.js +2 -2
- package/dist/interfaces/Enums.js +124 -112
- package/dist/monitor.js +91 -91
- package/dist/remote-import.js +137 -137
- package/dist/setup.js +22 -22
- package/dist/test-raw.js +73 -74
- package/dist/test.js +75 -75
- package/dist/test2.js +78 -0
- package/dist/test3.js +42 -42
- package/package.json +1 -1
package/dist/test2.js
ADDED
|
@@ -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
|
+
const _1 = require("./");
|
|
13
|
+
test();
|
|
14
|
+
function testLong() {
|
|
15
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
16
|
+
console.log('testlong');
|
|
17
|
+
const dotenv = require('dotenv');
|
|
18
|
+
dotenv.config();
|
|
19
|
+
console.log('env:', process.env.HOST, process.env.PORT, process.env.API_KEY);
|
|
20
|
+
var caseId = Math.floor(Math.random() * 10000);
|
|
21
|
+
let name = 'test-concurrency';
|
|
22
|
+
let response;
|
|
23
|
+
let instanceId;
|
|
24
|
+
let userId = 'user1';
|
|
25
|
+
let options = {}; //noWait:true};
|
|
26
|
+
const server1 = new _1.BPMNClient2(process.env.HOST, process.env.PORT, process.env.API_KEY);
|
|
27
|
+
console.log('starting process', name);
|
|
28
|
+
response = yield server1.engine.start(name, { caseId: caseId }, null, userId);
|
|
29
|
+
console.log(response.id, response.items.length);
|
|
30
|
+
response.items.forEach(item => { console.log(item.id, item.name, item.type, item.status); });
|
|
31
|
+
console.log('invoking UserLong');
|
|
32
|
+
response = yield server1.engine.invoke({ id: response.id, "items.elementId": 'UserLong' }, null, userId, options);
|
|
33
|
+
console.log('invoked userLong', response.items.length);
|
|
34
|
+
console.log('invoking UserShort');
|
|
35
|
+
response = yield server1.engine.invoke({ id: response.id, "items.elementId": 'UserShort' }, null, userId, options);
|
|
36
|
+
console.log('invoked userShort', response.items.length);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
function test() {
|
|
40
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
const dotenv = require('dotenv');
|
|
42
|
+
dotenv.config();
|
|
43
|
+
console.log('env:', process.env.HOST, process.env.PORT, process.env.API_KEY);
|
|
44
|
+
var caseId = Math.floor(Math.random() * 10000);
|
|
45
|
+
let name = 'Buy Used Car';
|
|
46
|
+
let response;
|
|
47
|
+
let instanceId;
|
|
48
|
+
let userId = 'user1';
|
|
49
|
+
let options = { noWait: true };
|
|
50
|
+
const server1 = new _1.BPMNClient2(process.env.HOST, process.env.PORT, process.env.API_KEY);
|
|
51
|
+
// const server2 = new BPMNClient2(process.env.HOST, 300, process.env.API_KEY);
|
|
52
|
+
response = yield server1.engine.start(name, { caseId: caseId }, userId, options);
|
|
53
|
+
console.log(response.id);
|
|
54
|
+
response = yield server1.engine.invoke({ id: response.id, "items.elementId": 'task_Buy' }, null, userId, options);
|
|
55
|
+
console.log('invoked', response.id);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
function importModel() {
|
|
59
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
60
|
+
console.log('from client lib');
|
|
61
|
+
try {
|
|
62
|
+
// const server = new BPMNClient('localhost', 3000, '12345');
|
|
63
|
+
const dotenv = require('dotenv');
|
|
64
|
+
dotenv.config();
|
|
65
|
+
console.log('env:', process.env.HOST, process.env.PORT, process.env.API_KEY);
|
|
66
|
+
const server = new _1.BPMNClient2(process.env.HOST, process.env.PORT, process.env.API_KEY);
|
|
67
|
+
var name = 'test-import';
|
|
68
|
+
var file = '..\\WebApp\\processes\\Trans.bpmn';
|
|
69
|
+
var file2 = '..\\WebApp\\processes\\Trans.svg';
|
|
70
|
+
var res = yield server.model.import(name, file, file2, {});
|
|
71
|
+
return res;
|
|
72
|
+
}
|
|
73
|
+
catch (exc) {
|
|
74
|
+
console.log('*******ERROR********');
|
|
75
|
+
console.log(exc);
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
}
|
package/dist/test3.js
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
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
|
-
//import { BPMNClient } from "bpmn-client";
|
|
13
|
-
const _1 = require("./");
|
|
14
|
-
const readline = require("readline");
|
|
15
|
-
const dotenv = require('dotenv');
|
|
16
|
-
const res = dotenv.config();
|
|
17
|
-
const cl = readline.createInterface(process.stdin, process.stdout);
|
|
18
|
-
const question = function (q) {
|
|
19
|
-
return new Promise((res, rej) => {
|
|
20
|
-
cl.question(q, answer => {
|
|
21
|
-
res(answer);
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
|
-
completeUserTask();
|
|
26
|
-
function completeUserTask() {
|
|
27
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
-
const server = new _1.BPMNClient(process.env.HOST, process.env.PORT, process.env.API_KEY);
|
|
29
|
-
const instanceId = yield question('Please provide your Instance ID: ');
|
|
30
|
-
const taskId = yield question('Please provide your Task ID: ');
|
|
31
|
-
let taskData = yield question('Please provide your Task Data (json obj) if any: ');
|
|
32
|
-
cl.close();
|
|
33
|
-
if (taskData === "") {
|
|
34
|
-
taskData = {};
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
taskData = JSON.parse(taskData.toString());
|
|
38
|
-
}
|
|
39
|
-
yield server.engine.invoke({ id: instanceId, "items.elementId": taskId }, taskData);
|
|
40
|
-
console.log("Completed UserTask:", taskId);
|
|
41
|
-
});
|
|
42
|
-
}
|
|
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
|
+
//import { BPMNClient } from "bpmn-client";
|
|
13
|
+
const _1 = require("./");
|
|
14
|
+
const readline = require("readline");
|
|
15
|
+
const dotenv = require('dotenv');
|
|
16
|
+
const res = dotenv.config();
|
|
17
|
+
const cl = readline.createInterface(process.stdin, process.stdout);
|
|
18
|
+
const question = function (q) {
|
|
19
|
+
return new Promise((res, rej) => {
|
|
20
|
+
cl.question(q, answer => {
|
|
21
|
+
res(answer);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
completeUserTask();
|
|
26
|
+
function completeUserTask() {
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
const server = new _1.BPMNClient(process.env.HOST, process.env.PORT, process.env.API_KEY);
|
|
29
|
+
const instanceId = yield question('Please provide your Instance ID: ');
|
|
30
|
+
const taskId = yield question('Please provide your Task ID: ');
|
|
31
|
+
let taskData = yield question('Please provide your Task Data (json obj) if any: ');
|
|
32
|
+
cl.close();
|
|
33
|
+
if (taskData === "") {
|
|
34
|
+
taskData = {};
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
taskData = JSON.parse(taskData.toString());
|
|
38
|
+
}
|
|
39
|
+
yield server.engine.invoke({ id: instanceId, "items.elementId": taskId }, taskData);
|
|
40
|
+
console.log("Completed UserTask:", taskId);
|
|
41
|
+
});
|
|
42
|
+
}
|