@logicflow/extension 1.1.20 → 1.2.0-alpha.10
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/NodeResize/Control/Control.js +21 -17
- package/cjs/NodeResize/Control/Util.js +11 -11
- package/cjs/NodeResize/Node/DiamondResize.js +10 -8
- package/cjs/NodeResize/Node/EllipseResize.js +10 -8
- package/cjs/NodeResize/Node/HtmlResize.js +10 -8
- package/cjs/NodeResize/Node/RectResize.js +10 -8
- package/cjs/bpmn-adapter/index.js +124 -76
- package/cjs/bpmn-adapter/json2xml.js +5 -2
- package/cjs/bpmn-adapter/xml2json.js +38 -284
- package/cjs/components/context-menu/index.js +2 -2
- package/cjs/components/control/index.js +16 -16
- package/cjs/components/menu/index.js +32 -32
- package/cjs/components/mini-map/index.js +2 -2
- package/cjs/components/selection-select/index.js +27 -7
- package/cjs/index.js +1 -0
- package/cjs/insert-node-in-polyline/edge.js +4 -4
- package/cjs/insert-node-in-polyline/index.js +1 -1
- package/cjs/locale/en-locale/en.js +22 -0
- package/cjs/locale/en-locale/index.js +29 -0
- package/cjs/locale/locale.js +19 -0
- package/cjs/materials/group/GroupNode.js +24 -14
- package/cjs/materials/group/index.js +3 -3
- package/cjs/tools/auto-layout/index.js +9 -9
- package/es/NodeResize/Control/Control.d.ts +1 -1
- package/es/NodeResize/Control/Control.js +22 -18
- package/es/NodeResize/Control/Util.d.ts +3 -3
- package/es/NodeResize/Control/Util.js +7 -7
- package/es/NodeResize/Node/DiamondResize.d.ts +1 -1
- package/es/NodeResize/Node/DiamondResize.js +10 -8
- package/es/NodeResize/Node/EllipseResize.d.ts +1 -1
- package/es/NodeResize/Node/EllipseResize.js +10 -8
- package/es/NodeResize/Node/HtmlResize.d.ts +1 -1
- package/es/NodeResize/Node/HtmlResize.js +10 -8
- package/es/NodeResize/Node/RectResize.d.ts +1 -1
- package/es/NodeResize/Node/RectResize.js +10 -8
- package/es/bpmn-adapter/index.d.ts +41 -33
- package/es/bpmn-adapter/index.js +124 -76
- package/es/bpmn-adapter/json2xml.js +5 -2
- package/es/bpmn-adapter/xml2json.js +38 -284
- package/es/components/context-menu/index.js +2 -2
- package/es/components/control/index.d.ts +2 -3
- package/es/components/control/index.js +16 -16
- package/es/components/menu/index.d.ts +2 -3
- package/es/components/menu/index.js +32 -32
- package/es/components/mini-map/index.js +2 -2
- package/es/components/selection-select/index.d.ts +2 -1
- package/es/components/selection-select/index.js +27 -7
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/insert-node-in-polyline/edge.d.ts +3 -3
- package/es/insert-node-in-polyline/edge.js +3 -3
- package/es/insert-node-in-polyline/index.js +2 -2
- package/es/locale/en-locale/en.d.ts +19 -0
- package/es/locale/en-locale/en.js +19 -0
- package/es/locale/en-locale/index.d.ts +9 -0
- package/es/locale/en-locale/index.js +26 -0
- package/es/locale/locale.d.ts +6 -0
- package/es/locale/locale.js +16 -0
- package/es/materials/group/GroupNode.d.ts +1 -1
- package/es/materials/group/GroupNode.js +24 -14
- package/es/materials/group/index.d.ts +1 -1
- package/es/materials/group/index.js +3 -3
- package/es/tools/auto-layout/index.d.ts +2 -2
- package/es/tools/auto-layout/index.js +9 -9
- 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/EnLocale.js +1 -0
- 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/NodeResize/Control/Control.d.ts +1 -1
- package/types/NodeResize/Control/Util.d.ts +3 -3
- package/types/NodeResize/Node/DiamondResize.d.ts +1 -1
- package/types/NodeResize/Node/EllipseResize.d.ts +1 -1
- package/types/NodeResize/Node/HtmlResize.d.ts +1 -1
- package/types/NodeResize/Node/RectResize.d.ts +1 -1
- package/types/bpmn-adapter/index.d.ts +41 -33
- package/types/components/control/index.d.ts +2 -3
- package/types/components/menu/index.d.ts +2 -3
- package/types/components/selection-select/index.d.ts +2 -1
- package/types/index.d.ts +1 -0
- package/types/insert-node-in-polyline/edge.d.ts +3 -3
- package/types/materials/group/GroupNode.d.ts +1 -1
- package/types/materials/group/index.d.ts +1 -1
- package/types/tools/auto-layout/index.d.ts +2 -2
|
@@ -15,14 +15,8 @@ import { h, EllipseNode, EllipseNodeModel } from '@logicflow/core';
|
|
|
15
15
|
import ControlGroup from '../Control/ControlGroup';
|
|
16
16
|
var EllipseResizeModel = /** @class */ (function (_super) {
|
|
17
17
|
__extends(EllipseResizeModel, _super);
|
|
18
|
-
function EllipseResizeModel(
|
|
19
|
-
|
|
20
|
-
var nodeSize = _this.properties.nodeSize;
|
|
21
|
-
if (nodeSize) {
|
|
22
|
-
_this.rx = nodeSize.rx;
|
|
23
|
-
_this.ry = nodeSize.ry;
|
|
24
|
-
}
|
|
25
|
-
return _this;
|
|
18
|
+
function EllipseResizeModel() {
|
|
19
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
26
20
|
}
|
|
27
21
|
EllipseResizeModel.prototype.initNodeData = function (data) {
|
|
28
22
|
_super.prototype.initNodeData.call(this, data);
|
|
@@ -31,6 +25,14 @@ var EllipseResizeModel = /** @class */ (function (_super) {
|
|
|
31
25
|
this.maxWidth = 2000;
|
|
32
26
|
this.maxHeight = 2000;
|
|
33
27
|
};
|
|
28
|
+
EllipseResizeModel.prototype.init = function () {
|
|
29
|
+
_super.prototype.init.call(this);
|
|
30
|
+
var nodeSize = this.properties.nodeSize;
|
|
31
|
+
if (nodeSize) {
|
|
32
|
+
this.rx = nodeSize.rx;
|
|
33
|
+
this.ry = nodeSize.ry;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
34
36
|
EllipseResizeModel.prototype.getOutlineStyle = function () {
|
|
35
37
|
var style = _super.prototype.getOutlineStyle.call(this);
|
|
36
38
|
style.stroke = 'none';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { h, HtmlNode, HtmlNodeModel } from '@logicflow/core';
|
|
2
2
|
declare class HtmlResizeModel extends HtmlNodeModel {
|
|
3
|
-
constructor(data: any, graphModel: any);
|
|
4
3
|
initNodeData(data: any): void;
|
|
4
|
+
init(): void;
|
|
5
5
|
getOutlineStyle(): import("@logicflow/core/types/constant/DefaultTheme").OutlineTheme;
|
|
6
6
|
getResizeOutlineStyle(): {
|
|
7
7
|
stroke: string;
|
|
@@ -15,14 +15,8 @@ import { h, HtmlNode, HtmlNodeModel } from '@logicflow/core';
|
|
|
15
15
|
import ControlGroup from '../Control/ControlGroup';
|
|
16
16
|
var HtmlResizeModel = /** @class */ (function (_super) {
|
|
17
17
|
__extends(HtmlResizeModel, _super);
|
|
18
|
-
function HtmlResizeModel(
|
|
19
|
-
|
|
20
|
-
var nodeSize = _this.properties.nodeSize;
|
|
21
|
-
if (nodeSize) {
|
|
22
|
-
_this.width = nodeSize.width;
|
|
23
|
-
_this.height = nodeSize.height;
|
|
24
|
-
}
|
|
25
|
-
return _this;
|
|
18
|
+
function HtmlResizeModel() {
|
|
19
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
26
20
|
}
|
|
27
21
|
HtmlResizeModel.prototype.initNodeData = function (data) {
|
|
28
22
|
_super.prototype.initNodeData.call(this, data);
|
|
@@ -31,6 +25,14 @@ var HtmlResizeModel = /** @class */ (function (_super) {
|
|
|
31
25
|
this.maxWidth = 2000;
|
|
32
26
|
this.maxHeight = 2000;
|
|
33
27
|
};
|
|
28
|
+
HtmlResizeModel.prototype.init = function () {
|
|
29
|
+
_super.prototype.init.call(this);
|
|
30
|
+
var nodeSize = this.properties.nodeSize;
|
|
31
|
+
if (nodeSize) {
|
|
32
|
+
this.width = nodeSize.width;
|
|
33
|
+
this.height = nodeSize.height;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
34
36
|
HtmlResizeModel.prototype.getOutlineStyle = function () {
|
|
35
37
|
var style = _super.prototype.getOutlineStyle.call(this);
|
|
36
38
|
style.stroke = 'none';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { h, RectNode, RectNodeModel } from '@logicflow/core';
|
|
2
2
|
declare class RectResizeModel extends RectNodeModel {
|
|
3
|
-
constructor(data: any, graphModel: any);
|
|
4
3
|
initNodeData(data: any): void;
|
|
4
|
+
init(): void;
|
|
5
5
|
getOutlineStyle(): import("@logicflow/core/types/constant/DefaultTheme").OutlineTheme;
|
|
6
6
|
getResizeOutlineStyle(): {
|
|
7
7
|
fill: string;
|
|
@@ -15,14 +15,8 @@ import { h, RectNode, RectNodeModel } from '@logicflow/core';
|
|
|
15
15
|
import ControlGroup from '../Control/ControlGroup';
|
|
16
16
|
var RectResizeModel = /** @class */ (function (_super) {
|
|
17
17
|
__extends(RectResizeModel, _super);
|
|
18
|
-
function RectResizeModel(
|
|
19
|
-
|
|
20
|
-
var nodeSize = _this.properties.nodeSize;
|
|
21
|
-
if (nodeSize) {
|
|
22
|
-
_this.width = nodeSize.width;
|
|
23
|
-
_this.height = nodeSize.height;
|
|
24
|
-
}
|
|
25
|
-
return _this;
|
|
18
|
+
function RectResizeModel() {
|
|
19
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
26
20
|
}
|
|
27
21
|
RectResizeModel.prototype.initNodeData = function (data) {
|
|
28
22
|
_super.prototype.initNodeData.call(this, data);
|
|
@@ -31,6 +25,14 @@ var RectResizeModel = /** @class */ (function (_super) {
|
|
|
31
25
|
this.maxWidth = 2000;
|
|
32
26
|
this.maxHeight = 2000;
|
|
33
27
|
};
|
|
28
|
+
RectResizeModel.prototype.init = function () {
|
|
29
|
+
_super.prototype.init.call(this);
|
|
30
|
+
var nodeSize = this.properties.nodeSize;
|
|
31
|
+
if (nodeSize) {
|
|
32
|
+
this.width = nodeSize.width;
|
|
33
|
+
this.height = nodeSize.height;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
34
36
|
RectResizeModel.prototype.getOutlineStyle = function () {
|
|
35
37
|
var style = _super.prototype.getOutlineStyle.call(this);
|
|
36
38
|
style.stroke = 'none';
|
|
@@ -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;
|
|
@@ -29,8 +53,8 @@ var BpmnElements;
|
|
|
29
53
|
})(BpmnElements || (BpmnElements = {}));
|
|
30
54
|
var defaultAttrs = ['-name', '-id', 'bpmn:incoming', 'bpmn:outgoing', '-sourceRef', '-targetRef'];
|
|
31
55
|
/**
|
|
32
|
-
* 将普通json转换为
|
|
33
|
-
*
|
|
56
|
+
* 将普通json转换为xmlJson
|
|
57
|
+
* xmlJson中property会以“-”开头
|
|
34
58
|
* 如果没有“-”表示为子节点
|
|
35
59
|
*/
|
|
36
60
|
function toXmlJson(json) {
|
|
@@ -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,17 @@ function convertLf2ProcessData(bpmnProcessData, data) {
|
|
|
128
150
|
edge.id,
|
|
129
151
|
];
|
|
130
152
|
}
|
|
131
|
-
|
|
132
|
-
if (!sourceNode['bpmn:outgoing']) {
|
|
133
|
-
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
];
|
|
143
|
-
}
|
|
153
|
+
// const sourceNode = nodeMap.get(edge.sourceNodeId);
|
|
154
|
+
// if (!sourceNode['bpmn:outgoing']) {
|
|
155
|
+
// sourceNode['bpmn:outgoing'] = edge.id;
|
|
156
|
+
// } else if (Array.isArray(sourceNode['bpmn:outgoing'])) {
|
|
157
|
+
// sourceNode['bpmn:outgoing'].push(edge.id);
|
|
158
|
+
// } else { // 字符串转数组
|
|
159
|
+
// sourceNode['bpmn:outgoing'] = [
|
|
160
|
+
// sourceNode['bpmn:outgoing'],
|
|
161
|
+
// edge.id,
|
|
162
|
+
// ];
|
|
163
|
+
// }
|
|
144
164
|
var edgeConfig = {
|
|
145
165
|
'-id': edge.id,
|
|
146
166
|
'-sourceRef': edge.sourceNodeId,
|
|
@@ -155,6 +175,23 @@ function convertLf2ProcessData(bpmnProcessData, data) {
|
|
|
155
175
|
}
|
|
156
176
|
return edgeConfig;
|
|
157
177
|
});
|
|
178
|
+
// @see https://github.com/didi/LogicFlow/issues/325
|
|
179
|
+
// 需要保证incoming在outgoing之前
|
|
180
|
+
data.edges.forEach(function (edge) {
|
|
181
|
+
var sourceNode = nodeMap.get(edge.sourceNodeId);
|
|
182
|
+
if (!sourceNode['bpmn:outgoing']) {
|
|
183
|
+
sourceNode['bpmn:outgoing'] = edge.id;
|
|
184
|
+
}
|
|
185
|
+
else if (Array.isArray(sourceNode['bpmn:outgoing'])) {
|
|
186
|
+
sourceNode['bpmn:outgoing'].push(edge.id);
|
|
187
|
+
}
|
|
188
|
+
else { // 字符串转数组
|
|
189
|
+
sourceNode['bpmn:outgoing'] = [
|
|
190
|
+
sourceNode['bpmn:outgoing'],
|
|
191
|
+
edge.id,
|
|
192
|
+
];
|
|
193
|
+
}
|
|
194
|
+
});
|
|
158
195
|
bpmnProcessData[BpmnElements.FLOW] = sequenceFlow;
|
|
159
196
|
}
|
|
160
197
|
/**
|
|
@@ -399,53 +436,59 @@ function getEdgeConfig(edgeValue, processValue) {
|
|
|
399
436
|
}
|
|
400
437
|
return edge;
|
|
401
438
|
}
|
|
402
|
-
var BpmnAdapter = {
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
lf
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
'
|
|
439
|
+
var BpmnAdapter = /** @class */ (function () {
|
|
440
|
+
function BpmnAdapter(_a) {
|
|
441
|
+
var _this = this;
|
|
442
|
+
var lf = _a.lf;
|
|
443
|
+
this.adapterOut = function (data) {
|
|
444
|
+
var bpmnProcessData = __assign({}, _this.processAttributes);
|
|
445
|
+
convertLf2ProcessData(bpmnProcessData, data);
|
|
446
|
+
var bpmnDiagramData = {
|
|
447
|
+
'-id': 'BPMNPlane_1',
|
|
448
|
+
'-bpmnElement': bpmnProcessData['-id'],
|
|
449
|
+
};
|
|
450
|
+
convertLf2DiagramData(bpmnDiagramData, data);
|
|
451
|
+
var definitions = _this.definitionAttributes;
|
|
452
|
+
definitions['bpmn:process'] = bpmnProcessData;
|
|
453
|
+
definitions['bpmndi:BPMNDiagram'] = {
|
|
454
|
+
'-id': 'BPMNDiagram_1',
|
|
455
|
+
'bpmndi:BPMNPlane': bpmnDiagramData,
|
|
456
|
+
};
|
|
457
|
+
var bpmnData = {
|
|
458
|
+
'bpmn:definitions': definitions,
|
|
459
|
+
};
|
|
460
|
+
return bpmnData;
|
|
461
|
+
};
|
|
462
|
+
this.adapterIn = function (bpmnData) {
|
|
463
|
+
if (bpmnData) {
|
|
464
|
+
return convertBpmn2LfData(bpmnData);
|
|
465
|
+
}
|
|
416
466
|
};
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
'-
|
|
467
|
+
lf.adapterIn = function (data) { return _this.adapterIn(data); };
|
|
468
|
+
lf.adapterOut = function (data) { return _this.adapterOut(data); };
|
|
469
|
+
this.processAttributes = {
|
|
470
|
+
'-isExecutable': 'true',
|
|
471
|
+
'-id': "Process_" + getBpmnId(),
|
|
421
472
|
};
|
|
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
|
-
},
|
|
473
|
+
this.definitionAttributes = {
|
|
474
|
+
'-id': "Definitions_" + getBpmnId(),
|
|
475
|
+
'-xmlns:xsi': 'http://www.w3.org/2001/XMLSchema-instance',
|
|
476
|
+
'-xmlns:bpmn': 'http://www.omg.org/spec/BPMN/20100524/MODEL',
|
|
477
|
+
'-xmlns:bpmndi': 'http://www.omg.org/spec/BPMN/20100524/DI',
|
|
478
|
+
'-xmlns:dc': 'http://www.omg.org/spec/DD/20100524/DC',
|
|
479
|
+
'-xmlns:di': 'http://www.omg.org/spec/DD/20100524/DI',
|
|
480
|
+
'-targetNamespace': 'http://logic-flow.org',
|
|
481
|
+
'-exporter': 'logicflow',
|
|
482
|
+
'-exporterVersion': '1.2.0',
|
|
440
483
|
};
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
};
|
|
484
|
+
}
|
|
485
|
+
BpmnAdapter.prototype.setCustomShape = function (key, val) {
|
|
486
|
+
BpmnAdapter.shapeConfigMap.set(key, val);
|
|
487
|
+
};
|
|
488
|
+
BpmnAdapter.pluginName = 'bpmn-adapter';
|
|
489
|
+
BpmnAdapter.shapeConfigMap = new Map();
|
|
490
|
+
return BpmnAdapter;
|
|
491
|
+
}());
|
|
449
492
|
BpmnAdapter.shapeConfigMap.set(BpmnElements.START, {
|
|
450
493
|
width: StartEventConfig.width,
|
|
451
494
|
height: StartEventConfig.height,
|
|
@@ -466,20 +509,25 @@ BpmnAdapter.shapeConfigMap.set(BpmnElements.USER, {
|
|
|
466
509
|
width: UserTaskConfig.width,
|
|
467
510
|
height: UserTaskConfig.height,
|
|
468
511
|
});
|
|
469
|
-
var BpmnXmlAdapter = {
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
512
|
+
var BpmnXmlAdapter = /** @class */ (function (_super) {
|
|
513
|
+
__extends(BpmnXmlAdapter, _super);
|
|
514
|
+
function BpmnXmlAdapter(data) {
|
|
515
|
+
var _this = _super.call(this, data) || this;
|
|
516
|
+
_this.adapterXmlIn = function (bpmnData) {
|
|
517
|
+
var json = lfXml2Json(bpmnData);
|
|
518
|
+
return _this.adapterIn(json);
|
|
519
|
+
};
|
|
520
|
+
_this.adapterXmlOut = function (data) {
|
|
521
|
+
var outData = _this.adapterOut(data);
|
|
522
|
+
return lfJson2Xml(outData);
|
|
523
|
+
};
|
|
524
|
+
var lf = data.lf;
|
|
525
|
+
lf.adapterIn = _this.adapterXmlIn;
|
|
526
|
+
lf.adapterOut = _this.adapterXmlOut;
|
|
527
|
+
return _this;
|
|
528
|
+
}
|
|
529
|
+
BpmnXmlAdapter.pluginName = 'bpmnXmlAdapter';
|
|
530
|
+
return BpmnXmlAdapter;
|
|
531
|
+
}(BpmnAdapter));
|
|
484
532
|
export { BpmnAdapter, BpmnXmlAdapter, };
|
|
485
533
|
export default BpmnAdapter;
|
|
@@ -22,10 +22,13 @@ function toXml(v, name, ind, deep) {
|
|
|
22
22
|
var hasChild = false;
|
|
23
23
|
xml += addIndSpace(ind, deep) + "<" + name;
|
|
24
24
|
for (var m in v) {
|
|
25
|
-
if (m.charAt(0) == "-")
|
|
25
|
+
if (m.charAt(0) == "-") {
|
|
26
|
+
console.log(m, v[m]);
|
|
26
27
|
xml += " " + m.substr(1) + "=\"" + v[m].toString() + "\"";
|
|
27
|
-
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
28
30
|
hasChild = true;
|
|
31
|
+
}
|
|
29
32
|
}
|
|
30
33
|
xml += hasChild ? ">" : " />";
|
|
31
34
|
if (hasChild) {
|