-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathprocess.js
92 lines (92 loc) · 3.46 KB
/
process.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const configuration_1 = require("../configuration");
const __1 = require("..");
const logger = new __1.Logger({ toConsole: true });
let name = 'ds';
let process;
let needsRepairs = true;
let needsCleaning = true;
let response;
let items;
let item;
let query, query1;
let server;
let instanceId;
load('Buy Used Car');
// importAll();
//importModel('multiStart');
//build();
function test() {
return __awaiter(this, void 0, void 0, function* () {
let events = yield findEvents({ "events.subType": 'Timer' });
});
}
function build() {
return __awaiter(this, void 0, void 0, function* () {
const server = new __1.BPMNServer(configuration_1.configuration, logger);
const mds = server.definitions;
mds.install();
});
}
function load(name) {
return __awaiter(this, void 0, void 0, function* () {
// called from Execution
const server = new __1.BPMNServer(configuration_1.configuration, logger);
const mds = server.definitions;
const list = yield mds.getList();
// two objects are needed here:
//1
let definition; // this definition holds nodes and flows, fundemental to execution
let bpmnModelData; // name,source and so one
definition = yield mds.load(name);
bpmnModelData = yield mds.loadModel(name);
let source = yield mds.getSource(name);
let svg = yield mds.getSVG(name);
yield mds.save(name, source, svg);
mds.saveModel(bpmnModelData);
console.log(bpmnModelData.name);
// definition = new Definition(BpmnModelData.name, bpmnModelData.source, logger);
console.log(definition);
return definition;
});
}
function importAll() {
return __awaiter(this, void 0, void 0, function* () {
const server = new __1.BPMNServer(configuration_1.configuration, logger);
const defs = server.definitions;
const list = yield defs.getList();
list.forEach(model => {
importModel(model);
});
});
}
function importModel(name) {
return __awaiter(this, void 0, void 0, function* () {
const server = new __1.BPMNServer(configuration_1.configuration, logger);
const defs = server.definitions;
const source = yield defs.getSource(name);
const svg = yield defs.getSVG(name);
const mds = server.definitions;
mds.save(name, source, svg);
});
}
function findEvents(query) {
return __awaiter(this, void 0, void 0, function* () {
const server = new __1.BPMNServer(configuration_1.configuration, logger);
const mds = server.definitions;
const list = yield mds.findEvents(query);
console.log(list);
return list;
});
}
//# sourceMappingURL=process.js.map