@logicflow/extension 1.2.2 → 1.2.4
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/cjs/bpmn-adapter/index.js +111 -74
- package/cjs/materials/group/GroupNode.js +2 -1
- package/es/bpmn-adapter/index.d.ts +41 -33
- package/es/bpmn-adapter/index.js +111 -74
- package/es/materials/group/GroupNode.js +2 -1
- package/lib/AutoLayout.js +1 -1
- package/lib/BpmnAdapter.js +1 -1
- package/lib/BpmnElement.js +1 -1
- package/lib/ContextMenu.js +1 -1
- package/lib/Control.js +1 -1
- package/lib/CurvedEdge.js +1 -1
- package/lib/DndPanel.js +1 -1
- package/lib/FlowPath.js +1 -1
- package/lib/Group.js +1 -1
- package/lib/Highlight.js +1 -1
- package/lib/InsertNodeInPolyline.js +1 -1
- package/lib/Menu.js +1 -1
- package/lib/MiniMap.js +1 -1
- package/lib/NodeResize.js +1 -1
- package/lib/RectLabelNode.js +1 -1
- package/lib/SelectionSelect.js +1 -1
- package/lib/Snapshot.js +1 -1
- package/lib/TurboAdapter.js +1 -1
- package/lib/lfJson2Xml.js +1 -1
- package/lib/lfXml2Json.js +1 -1
- package/package.json +2 -2
- package/types/bpmn-adapter/index.d.ts +41 -33
|
@@ -1,4 +1,28 @@
|
|
|
1
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
|
+
var __assign = (this && this.__assign) || function () {
|
|
16
|
+
__assign = Object.assign || function(t) {
|
|
17
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
18
|
+
s = arguments[i];
|
|
19
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
20
|
+
t[p] = s[p];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
return __assign.apply(this, arguments);
|
|
25
|
+
};
|
|
2
26
|
var __read = (this && this.__read) || function (o, n) {
|
|
3
27
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
4
28
|
if (!m) return o;
|
|
@@ -117,8 +141,6 @@ function convertLf2ProcessData(bpmnProcessData, data) {
|
|
|
117
141
|
var sequenceFlow = data.edges.map(function (edge) {
|
|
118
142
|
var _a, _b;
|
|
119
143
|
var targetNode = nodeMap.get(edge.targetNodeId);
|
|
120
|
-
// @see https://github.com/didi/LogicFlow/issues/325
|
|
121
|
-
// 需要保证incomming在outgoing之前
|
|
122
144
|
if (!targetNode['bpmn:incoming']) {
|
|
123
145
|
targetNode['bpmn:incoming'] = edge.id;
|
|
124
146
|
}
|
|
@@ -131,19 +153,6 @@ function convertLf2ProcessData(bpmnProcessData, data) {
|
|
|
131
153
|
edge.id,
|
|
132
154
|
];
|
|
133
155
|
}
|
|
134
|
-
var sourceNode = nodeMap.get(edge.sourceNodeId);
|
|
135
|
-
if (!sourceNode['bpmn:outgoing']) {
|
|
136
|
-
sourceNode['bpmn:outgoing'] = edge.id;
|
|
137
|
-
}
|
|
138
|
-
else if (Array.isArray(sourceNode['bpmn:outgoing'])) {
|
|
139
|
-
sourceNode['bpmn:outgoing'].push(edge.id);
|
|
140
|
-
}
|
|
141
|
-
else { // 字符串转数组
|
|
142
|
-
sourceNode['bpmn:outgoing'] = [
|
|
143
|
-
sourceNode['bpmn:outgoing'],
|
|
144
|
-
edge.id,
|
|
145
|
-
];
|
|
146
|
-
}
|
|
147
156
|
var edgeConfig = {
|
|
148
157
|
'-id': edge.id,
|
|
149
158
|
'-sourceRef': edge.sourceNodeId,
|
|
@@ -158,6 +167,23 @@ function convertLf2ProcessData(bpmnProcessData, data) {
|
|
|
158
167
|
}
|
|
159
168
|
return edgeConfig;
|
|
160
169
|
});
|
|
170
|
+
// @see https://github.com/didi/LogicFlow/issues/325
|
|
171
|
+
// 需要保证incoming在outgoing之前
|
|
172
|
+
data.edges.forEach(function (edge) {
|
|
173
|
+
var sourceNode = nodeMap.get(edge.sourceNodeId);
|
|
174
|
+
if (!sourceNode['bpmn:outgoing']) {
|
|
175
|
+
sourceNode['bpmn:outgoing'] = edge.id;
|
|
176
|
+
}
|
|
177
|
+
else if (Array.isArray(sourceNode['bpmn:outgoing'])) {
|
|
178
|
+
sourceNode['bpmn:outgoing'].push(edge.id);
|
|
179
|
+
}
|
|
180
|
+
else { // 字符串转数组
|
|
181
|
+
sourceNode['bpmn:outgoing'] = [
|
|
182
|
+
sourceNode['bpmn:outgoing'],
|
|
183
|
+
edge.id,
|
|
184
|
+
];
|
|
185
|
+
}
|
|
186
|
+
});
|
|
161
187
|
bpmnProcessData[BpmnElements.FLOW] = sequenceFlow;
|
|
162
188
|
}
|
|
163
189
|
/**
|
|
@@ -402,53 +428,59 @@ function getEdgeConfig(edgeValue, processValue) {
|
|
|
402
428
|
}
|
|
403
429
|
return edge;
|
|
404
430
|
}
|
|
405
|
-
var BpmnAdapter = {
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
lf
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
'
|
|
431
|
+
var BpmnAdapter = /** @class */ (function () {
|
|
432
|
+
function BpmnAdapter(_a) {
|
|
433
|
+
var _this = this;
|
|
434
|
+
var lf = _a.lf;
|
|
435
|
+
this.adapterOut = function (data) {
|
|
436
|
+
var bpmnProcessData = __assign({}, _this.processAttributes);
|
|
437
|
+
convertLf2ProcessData(bpmnProcessData, data);
|
|
438
|
+
var bpmnDiagramData = {
|
|
439
|
+
'-id': 'BPMNPlane_1',
|
|
440
|
+
'-bpmnElement': bpmnProcessData['-id'],
|
|
441
|
+
};
|
|
442
|
+
convertLf2DiagramData(bpmnDiagramData, data);
|
|
443
|
+
var definitions = _this.definitionAttributes;
|
|
444
|
+
definitions['bpmn:process'] = bpmnProcessData;
|
|
445
|
+
definitions['bpmndi:BPMNDiagram'] = {
|
|
446
|
+
'-id': 'BPMNDiagram_1',
|
|
447
|
+
'bpmndi:BPMNPlane': bpmnDiagramData,
|
|
448
|
+
};
|
|
449
|
+
var bpmnData = {
|
|
450
|
+
'bpmn:definitions': definitions,
|
|
451
|
+
};
|
|
452
|
+
return bpmnData;
|
|
453
|
+
};
|
|
454
|
+
this.adapterIn = function (bpmnData) {
|
|
455
|
+
if (bpmnData) {
|
|
456
|
+
return convertBpmn2LfData(bpmnData);
|
|
457
|
+
}
|
|
419
458
|
};
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
'-
|
|
459
|
+
lf.adapterIn = function (data) { return _this.adapterIn(data); };
|
|
460
|
+
lf.adapterOut = function (data) { return _this.adapterOut(data); };
|
|
461
|
+
this.processAttributes = {
|
|
462
|
+
'-isExecutable': 'true',
|
|
463
|
+
'-id': "Process_" + bpmnIds_1.getBpmnId(),
|
|
424
464
|
};
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
'
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
'-exporter': 'bpmn-js (https://demo.bpmn.io)',
|
|
436
|
-
'-exporterVersion': '7.3.0',
|
|
437
|
-
'bpmn:process': bpmnProcessData,
|
|
438
|
-
'bpmndi:BPMNDiagram': {
|
|
439
|
-
'-id': 'BPMNDiagram_1',
|
|
440
|
-
'bpmndi:BPMNPlane': bpmnDiagramData,
|
|
441
|
-
},
|
|
442
|
-
},
|
|
465
|
+
this.definitionAttributes = {
|
|
466
|
+
'-id': "Definitions_" + bpmnIds_1.getBpmnId(),
|
|
467
|
+
'-xmlns:xsi': 'http://www.w3.org/2001/XMLSchema-instance',
|
|
468
|
+
'-xmlns:bpmn': 'http://www.omg.org/spec/BPMN/20100524/MODEL',
|
|
469
|
+
'-xmlns:bpmndi': 'http://www.omg.org/spec/BPMN/20100524/DI',
|
|
470
|
+
'-xmlns:dc': 'http://www.omg.org/spec/DD/20100524/DC',
|
|
471
|
+
'-xmlns:di': 'http://www.omg.org/spec/DD/20100524/DI',
|
|
472
|
+
'-targetNamespace': 'http://logic-flow.org',
|
|
473
|
+
'-exporter': 'logicflow',
|
|
474
|
+
'-exporterVersion': '1.2.0',
|
|
443
475
|
};
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
};
|
|
476
|
+
}
|
|
477
|
+
BpmnAdapter.prototype.setCustomShape = function (key, val) {
|
|
478
|
+
BpmnAdapter.shapeConfigMap.set(key, val);
|
|
479
|
+
};
|
|
480
|
+
BpmnAdapter.pluginName = 'bpmn-adapter';
|
|
481
|
+
BpmnAdapter.shapeConfigMap = new Map();
|
|
482
|
+
return BpmnAdapter;
|
|
483
|
+
}());
|
|
452
484
|
exports.BpmnAdapter = BpmnAdapter;
|
|
453
485
|
BpmnAdapter.shapeConfigMap.set(BpmnElements.START, {
|
|
454
486
|
width: constant_1.StartEventConfig.width,
|
|
@@ -470,20 +502,25 @@ BpmnAdapter.shapeConfigMap.set(BpmnElements.USER, {
|
|
|
470
502
|
width: constant_1.UserTaskConfig.width,
|
|
471
503
|
height: constant_1.UserTaskConfig.height,
|
|
472
504
|
});
|
|
473
|
-
var BpmnXmlAdapter = {
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
505
|
+
var BpmnXmlAdapter = /** @class */ (function (_super) {
|
|
506
|
+
__extends(BpmnXmlAdapter, _super);
|
|
507
|
+
function BpmnXmlAdapter(data) {
|
|
508
|
+
var _this = _super.call(this, data) || this;
|
|
509
|
+
_this.adapterXmlIn = function (bpmnData) {
|
|
510
|
+
var json = xml2json_1.lfXml2Json(bpmnData);
|
|
511
|
+
return _this.adapterIn(json);
|
|
512
|
+
};
|
|
513
|
+
_this.adapterXmlOut = function (data) {
|
|
514
|
+
var outData = _this.adapterOut(data);
|
|
515
|
+
return json2xml_1.lfJson2Xml(outData);
|
|
516
|
+
};
|
|
517
|
+
var lf = data.lf;
|
|
518
|
+
lf.adapterIn = _this.adapterXmlIn;
|
|
519
|
+
lf.adapterOut = _this.adapterXmlOut;
|
|
520
|
+
return _this;
|
|
521
|
+
}
|
|
522
|
+
BpmnXmlAdapter.pluginName = 'bpmnXmlAdapter';
|
|
523
|
+
return BpmnXmlAdapter;
|
|
524
|
+
}(BpmnAdapter));
|
|
488
525
|
exports.BpmnXmlAdapter = BpmnXmlAdapter;
|
|
489
526
|
exports.default = BpmnAdapter;
|
|
@@ -160,7 +160,8 @@ var GroupNodeModel = /** @class */ (function (_super) {
|
|
|
160
160
|
GroupNodeModel.prototype.foldEdge = function (isFolded, allEdges) {
|
|
161
161
|
var _this = this;
|
|
162
162
|
allEdges.forEach(function (edgeModel, index) {
|
|
163
|
-
var id = edgeModel.id, sourceNodeId = edgeModel.sourceNodeId, targetNodeId = edgeModel.targetNodeId, startPoint = edgeModel.startPoint, endPoint = edgeModel.endPoint, type = edgeModel.type,
|
|
163
|
+
var id = edgeModel.id, sourceNodeId = edgeModel.sourceNodeId, targetNodeId = edgeModel.targetNodeId, startPoint = edgeModel.startPoint, endPoint = edgeModel.endPoint, type = edgeModel.type, text = edgeModel.text;
|
|
164
|
+
var properties = edgeModel.getProperties();
|
|
164
165
|
var data = {
|
|
165
166
|
id: id + "__" + index,
|
|
166
167
|
sourceNodeId: sourceNodeId,
|
|
@@ -1,45 +1,53 @@
|
|
|
1
|
-
declare
|
|
2
|
-
pluginName: string;
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
declare class BpmnAdapter {
|
|
2
|
+
static pluginName: string;
|
|
3
|
+
static shapeConfigMap: Map<any, any>;
|
|
4
|
+
processAttributes: {
|
|
5
|
+
['-isExecutable']: string;
|
|
6
|
+
['-id']: string;
|
|
7
|
+
};
|
|
8
|
+
definitionAttributes: {
|
|
9
|
+
['-id']: string;
|
|
10
|
+
['-xmlns:xsi']: string;
|
|
11
|
+
['-xmlns:bpmn']: string;
|
|
12
|
+
['-xmlns:bpmndi']: string;
|
|
13
|
+
['-xmlns:dc']: string;
|
|
14
|
+
['-xmlns:di']: string;
|
|
15
|
+
['-targetNamespace']: string;
|
|
16
|
+
['-exporter']: string;
|
|
17
|
+
['-exporterVersion']: string;
|
|
18
|
+
[key: string]: any;
|
|
19
|
+
};
|
|
20
|
+
constructor({ lf }: {
|
|
21
|
+
lf: any;
|
|
22
|
+
});
|
|
5
23
|
setCustomShape(key: any, val: any): void;
|
|
6
|
-
adapterOut(data: any)
|
|
24
|
+
adapterOut: (data: any) => {
|
|
7
25
|
'bpmn:definitions': {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
'-id': string;
|
|
19
|
-
'-isExecutable': string;
|
|
20
|
-
};
|
|
21
|
-
'bpmndi:BPMNDiagram': {
|
|
22
|
-
'-id': string;
|
|
23
|
-
'bpmndi:BPMNPlane': {
|
|
24
|
-
'-id': string;
|
|
25
|
-
'-bpmnElement': string;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
26
|
+
[key: string]: any;
|
|
27
|
+
"-id": string;
|
|
28
|
+
"-xmlns:xsi": string;
|
|
29
|
+
"-xmlns:bpmn": string;
|
|
30
|
+
"-xmlns:bpmndi": string;
|
|
31
|
+
"-xmlns:dc": string;
|
|
32
|
+
"-xmlns:di": string;
|
|
33
|
+
"-targetNamespace": string;
|
|
34
|
+
"-exporter": string;
|
|
35
|
+
"-exporterVersion": string;
|
|
28
36
|
};
|
|
29
37
|
};
|
|
30
|
-
adapterIn(bpmnData: any)
|
|
38
|
+
adapterIn: (bpmnData: any) => {
|
|
31
39
|
nodes: any[];
|
|
32
40
|
edges: any[];
|
|
33
41
|
};
|
|
34
|
-
}
|
|
35
|
-
declare
|
|
36
|
-
pluginName: string;
|
|
37
|
-
|
|
38
|
-
adapterXmlIn(bpmnData: any)
|
|
42
|
+
}
|
|
43
|
+
declare class BpmnXmlAdapter extends BpmnAdapter {
|
|
44
|
+
static pluginName: string;
|
|
45
|
+
constructor(data: any);
|
|
46
|
+
adapterXmlIn: (bpmnData: any) => {
|
|
39
47
|
nodes: any[];
|
|
40
48
|
edges: any[];
|
|
41
49
|
};
|
|
42
|
-
adapterXmlOut(data: any)
|
|
43
|
-
}
|
|
50
|
+
adapterXmlOut: (data: any) => string;
|
|
51
|
+
}
|
|
44
52
|
export { BpmnAdapter, BpmnXmlAdapter, };
|
|
45
53
|
export default BpmnAdapter;
|
package/es/bpmn-adapter/index.js
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
extendStatics(d, b);
|
|
10
|
+
function __() { this.constructor = d; }
|
|
11
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
12
|
+
};
|
|
13
|
+
})();
|
|
14
|
+
var __assign = (this && this.__assign) || function () {
|
|
15
|
+
__assign = Object.assign || function(t) {
|
|
16
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
17
|
+
s = arguments[i];
|
|
18
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
19
|
+
t[p] = s[p];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
return __assign.apply(this, arguments);
|
|
24
|
+
};
|
|
1
25
|
var __read = (this && this.__read) || function (o, n) {
|
|
2
26
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
3
27
|
if (!m) return o;
|
|
@@ -114,8 +138,6 @@ function convertLf2ProcessData(bpmnProcessData, data) {
|
|
|
114
138
|
var sequenceFlow = data.edges.map(function (edge) {
|
|
115
139
|
var _a, _b;
|
|
116
140
|
var targetNode = nodeMap.get(edge.targetNodeId);
|
|
117
|
-
// @see https://github.com/didi/LogicFlow/issues/325
|
|
118
|
-
// 需要保证incomming在outgoing之前
|
|
119
141
|
if (!targetNode['bpmn:incoming']) {
|
|
120
142
|
targetNode['bpmn:incoming'] = edge.id;
|
|
121
143
|
}
|
|
@@ -128,19 +150,6 @@ function convertLf2ProcessData(bpmnProcessData, data) {
|
|
|
128
150
|
edge.id,
|
|
129
151
|
];
|
|
130
152
|
}
|
|
131
|
-
var sourceNode = nodeMap.get(edge.sourceNodeId);
|
|
132
|
-
if (!sourceNode['bpmn:outgoing']) {
|
|
133
|
-
sourceNode['bpmn:outgoing'] = edge.id;
|
|
134
|
-
}
|
|
135
|
-
else if (Array.isArray(sourceNode['bpmn:outgoing'])) {
|
|
136
|
-
sourceNode['bpmn:outgoing'].push(edge.id);
|
|
137
|
-
}
|
|
138
|
-
else { // 字符串转数组
|
|
139
|
-
sourceNode['bpmn:outgoing'] = [
|
|
140
|
-
sourceNode['bpmn:outgoing'],
|
|
141
|
-
edge.id,
|
|
142
|
-
];
|
|
143
|
-
}
|
|
144
153
|
var edgeConfig = {
|
|
145
154
|
'-id': edge.id,
|
|
146
155
|
'-sourceRef': edge.sourceNodeId,
|
|
@@ -155,6 +164,23 @@ function convertLf2ProcessData(bpmnProcessData, data) {
|
|
|
155
164
|
}
|
|
156
165
|
return edgeConfig;
|
|
157
166
|
});
|
|
167
|
+
// @see https://github.com/didi/LogicFlow/issues/325
|
|
168
|
+
// 需要保证incoming在outgoing之前
|
|
169
|
+
data.edges.forEach(function (edge) {
|
|
170
|
+
var sourceNode = nodeMap.get(edge.sourceNodeId);
|
|
171
|
+
if (!sourceNode['bpmn:outgoing']) {
|
|
172
|
+
sourceNode['bpmn:outgoing'] = edge.id;
|
|
173
|
+
}
|
|
174
|
+
else if (Array.isArray(sourceNode['bpmn:outgoing'])) {
|
|
175
|
+
sourceNode['bpmn:outgoing'].push(edge.id);
|
|
176
|
+
}
|
|
177
|
+
else { // 字符串转数组
|
|
178
|
+
sourceNode['bpmn:outgoing'] = [
|
|
179
|
+
sourceNode['bpmn:outgoing'],
|
|
180
|
+
edge.id,
|
|
181
|
+
];
|
|
182
|
+
}
|
|
183
|
+
});
|
|
158
184
|
bpmnProcessData[BpmnElements.FLOW] = sequenceFlow;
|
|
159
185
|
}
|
|
160
186
|
/**
|
|
@@ -399,53 +425,59 @@ function getEdgeConfig(edgeValue, processValue) {
|
|
|
399
425
|
}
|
|
400
426
|
return edge;
|
|
401
427
|
}
|
|
402
|
-
var BpmnAdapter = {
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
lf
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
'
|
|
428
|
+
var BpmnAdapter = /** @class */ (function () {
|
|
429
|
+
function BpmnAdapter(_a) {
|
|
430
|
+
var _this = this;
|
|
431
|
+
var lf = _a.lf;
|
|
432
|
+
this.adapterOut = function (data) {
|
|
433
|
+
var bpmnProcessData = __assign({}, _this.processAttributes);
|
|
434
|
+
convertLf2ProcessData(bpmnProcessData, data);
|
|
435
|
+
var bpmnDiagramData = {
|
|
436
|
+
'-id': 'BPMNPlane_1',
|
|
437
|
+
'-bpmnElement': bpmnProcessData['-id'],
|
|
438
|
+
};
|
|
439
|
+
convertLf2DiagramData(bpmnDiagramData, data);
|
|
440
|
+
var definitions = _this.definitionAttributes;
|
|
441
|
+
definitions['bpmn:process'] = bpmnProcessData;
|
|
442
|
+
definitions['bpmndi:BPMNDiagram'] = {
|
|
443
|
+
'-id': 'BPMNDiagram_1',
|
|
444
|
+
'bpmndi:BPMNPlane': bpmnDiagramData,
|
|
445
|
+
};
|
|
446
|
+
var bpmnData = {
|
|
447
|
+
'bpmn:definitions': definitions,
|
|
448
|
+
};
|
|
449
|
+
return bpmnData;
|
|
450
|
+
};
|
|
451
|
+
this.adapterIn = function (bpmnData) {
|
|
452
|
+
if (bpmnData) {
|
|
453
|
+
return convertBpmn2LfData(bpmnData);
|
|
454
|
+
}
|
|
416
455
|
};
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
'-
|
|
456
|
+
lf.adapterIn = function (data) { return _this.adapterIn(data); };
|
|
457
|
+
lf.adapterOut = function (data) { return _this.adapterOut(data); };
|
|
458
|
+
this.processAttributes = {
|
|
459
|
+
'-isExecutable': 'true',
|
|
460
|
+
'-id': "Process_" + getBpmnId(),
|
|
421
461
|
};
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
'
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
'-exporter': 'bpmn-js (https://demo.bpmn.io)',
|
|
433
|
-
'-exporterVersion': '7.3.0',
|
|
434
|
-
'bpmn:process': bpmnProcessData,
|
|
435
|
-
'bpmndi:BPMNDiagram': {
|
|
436
|
-
'-id': 'BPMNDiagram_1',
|
|
437
|
-
'bpmndi:BPMNPlane': bpmnDiagramData,
|
|
438
|
-
},
|
|
439
|
-
},
|
|
462
|
+
this.definitionAttributes = {
|
|
463
|
+
'-id': "Definitions_" + getBpmnId(),
|
|
464
|
+
'-xmlns:xsi': 'http://www.w3.org/2001/XMLSchema-instance',
|
|
465
|
+
'-xmlns:bpmn': 'http://www.omg.org/spec/BPMN/20100524/MODEL',
|
|
466
|
+
'-xmlns:bpmndi': 'http://www.omg.org/spec/BPMN/20100524/DI',
|
|
467
|
+
'-xmlns:dc': 'http://www.omg.org/spec/DD/20100524/DC',
|
|
468
|
+
'-xmlns:di': 'http://www.omg.org/spec/DD/20100524/DI',
|
|
469
|
+
'-targetNamespace': 'http://logic-flow.org',
|
|
470
|
+
'-exporter': 'logicflow',
|
|
471
|
+
'-exporterVersion': '1.2.0',
|
|
440
472
|
};
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
};
|
|
473
|
+
}
|
|
474
|
+
BpmnAdapter.prototype.setCustomShape = function (key, val) {
|
|
475
|
+
BpmnAdapter.shapeConfigMap.set(key, val);
|
|
476
|
+
};
|
|
477
|
+
BpmnAdapter.pluginName = 'bpmn-adapter';
|
|
478
|
+
BpmnAdapter.shapeConfigMap = new Map();
|
|
479
|
+
return BpmnAdapter;
|
|
480
|
+
}());
|
|
449
481
|
BpmnAdapter.shapeConfigMap.set(BpmnElements.START, {
|
|
450
482
|
width: StartEventConfig.width,
|
|
451
483
|
height: StartEventConfig.height,
|
|
@@ -466,20 +498,25 @@ BpmnAdapter.shapeConfigMap.set(BpmnElements.USER, {
|
|
|
466
498
|
width: UserTaskConfig.width,
|
|
467
499
|
height: UserTaskConfig.height,
|
|
468
500
|
});
|
|
469
|
-
var BpmnXmlAdapter = {
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
501
|
+
var BpmnXmlAdapter = /** @class */ (function (_super) {
|
|
502
|
+
__extends(BpmnXmlAdapter, _super);
|
|
503
|
+
function BpmnXmlAdapter(data) {
|
|
504
|
+
var _this = _super.call(this, data) || this;
|
|
505
|
+
_this.adapterXmlIn = function (bpmnData) {
|
|
506
|
+
var json = lfXml2Json(bpmnData);
|
|
507
|
+
return _this.adapterIn(json);
|
|
508
|
+
};
|
|
509
|
+
_this.adapterXmlOut = function (data) {
|
|
510
|
+
var outData = _this.adapterOut(data);
|
|
511
|
+
return lfJson2Xml(outData);
|
|
512
|
+
};
|
|
513
|
+
var lf = data.lf;
|
|
514
|
+
lf.adapterIn = _this.adapterXmlIn;
|
|
515
|
+
lf.adapterOut = _this.adapterXmlOut;
|
|
516
|
+
return _this;
|
|
517
|
+
}
|
|
518
|
+
BpmnXmlAdapter.pluginName = 'bpmnXmlAdapter';
|
|
519
|
+
return BpmnXmlAdapter;
|
|
520
|
+
}(BpmnAdapter));
|
|
484
521
|
export { BpmnAdapter, BpmnXmlAdapter, };
|
|
485
522
|
export default BpmnAdapter;
|
|
@@ -158,7 +158,8 @@ var GroupNodeModel = /** @class */ (function (_super) {
|
|
|
158
158
|
GroupNodeModel.prototype.foldEdge = function (isFolded, allEdges) {
|
|
159
159
|
var _this = this;
|
|
160
160
|
allEdges.forEach(function (edgeModel, index) {
|
|
161
|
-
var id = edgeModel.id, sourceNodeId = edgeModel.sourceNodeId, targetNodeId = edgeModel.targetNodeId, startPoint = edgeModel.startPoint, endPoint = edgeModel.endPoint, type = edgeModel.type,
|
|
161
|
+
var id = edgeModel.id, sourceNodeId = edgeModel.sourceNodeId, targetNodeId = edgeModel.targetNodeId, startPoint = edgeModel.startPoint, endPoint = edgeModel.endPoint, type = edgeModel.type, text = edgeModel.text;
|
|
162
|
+
var properties = edgeModel.getProperties();
|
|
162
163
|
var data = {
|
|
163
164
|
id: id + "__" + index,
|
|
164
165
|
sourceNodeId: sourceNodeId,
|