@aranzatech/diagrams-bpmn 0.1.3 → 0.2.0
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/CHANGELOG.md +20 -0
- package/README.md +121 -0
- package/dist/{chunk-4AX573IV.js → chunk-5GRCJ5X6.js} +2 -2
- package/dist/{chunk-4AX573IV.js.map → chunk-5GRCJ5X6.js.map} +1 -1
- package/dist/chunk-G5S4ASP3.js +277 -0
- package/dist/chunk-G5S4ASP3.js.map +1 -0
- package/dist/{chunk-W3ROOC6E.js → chunk-MF2WE3OM.js} +145 -36
- package/dist/chunk-MF2WE3OM.js.map +1 -0
- package/dist/chunk-OZKTOILD.js +3 -0
- package/dist/chunk-OZKTOILD.js.map +1 -0
- package/dist/{chunk-NXMUX67A.js → chunk-S3GGEEA5.js} +31 -8
- package/dist/chunk-S3GGEEA5.js.map +1 -0
- package/dist/elements/index.d.cts +2 -2
- package/dist/elements/index.d.ts +2 -2
- package/dist/elements/index.js +2 -1
- package/dist/index.cjs +454 -66
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -62
- package/dist/index.d.ts +7 -62
- package/dist/index.js +6 -40
- package/dist/index.js.map +1 -1
- package/dist/modeling/index.cjs +894 -0
- package/dist/modeling/index.cjs.map +1 -0
- package/dist/modeling/index.d.cts +88 -0
- package/dist/modeling/index.d.ts +88 -0
- package/dist/modeling/index.js +5 -0
- package/dist/modeling/index.js.map +1 -0
- package/dist/nodes/index.cjs +29 -6
- package/dist/nodes/index.cjs.map +1 -1
- package/dist/nodes/index.js +1 -1
- package/dist/{types-C78d_Kdh.d.cts → types-BKA0GZz5.d.cts} +6 -18
- package/dist/{types-C78d_Kdh.d.ts → types-BKA0GZz5.d.ts} +6 -18
- package/dist/types-CCkHqtC_.d.cts +20 -0
- package/dist/types-hj621ZRJ.d.ts +20 -0
- package/dist/xml/index.cjs +143 -34
- package/dist/xml/index.cjs.map +1 -1
- package/dist/xml/index.d.cts +4 -19
- package/dist/xml/index.d.ts +4 -19
- package/dist/xml/index.js +1 -1
- package/package.json +10 -3
- package/dist/chunk-NXMUX67A.js.map +0 -1
- package/dist/chunk-W3ROOC6E.js.map +0 -1
|
@@ -23,8 +23,8 @@ var MODDLE_TO_ELEMENT_TYPE = {
|
|
|
23
23
|
"bpmn:EventBasedGateway": "EventBasedGateway",
|
|
24
24
|
"bpmn:ComplexGateway": "ComplexGateway",
|
|
25
25
|
"bpmn:SubProcess": "SubProcess",
|
|
26
|
-
"bpmn:AdHocSubProcess": "
|
|
27
|
-
"bpmn:Transaction": "
|
|
26
|
+
"bpmn:AdHocSubProcess": "AdHocSubProcess",
|
|
27
|
+
"bpmn:Transaction": "Transaction",
|
|
28
28
|
"bpmn:TextAnnotation": "Annotation",
|
|
29
29
|
"bpmn:Group": "Group",
|
|
30
30
|
"bpmn:DataObject": "DataObject",
|
|
@@ -62,6 +62,9 @@ var ELEMENT_TYPE_TO_MODDLE = {
|
|
|
62
62
|
EventBasedGateway: "bpmn:EventBasedGateway",
|
|
63
63
|
ComplexGateway: "bpmn:ComplexGateway",
|
|
64
64
|
SubProcess: "bpmn:SubProcess",
|
|
65
|
+
Transaction: "bpmn:Transaction",
|
|
66
|
+
EventSubProcess: "bpmn:SubProcess",
|
|
67
|
+
AdHocSubProcess: "bpmn:AdHocSubProcess",
|
|
65
68
|
Pool: "bpmn:Participant",
|
|
66
69
|
Lane: "bpmn:Lane",
|
|
67
70
|
Annotation: "bpmn:TextAnnotation",
|
|
@@ -126,6 +129,10 @@ function asElements(v) {
|
|
|
126
129
|
function asString(v) {
|
|
127
130
|
return typeof v === "string" && v.trim() ? v.trim() : void 0;
|
|
128
131
|
}
|
|
132
|
+
function extractDocumentation(el) {
|
|
133
|
+
const [doc] = asElements(el.documentation);
|
|
134
|
+
return asString(doc?.text);
|
|
135
|
+
}
|
|
129
136
|
function extractDiagramInfo(definitions) {
|
|
130
137
|
const shapes = /* @__PURE__ */ new Map();
|
|
131
138
|
const waypoints = /* @__PURE__ */ new Map();
|
|
@@ -181,6 +188,7 @@ function extractTrigger(el) {
|
|
|
181
188
|
function extractSubProcessVariant(el) {
|
|
182
189
|
if (el.$type === "bpmn:Transaction") return "transaction";
|
|
183
190
|
if (el.$type === "bpmn:AdHocSubProcess") return "adhoc";
|
|
191
|
+
if (el.$type === "bpmn:SubProcess" && el.triggeredByEvent === true) return "event";
|
|
184
192
|
if (el.triggeredByEvent === true) return "event";
|
|
185
193
|
return "embedded";
|
|
186
194
|
}
|
|
@@ -194,7 +202,7 @@ function walkFlowElements(elements, parentId, ctx, nodes, edges) {
|
|
|
194
202
|
continue;
|
|
195
203
|
}
|
|
196
204
|
if ($type === "bpmn:LaneSet") continue;
|
|
197
|
-
const elementType = MODDLE_TO_ELEMENT_TYPE[$type];
|
|
205
|
+
const elementType = $type === "bpmn:SubProcess" && el.triggeredByEvent === true ? "EventSubProcess" : MODDLE_TO_ELEMENT_TYPE[$type];
|
|
198
206
|
if (!elementType) {
|
|
199
207
|
ctx.warnings.push(`Unknown element type "${$type}" (id=${id}) \u2014 skipped.`);
|
|
200
208
|
continue;
|
|
@@ -215,22 +223,26 @@ function buildNode(el, elementType, parentId, ctx, nodes) {
|
|
|
215
223
|
const y = shape?.y ?? 100;
|
|
216
224
|
if (!shape) ctx.autoX.value += (meta?.defaultWidth ?? 120) + 20;
|
|
217
225
|
const label = asString(el.name);
|
|
226
|
+
const documentation = extractDocumentation(el);
|
|
218
227
|
const trigger = extractTrigger(el);
|
|
219
228
|
const isNonInterrupting = el.cancelActivity === false;
|
|
229
|
+
const attachedToRef = el.attachedToRef?.id;
|
|
220
230
|
const data = {
|
|
221
231
|
elementType,
|
|
222
232
|
...label ? { label } : {},
|
|
233
|
+
...documentation ? { documentation } : {},
|
|
223
234
|
...trigger ? { trigger } : {},
|
|
224
|
-
...isNonInterrupting ? { isNonInterrupting: true } : {}
|
|
235
|
+
...isNonInterrupting ? { isNonInterrupting: true } : {},
|
|
236
|
+
...attachedToRef ? { attachedToRef } : {}
|
|
225
237
|
};
|
|
226
|
-
if (elementType === "SubProcess") {
|
|
238
|
+
if (elementType === "SubProcess" || elementType === "Transaction" || elementType === "EventSubProcess" || elementType === "AdHocSubProcess") {
|
|
227
239
|
const variant = extractSubProcessVariant(el);
|
|
228
240
|
if (variant) data.subProcessVariant = variant;
|
|
229
241
|
const isExpanded = shape?.isExpanded ?? true;
|
|
230
242
|
data.isExpanded = isExpanded;
|
|
231
243
|
}
|
|
232
244
|
const laneId = ctx.laneMembership.get(id);
|
|
233
|
-
const effectiveParentId = laneId ?? parentId;
|
|
245
|
+
const effectiveParentId = attachedToRef ?? laneId ?? parentId;
|
|
234
246
|
const node = {
|
|
235
247
|
id,
|
|
236
248
|
type: elementType,
|
|
@@ -251,10 +263,12 @@ function buildEdge(el, edgeType, ctx, edges) {
|
|
|
251
263
|
return;
|
|
252
264
|
}
|
|
253
265
|
const label = asString(el.name);
|
|
266
|
+
const documentation = extractDocumentation(el);
|
|
254
267
|
const condExpr = el.conditionExpression;
|
|
255
268
|
const data = {
|
|
256
269
|
edgeType,
|
|
257
270
|
...label ? { label } : {},
|
|
271
|
+
...documentation ? { documentation } : {},
|
|
258
272
|
...condExpr?.body ? { conditionExpression: condExpr.body } : {}
|
|
259
273
|
};
|
|
260
274
|
const waypoints = ctx.waypoints.get(id);
|
|
@@ -355,7 +369,46 @@ async function parseBpmnXml(xml) {
|
|
|
355
369
|
);
|
|
356
370
|
}
|
|
357
371
|
}
|
|
358
|
-
|
|
372
|
+
const defaultFlowById = /* @__PURE__ */ new Set();
|
|
373
|
+
const nodeIds = new Set(nodes.map((node) => node.id));
|
|
374
|
+
for (const rootEl of asElements(rootElement.rootElements)) {
|
|
375
|
+
collectDefaultFlows(rootEl, defaultFlowById);
|
|
376
|
+
}
|
|
377
|
+
const normalizedEdges = edges.map((edge) => {
|
|
378
|
+
if (!defaultFlowById.has(edge.id)) return edge;
|
|
379
|
+
const data = {
|
|
380
|
+
edgeType: edge.data?.edgeType ?? edge.type,
|
|
381
|
+
...edge.data ?? {},
|
|
382
|
+
isDefault: true
|
|
383
|
+
};
|
|
384
|
+
return { ...edge, data };
|
|
385
|
+
});
|
|
386
|
+
return {
|
|
387
|
+
nodes: normalizeChildPositions(nodes, nodeIds),
|
|
388
|
+
edges: normalizedEdges,
|
|
389
|
+
warnings
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
function collectDefaultFlows(el, defaultFlowById) {
|
|
393
|
+
const defaultRef = el.default;
|
|
394
|
+
if (defaultRef?.id) defaultFlowById.add(defaultRef.id);
|
|
395
|
+
for (const child of asElements(el.rootElements)) collectDefaultFlows(child, defaultFlowById);
|
|
396
|
+
for (const child of asElements(el.flowElements)) collectDefaultFlows(child, defaultFlowById);
|
|
397
|
+
}
|
|
398
|
+
function normalizeChildPositions(nodes, nodeIds) {
|
|
399
|
+
const absoluteById = new Map(nodes.map((node) => [node.id, node.position]));
|
|
400
|
+
return nodes.map((node) => {
|
|
401
|
+
if (!node.parentId || !nodeIds.has(node.parentId)) return node;
|
|
402
|
+
const parentPosition = absoluteById.get(node.parentId);
|
|
403
|
+
if (!parentPosition) return node;
|
|
404
|
+
return {
|
|
405
|
+
...node,
|
|
406
|
+
position: {
|
|
407
|
+
x: node.position.x - parentPosition.x,
|
|
408
|
+
y: node.position.y - parentPosition.y
|
|
409
|
+
}
|
|
410
|
+
};
|
|
411
|
+
});
|
|
359
412
|
}
|
|
360
413
|
function uid(prefix, id) {
|
|
361
414
|
return `${prefix}_${id}`;
|
|
@@ -363,19 +416,6 @@ function uid(prefix, id) {
|
|
|
363
416
|
function asNodes(nodes, types) {
|
|
364
417
|
return nodes.filter((n) => types.includes(n.data.elementType));
|
|
365
418
|
}
|
|
366
|
-
function buildFlowableAttrs(data) {
|
|
367
|
-
const attrs = {};
|
|
368
|
-
if (data.flowableAssignee) attrs["flowable:assignee"] = data.flowableAssignee;
|
|
369
|
-
if (data.flowableCandidateGroups) attrs["flowable:candidateGroups"] = data.flowableCandidateGroups;
|
|
370
|
-
if (data.flowableCandidateUsers) attrs["flowable:candidateUsers"] = data.flowableCandidateUsers;
|
|
371
|
-
if (data.flowableFormKey) attrs["flowable:formKey"] = data.flowableFormKey;
|
|
372
|
-
if (data.flowableDueDate) attrs["flowable:dueDate"] = data.flowableDueDate;
|
|
373
|
-
if (data.flowableType) attrs["flowable:type"] = data.flowableType;
|
|
374
|
-
if (data.flowableExpression) attrs["flowable:expression"] = data.flowableExpression;
|
|
375
|
-
if (data.flowableClass) attrs["flowable:class"] = data.flowableClass;
|
|
376
|
-
if (data.flowableDelegateExpression) attrs["flowable:delegateExpression"] = data.flowableDelegateExpression;
|
|
377
|
-
return attrs;
|
|
378
|
-
}
|
|
379
419
|
function buildSemanticModel(moddle, nodes, edges, opts) {
|
|
380
420
|
const defId = opts.id ?? "Definitions_1";
|
|
381
421
|
const defName = opts.name;
|
|
@@ -434,13 +474,26 @@ function buildSemanticModel(moddle, nodes, edges, opts) {
|
|
|
434
474
|
return definitions;
|
|
435
475
|
}
|
|
436
476
|
function buildProcess(moddle, allNodes, allEdges, poolId, laneNodes, processId) {
|
|
437
|
-
const
|
|
477
|
+
const subProcessIds = new Set(
|
|
478
|
+
allNodes.filter(
|
|
479
|
+
(n) => n.data.elementType === "SubProcess" || n.data.elementType === "Transaction" || n.data.elementType === "EventSubProcess" || n.data.elementType === "AdHocSubProcess"
|
|
480
|
+
).map((n) => n.id)
|
|
481
|
+
);
|
|
482
|
+
const isInsideSubProcess = (node) => {
|
|
483
|
+
let parentId = node.parentId;
|
|
484
|
+
while (parentId) {
|
|
485
|
+
if (subProcessIds.has(parentId)) return true;
|
|
486
|
+
parentId = allNodes.find((candidate) => candidate.id === parentId)?.parentId;
|
|
487
|
+
}
|
|
488
|
+
return false;
|
|
489
|
+
};
|
|
490
|
+
const myNodes = (poolId ? allNodes.filter(
|
|
438
491
|
(n) => n.parentId === poolId || laneNodes.some((l) => l.id === n.parentId && l.parentId === poolId)
|
|
439
|
-
) : allNodes.filter((n) => n.data.elementType !== "Pool" && n.data.elementType !== "Lane");
|
|
492
|
+
) : allNodes.filter((n) => n.data.elementType !== "Pool" && n.data.elementType !== "Lane")).filter((n) => !isInsideSubProcess(n));
|
|
440
493
|
const myLanes = laneNodes.filter((l) => poolId ? l.parentId === poolId : true);
|
|
441
494
|
const flowElements = [];
|
|
442
495
|
for (const node of myNodes) {
|
|
443
|
-
const el = buildFlowElement(moddle, node);
|
|
496
|
+
const el = buildFlowElement(moddle, node, allNodes, allEdges);
|
|
444
497
|
if (el) flowElements.push(el);
|
|
445
498
|
}
|
|
446
499
|
const myNodeIds = new Set(myNodes.map((n) => n.id));
|
|
@@ -451,6 +504,17 @@ function buildProcess(moddle, allNodes, allEdges, poolId, laneNodes, processId)
|
|
|
451
504
|
const edgeMeta = buildEdgeElement(moddle, edge);
|
|
452
505
|
if (edgeMeta) flowElements.push(edgeMeta);
|
|
453
506
|
}
|
|
507
|
+
const elementById = new Map(
|
|
508
|
+
flowElements.filter((element) => typeof element.id === "string").map((element) => [element.id, element])
|
|
509
|
+
);
|
|
510
|
+
for (const edge of myEdges) {
|
|
511
|
+
if (!edge.data?.isDefault) continue;
|
|
512
|
+
const sourceElement = elementById.get(edge.source);
|
|
513
|
+
const edgeElement = elementById.get(edge.id);
|
|
514
|
+
if (sourceElement && edgeElement) {
|
|
515
|
+
sourceElement.default = edgeElement;
|
|
516
|
+
}
|
|
517
|
+
}
|
|
454
518
|
const process = moddle.create("bpmn:Process", {
|
|
455
519
|
id: processId,
|
|
456
520
|
isExecutable: true,
|
|
@@ -471,7 +535,7 @@ function buildProcess(moddle, allNodes, allEdges, poolId, laneNodes, processId)
|
|
|
471
535
|
}
|
|
472
536
|
return process;
|
|
473
537
|
}
|
|
474
|
-
function buildFlowElement(moddle, node,
|
|
538
|
+
function buildFlowElement(moddle, node, allNodes, allEdges) {
|
|
475
539
|
const { elementType, label, trigger } = node.data;
|
|
476
540
|
if (elementType === "Pool" || elementType === "Lane") return null;
|
|
477
541
|
const moddleType = ELEMENT_TYPE_TO_MODDLE[elementType];
|
|
@@ -480,25 +544,46 @@ function buildFlowElement(moddle, node, _allNodes, _allEdges) {
|
|
|
480
544
|
id: node.id,
|
|
481
545
|
name: label ?? ""
|
|
482
546
|
};
|
|
547
|
+
if (node.data.documentation) {
|
|
548
|
+
attrs.documentation = [
|
|
549
|
+
moddle.create("bpmn:Documentation", { text: node.data.documentation })
|
|
550
|
+
];
|
|
551
|
+
}
|
|
483
552
|
if (trigger && trigger !== "none") {
|
|
484
553
|
const defType = TRIGGER_TO_EVENT_DEF[trigger];
|
|
485
554
|
if (defType) {
|
|
486
555
|
attrs.eventDefinitions = [moddle.create(defType, { id: uid("EventDef", node.id) })];
|
|
487
556
|
}
|
|
488
557
|
}
|
|
489
|
-
if (elementType === "
|
|
490
|
-
|
|
558
|
+
if (elementType === "BoundaryEvent") {
|
|
559
|
+
attrs.attachedToRef = { id: node.data.attachedToRef ?? node.parentId };
|
|
560
|
+
attrs.cancelActivity = node.data.isNonInterrupting ? false : true;
|
|
491
561
|
}
|
|
492
|
-
|
|
493
|
-
|
|
562
|
+
const isSubProcess = elementType === "SubProcess" || elementType === "Transaction" || elementType === "EventSubProcess" || elementType === "AdHocSubProcess";
|
|
563
|
+
if (isSubProcess) {
|
|
564
|
+
attrs.flowElements = buildNestedFlowElements(moddle, node, allNodes, allEdges);
|
|
565
|
+
if (elementType === "EventSubProcess" || node.data.subProcessVariant === "event") {
|
|
566
|
+
attrs.triggeredByEvent = true;
|
|
567
|
+
}
|
|
494
568
|
}
|
|
495
569
|
const element = moddle.create(moddleType, attrs);
|
|
496
|
-
const flowableAttrs = buildFlowableAttrs(node.data);
|
|
497
|
-
if (Object.keys(flowableAttrs).length > 0) {
|
|
498
|
-
element.$attrs = flowableAttrs;
|
|
499
|
-
}
|
|
500
570
|
return element;
|
|
501
571
|
}
|
|
572
|
+
function buildNestedFlowElements(moddle, parent, allNodes, allEdges) {
|
|
573
|
+
const childNodes = allNodes.filter((node) => node.parentId === parent.id);
|
|
574
|
+
const childNodeIds = new Set(childNodes.map((node) => node.id));
|
|
575
|
+
const flowElements = [];
|
|
576
|
+
for (const child of childNodes) {
|
|
577
|
+
const element = buildFlowElement(moddle, child, allNodes, allEdges);
|
|
578
|
+
if (element) flowElements.push(element);
|
|
579
|
+
}
|
|
580
|
+
for (const edge of allEdges) {
|
|
581
|
+
if (!childNodeIds.has(edge.source) || !childNodeIds.has(edge.target)) continue;
|
|
582
|
+
const element = buildEdgeElement(moddle, edge);
|
|
583
|
+
if (element) flowElements.push(element);
|
|
584
|
+
}
|
|
585
|
+
return flowElements;
|
|
586
|
+
}
|
|
502
587
|
function buildEdgeElement(moddle, edge) {
|
|
503
588
|
if (!edge.data) return null;
|
|
504
589
|
const moddleType = EDGE_TYPE_TO_MODDLE[edge.data.edgeType];
|
|
@@ -509,6 +594,11 @@ function buildEdgeElement(moddle, edge) {
|
|
|
509
594
|
sourceRef: { id: edge.source },
|
|
510
595
|
targetRef: { id: edge.target }
|
|
511
596
|
};
|
|
597
|
+
if (edge.data.documentation) {
|
|
598
|
+
attrs.documentation = [
|
|
599
|
+
moddle.create("bpmn:Documentation", { text: edge.data.documentation })
|
|
600
|
+
];
|
|
601
|
+
}
|
|
512
602
|
if (edge.data.conditionExpression) {
|
|
513
603
|
attrs.conditionExpression = moddle.create("bpmn:FormalExpression", {
|
|
514
604
|
body: edge.data.conditionExpression
|
|
@@ -519,13 +609,14 @@ function buildEdgeElement(moddle, edge) {
|
|
|
519
609
|
function buildBpmnDI(moddle, definitions, nodes, edges) {
|
|
520
610
|
const shapes = [];
|
|
521
611
|
const edgeShapes = [];
|
|
612
|
+
const absolutePositionById = buildAbsolutePositionMap(nodes);
|
|
522
613
|
for (const node of nodes) {
|
|
523
614
|
const meta = BPMN_ELEMENT_CATALOG[node.data.elementType];
|
|
524
615
|
const w = node.width ?? meta?.defaultWidth ?? 120;
|
|
525
616
|
const h = node.height ?? meta?.defaultHeight ?? 60;
|
|
526
617
|
const bounds = moddle.create("dc:Bounds", {
|
|
527
|
-
x: node.position.x,
|
|
528
|
-
y: node.position.y,
|
|
618
|
+
x: absolutePositionById.get(node.id)?.x ?? node.position.x,
|
|
619
|
+
y: absolutePositionById.get(node.id)?.y ?? node.position.y,
|
|
529
620
|
width: w,
|
|
530
621
|
height: h
|
|
531
622
|
});
|
|
@@ -564,6 +655,24 @@ function buildBpmnDI(moddle, definitions, nodes, edges) {
|
|
|
564
655
|
});
|
|
565
656
|
definitions.diagrams = [diagram];
|
|
566
657
|
}
|
|
658
|
+
function buildAbsolutePositionMap(nodes) {
|
|
659
|
+
const nodeById = new Map(nodes.map((node) => [node.id, node]));
|
|
660
|
+
const absoluteById = /* @__PURE__ */ new Map();
|
|
661
|
+
function resolve(node) {
|
|
662
|
+
const cached = absoluteById.get(node.id);
|
|
663
|
+
if (cached) return cached;
|
|
664
|
+
const parent = node.parentId ? nodeById.get(node.parentId) : void 0;
|
|
665
|
+
const parentPosition = parent ? resolve(parent) : { x: 0, y: 0 };
|
|
666
|
+
const absolute = {
|
|
667
|
+
x: parentPosition.x + node.position.x,
|
|
668
|
+
y: parentPosition.y + node.position.y
|
|
669
|
+
};
|
|
670
|
+
absoluteById.set(node.id, absolute);
|
|
671
|
+
return absolute;
|
|
672
|
+
}
|
|
673
|
+
for (const node of nodes) resolve(node);
|
|
674
|
+
return absoluteById;
|
|
675
|
+
}
|
|
567
676
|
async function serializeBpmnXml(nodes, edges, opts = {}) {
|
|
568
677
|
const moddle = new BpmnModdle();
|
|
569
678
|
const definitions = buildSemanticModel(moddle, nodes, edges, opts);
|
|
@@ -575,5 +684,5 @@ async function serializeBpmnXml(nodes, edges, opts = {}) {
|
|
|
575
684
|
}
|
|
576
685
|
|
|
577
686
|
export { parseBpmnXml, serializeBpmnXml };
|
|
578
|
-
//# sourceMappingURL=chunk-
|
|
579
|
-
//# sourceMappingURL=chunk-
|
|
687
|
+
//# sourceMappingURL=chunk-MF2WE3OM.js.map
|
|
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B,EAAA,MAAM,WAAA,GAAc,kBAAA,CAAmB,MAAA,EAAQ,KAAA,EAAO,OAAO,IAAI,CAAA;AACjE,EAAA,WAAA,CAAY,MAAA,EAAQ,WAAA,EAAa,KAAA,EAAO,KAAK,CAAA;AAE7C,EAAA,MAAM,EAAE,GAAA,EAAI,GAAI,MAAM,MAAA,CAAO,MAAM,WAAA,EAAa;AAAA,IAC9C,MAAA,EAAQ,KAAK,MAAA,IAAU;AAAA,GACxB,CAAA;AAED,EAAA,OAAO,GAAA;AACT","file":"chunk-MF2WE3OM.js","sourcesContent":["import type { BpmnElementType, BpmnEdgeType, EventTrigger } from \"../elements/types\";\n\n// ─── BPMN moddle $type → our BpmnElementType ─────────────────────────────────\n\nexport const MODDLE_TO_ELEMENT_TYPE: Record<string, BpmnElementType | undefined> = {\n \"bpmn:StartEvent\": \"StartEvent\",\n \"bpmn:EndEvent\": \"EndEvent\",\n \"bpmn:IntermediateCatchEvent\": \"IntermediateCatchEvent\",\n \"bpmn:IntermediateThrowEvent\": \"IntermediateThrowEvent\",\n \"bpmn:BoundaryEvent\": \"BoundaryEvent\",\n \"bpmn:Task\": \"Task\",\n \"bpmn:UserTask\": \"UserTask\",\n \"bpmn:ServiceTask\": \"ServiceTask\",\n \"bpmn:ScriptTask\": \"ScriptTask\",\n \"bpmn:ManualTask\": \"ManualTask\",\n \"bpmn:BusinessRuleTask\": \"BusinessRuleTask\",\n \"bpmn:ReceiveTask\": \"ReceiveTask\",\n \"bpmn:SendTask\": \"SendTask\",\n \"bpmn:CallActivity\": \"CallActivity\",\n \"bpmn:ExclusiveGateway\": \"ExclusiveGateway\",\n \"bpmn:InclusiveGateway\": \"InclusiveGateway\",\n \"bpmn:ParallelGateway\": \"ParallelGateway\",\n \"bpmn:EventBasedGateway\": \"EventBasedGateway\",\n \"bpmn:ComplexGateway\": \"ComplexGateway\",\n \"bpmn:SubProcess\": \"SubProcess\",\n \"bpmn:AdHocSubProcess\": \"AdHocSubProcess\",\n \"bpmn:Transaction\": \"Transaction\",\n \"bpmn:TextAnnotation\": \"Annotation\",\n \"bpmn:Group\": \"Group\",\n \"bpmn:DataObject\": \"DataObject\",\n \"bpmn:DataObjectReference\": \"DataObjectReference\",\n \"bpmn:DataInput\": \"DataInput\",\n \"bpmn:DataOutput\": \"DataOutput\",\n \"bpmn:DataStore\": \"DataStore\",\n \"bpmn:DataStoreReference\": \"DataStoreReference\",\n \"bpmn:Conversation\": \"Conversation\",\n \"bpmn:SubConversation\": \"SubConversation\",\n \"bpmn:CallConversation\": \"CallConversation\",\n \"bpmn:ChoreographyTask\": \"ChoreographyTask\",\n \"bpmn:SubChoreography\": \"SubChoreography\",\n \"bpmn:CallChoreography\": \"CallChoreography\",\n \"bpmn:Lane\": \"Lane\",\n};\n\n// ─── Our BpmnElementType → canonical bpmn: type ──────────────────────────────\n\nexport const ELEMENT_TYPE_TO_MODDLE: Partial<Record<BpmnElementType, string>> = {\n StartEvent: \"bpmn:StartEvent\",\n EndEvent: \"bpmn:EndEvent\",\n IntermediateCatchEvent: \"bpmn:IntermediateCatchEvent\",\n IntermediateThrowEvent: \"bpmn:IntermediateThrowEvent\",\n BoundaryEvent: \"bpmn:BoundaryEvent\",\n Task: \"bpmn:Task\",\n UserTask: \"bpmn:UserTask\",\n ServiceTask: \"bpmn:ServiceTask\",\n ScriptTask: \"bpmn:ScriptTask\",\n ManualTask: \"bpmn:ManualTask\",\n BusinessRuleTask: \"bpmn:BusinessRuleTask\",\n ReceiveTask: \"bpmn:ReceiveTask\",\n SendTask: \"bpmn:SendTask\",\n CallActivity: \"bpmn:CallActivity\",\n ExclusiveGateway: \"bpmn:ExclusiveGateway\",\n InclusiveGateway: \"bpmn:InclusiveGateway\",\n ParallelGateway: \"bpmn:ParallelGateway\",\n EventBasedGateway: \"bpmn:EventBasedGateway\",\n ComplexGateway: \"bpmn:ComplexGateway\",\n SubProcess: \"bpmn:SubProcess\",\n Transaction: \"bpmn:Transaction\",\n EventSubProcess: \"bpmn:SubProcess\",\n AdHocSubProcess: \"bpmn:AdHocSubProcess\",\n Pool: \"bpmn:Participant\",\n Lane: \"bpmn:Lane\",\n Annotation: \"bpmn:TextAnnotation\",\n Group: \"bpmn:Group\",\n DataObject: \"bpmn:DataObject\",\n DataObjectReference: \"bpmn:DataObjectReference\",\n DataInput: \"bpmn:DataInput\",\n DataOutput: \"bpmn:DataOutput\",\n DataStore: \"bpmn:DataStore\",\n DataStoreReference: \"bpmn:DataStoreReference\",\n Conversation: \"bpmn:Conversation\",\n SubConversation: \"bpmn:SubConversation\",\n CallConversation: \"bpmn:CallConversation\",\n ChoreographyTask: \"bpmn:ChoreographyTask\",\n SubChoreography: \"bpmn:SubChoreography\",\n CallChoreography: \"bpmn:CallChoreography\",\n};\n\n// ─── Edge type mappings ───────────────────────────────────────────────────────\n\nexport const MODDLE_TO_EDGE_TYPE: Record<string, BpmnEdgeType | undefined> = {\n \"bpmn:SequenceFlow\": \"sequenceFlow\",\n \"bpmn:MessageFlow\": \"messageFlow\",\n \"bpmn:Association\": \"association\",\n \"bpmn:DataInputAssociation\": \"dataAssociation\",\n \"bpmn:DataOutputAssociation\": \"dataAssociation\",\n \"bpmn:ConversationLink\": \"conversationLink\",\n};\n\nexport const EDGE_TYPE_TO_MODDLE: Record<BpmnEdgeType, string> = {\n sequenceFlow: \"bpmn:SequenceFlow\",\n messageFlow: \"bpmn:MessageFlow\",\n association: \"bpmn:Association\",\n dataAssociation: \"bpmn:DataInputAssociation\",\n conversationLink:\"bpmn:ConversationLink\",\n};\n\n// ─── Event definition type → trigger ─────────────────────────────────────────\n\nexport const EVENT_DEF_TO_TRIGGER: Record<string, EventTrigger> = {\n \"bpmn:MessageEventDefinition\": \"message\",\n \"bpmn:TimerEventDefinition\": \"timer\",\n \"bpmn:EscalationEventDefinition\": \"escalation\",\n \"bpmn:ConditionalEventDefinition\": \"conditional\",\n \"bpmn:ErrorEventDefinition\": \"error\",\n \"bpmn:CancelEventDefinition\": \"cancel\",\n \"bpmn:CompensateEventDefinition\": \"compensation\",\n \"bpmn:SignalEventDefinition\": \"signal\",\n \"bpmn:LinkEventDefinition\": \"link\",\n \"bpmn:TerminateEventDefinition\": \"terminate\",\n};\n\nexport const TRIGGER_TO_EVENT_DEF: Partial<Record<EventTrigger, string>> = {\n message: \"bpmn:MessageEventDefinition\",\n timer: \"bpmn:TimerEventDefinition\",\n escalation: \"bpmn:EscalationEventDefinition\",\n conditional: \"bpmn:ConditionalEventDefinition\",\n error: \"bpmn:ErrorEventDefinition\",\n cancel: \"bpmn:CancelEventDefinition\",\n compensation: \"bpmn:CompensateEventDefinition\",\n signal: \"bpmn:SignalEventDefinition\",\n link: \"bpmn:LinkEventDefinition\",\n terminate: \"bpmn:TerminateEventDefinition\",\n};\n","import { BpmnModdle, type ModdleElement } from \"bpmn-moddle\";\nimport { BPMN_ELEMENT_CATALOG } from \"../elements/catalog\";\nimport type { BpmnElementType, BpmnEdgeType, BpmnNodeData, BpmnEdgeData, EventTrigger, SubProcessVariant } from \"../elements/types\";\nimport type { BpmnRFNode, BpmnRFEdge, BpmnImportResult } from \"./types\";\nimport {\n MODDLE_TO_ELEMENT_TYPE,\n MODDLE_TO_EDGE_TYPE,\n EVENT_DEF_TO_TRIGGER,\n} from \"./mapper\";\n\n// ─── Internal helpers ─────────────────────────────────────────────────────────\n\ninterface ShapeInfo {\n x: number;\n y: number;\n width: number;\n height: number;\n isExpanded?: boolean;\n}\n\ntype ShapeMap = Map<string, ShapeInfo>;\ntype WaypointMap = Map<string, Array<{ x: number; y: number }>>;\n\nfunction asElements(v: unknown): ModdleElement[] {\n return Array.isArray(v) ? (v as ModdleElement[]) : [];\n}\n\nfunction asString(v: unknown): string | undefined {\n return typeof v === \"string\" && v.trim() ? v.trim() : undefined;\n}\n\nfunction extractDocumentation(el: ModdleElement): string | undefined {\n const [doc] = asElements(el.documentation);\n return asString(doc?.text);\n}\n\n// ─── Extract BPMNDI shape/edge positions ─────────────────────────────────────\n\nfunction extractDiagramInfo(definitions: ModdleElement): {\n shapes: ShapeMap;\n waypoints: WaypointMap;\n} {\n const shapes: ShapeMap = new Map();\n const waypoints: WaypointMap = new Map();\n\n for (const diagram of asElements(definitions.diagrams)) {\n const plane = diagram.plane as ModdleElement | undefined;\n if (!plane) continue;\n\n for (const el of asElements(plane.planeElement)) {\n const bpmnEl = el.bpmnElement as ModdleElement | undefined;\n if (!bpmnEl?.id) continue;\n const id = bpmnEl.id as string;\n\n if (el.$type === \"bpmndi:BPMNShape\") {\n const b = el.bounds as { x: number; y: number; width: number; height: number } | undefined;\n if (b) {\n shapes.set(id, {\n x: b.x,\n y: b.y,\n width: b.width,\n height: b.height,\n ...(typeof el.isExpanded === \"boolean\" ? { isExpanded: el.isExpanded as boolean } : {}),\n });\n }\n } else if (el.$type === \"bpmndi:BPMNEdge\") {\n const pts = (el.waypoint ?? []) as Array<{ x: number; y: number }>;\n if (pts.length) waypoints.set(id, pts);\n }\n }\n }\n\n return { shapes, waypoints };\n}\n\n// ─── Lane membership (flowNodeId → laneId) ───────────────────────────────────\n\nfunction extractLaneMembership(process: ModdleElement): Map<string, string> {\n const map = new Map<string, string>();\n\n function walkLaneSet(laneSet: ModdleElement) {\n for (const lane of asElements(laneSet.lanes)) {\n const laneId = lane.id as string | undefined;\n if (!laneId) continue;\n for (const ref of asElements(lane.flowNodeRef)) {\n if (ref.id) map.set(ref.id as string, laneId);\n }\n const child = lane.childLaneSet as ModdleElement | undefined;\n if (child) walkLaneSet(child);\n }\n }\n\n const laneSet = process.laneSet as ModdleElement | undefined;\n if (laneSet) walkLaneSet(laneSet);\n return map;\n}\n\n// ─── Event trigger from eventDefinitions ─────────────────────────────────────\n\nfunction extractTrigger(el: ModdleElement): EventTrigger | undefined {\n const defs = asElements(el.eventDefinitions);\n if (defs.length === 0) return undefined;\n if (defs.length > 1) return el.$type.includes(\"Parallel\") ? \"parallelMultiple\" : \"multiple\";\n return EVENT_DEF_TO_TRIGGER[defs[0].$type];\n}\n\n// ─── SubProcessVariant from moddle type / properties ─────────────────────────\n\nfunction extractSubProcessVariant(el: ModdleElement): SubProcessVariant | undefined {\n if (el.$type === \"bpmn:Transaction\") return \"transaction\";\n if (el.$type === \"bpmn:AdHocSubProcess\") return \"adhoc\";\n if (el.$type === \"bpmn:SubProcess\" && el.triggeredByEvent === true) return \"event\";\n if (el.triggeredByEvent === true) return \"event\";\n return \"embedded\";\n}\n\n// ─── Walk a flowElements list, producing nodes and edges ─────────────────────\n\ninterface WalkContext {\n shapes: ShapeMap;\n waypoints: WaypointMap;\n laneMembership: Map<string, string>;\n warnings: string[];\n autoX: { value: number };\n}\n\nfunction walkFlowElements(\n elements: ModdleElement[],\n parentId: string | undefined,\n ctx: WalkContext,\n nodes: BpmnRFNode[],\n edges: BpmnRFEdge[],\n) {\n for (const el of elements) {\n const { $type, id } = el;\n if (!id) continue;\n\n const edgeType = MODDLE_TO_EDGE_TYPE[$type];\n if (edgeType !== undefined) {\n buildEdge(el, edgeType, ctx, edges);\n continue;\n }\n\n // Lane nodes are handled separately via laneMembership\n if ($type === \"bpmn:LaneSet\") continue;\n\n const elementType =\n $type === \"bpmn:SubProcess\" && el.triggeredByEvent === true\n ? \"EventSubProcess\"\n : MODDLE_TO_ELEMENT_TYPE[$type];\n if (!elementType) {\n ctx.warnings.push(`Unknown element type \"${$type}\" (id=${id as string}) — skipped.`);\n continue;\n }\n\n buildNode(el, elementType, parentId, ctx, nodes);\n\n // Recurse into subprocess children\n if ($type === \"bpmn:SubProcess\" || $type === \"bpmn:Transaction\" || $type === \"bpmn:AdHocSubProcess\") {\n const children = asElements(el.flowElements);\n const laneMembership = extractLaneMembership(el);\n walkFlowElements(children, id as string, { ...ctx, laneMembership }, nodes, edges);\n }\n }\n}\n\nfunction buildNode(\n el: ModdleElement,\n elementType: BpmnElementType,\n parentId: string | undefined,\n ctx: WalkContext,\n nodes: BpmnRFNode[],\n) {\n const id = el.id as string;\n const meta = BPMN_ELEMENT_CATALOG[elementType];\n const shape = ctx.shapes.get(id);\n\n // Position: use BPMNDI if available, otherwise auto-grid\n const x = shape?.x ?? ctx.autoX.value;\n const y = shape?.y ?? 100;\n if (!shape) ctx.autoX.value += (meta?.defaultWidth ?? 120) + 20;\n\n const label = asString(el.name);\n const documentation = extractDocumentation(el);\n const trigger = extractTrigger(el);\n const isNonInterrupting = el.cancelActivity === false;\n const attachedToRef = (el.attachedToRef as ModdleElement | undefined)?.id as string | undefined;\n\n const data: BpmnNodeData = {\n elementType,\n ...(label ? { label } : {}),\n ...(documentation ? { documentation } : {}),\n ...(trigger ? { trigger } : {}),\n ...(isNonInterrupting ? { isNonInterrupting: true } : {}),\n ...(attachedToRef ? { attachedToRef } : {}),\n };\n\n // SubProcess variant\n if (elementType === \"SubProcess\" || elementType === \"Transaction\" || elementType === \"EventSubProcess\" || elementType === \"AdHocSubProcess\") {\n const variant = extractSubProcessVariant(el);\n if (variant) data.subProcessVariant = variant;\n const isExpanded = shape?.isExpanded ?? true;\n data.isExpanded = isExpanded;\n }\n\n // Determine effective parentId: lane membership overrides process-level parent\n const laneId = ctx.laneMembership.get(id);\n const effectiveParentId = attachedToRef ?? laneId ?? parentId;\n\n const node: BpmnRFNode = {\n id,\n type: elementType,\n position: { x, y },\n data,\n width: shape?.width ?? meta?.defaultWidth,\n height: shape?.height ?? meta?.defaultHeight,\n ...(effectiveParentId ? { parentId: effectiveParentId } : {}),\n };\n\n nodes.push(node);\n}\n\nfunction buildEdge(\n el: ModdleElement,\n edgeType: BpmnEdgeType,\n ctx: WalkContext,\n edges: BpmnRFEdge[],\n) {\n const id = el.id as string;\n const source = (el.sourceRef as ModdleElement | undefined)?.id as string | undefined;\n const target = (el.targetRef as ModdleElement | undefined)?.id as string | undefined;\n\n if (!source || !target) {\n ctx.warnings.push(`Edge \"${id}\" missing source or target — skipped.`);\n return;\n }\n\n const label = asString(el.name);\n const documentation = extractDocumentation(el);\n const condExpr = el.conditionExpression as { body?: string } | undefined;\n\n const data: BpmnEdgeData = {\n edgeType,\n ...(label ? { label } : {}),\n ...(documentation ? { documentation } : {}),\n ...(condExpr?.body ? { conditionExpression: condExpr.body } : {}),\n };\n\n const waypoints = ctx.waypoints.get(id);\n if (waypoints?.length) data.routingPoints = waypoints;\n\n edges.push({ id, type: edgeType, source, target, data });\n}\n\n// ─── Handle Collaboration: Participants → Pool nodes ──────────────────────────\n\nfunction handleCollaboration(\n collaboration: ModdleElement,\n ctx: WalkContext,\n nodes: BpmnRFNode[],\n edges: BpmnRFEdge[],\n) {\n // Participants become Pool nodes\n for (const participant of asElements(collaboration.participants)) {\n const id = participant.id as string | undefined;\n if (!id) continue;\n const label = asString(participant.name);\n const shape = ctx.shapes.get(id);\n\n const poolNode: BpmnRFNode = {\n id,\n type: \"Pool\",\n position: { x: shape?.x ?? 0, y: shape?.y ?? 0 },\n data: { elementType: \"Pool\", ...(label ? { label } : {}) },\n width: shape?.width ?? 600,\n height: shape?.height ?? 200,\n };\n nodes.push(poolNode);\n\n // Walk the referenced process, assigning pool as parent\n const processRef = participant.processRef as ModdleElement | undefined;\n if (processRef) {\n const laneMembership = extractLaneMembership(processRef);\n walkFlowElements(\n asElements(processRef.flowElements),\n id,\n { ...ctx, laneMembership },\n nodes,\n edges,\n );\n\n // Add Lane nodes\n const laneSet = processRef.laneSet as ModdleElement | undefined;\n if (laneSet) {\n addLaneNodes(laneSet, id, ctx, nodes);\n }\n }\n }\n\n // Message flows\n for (const mf of asElements(collaboration.messageFlows)) {\n buildEdge(mf, \"messageFlow\", ctx, edges);\n }\n\n // Conversation links\n for (const cl of asElements(collaboration.conversationLinks)) {\n buildEdge(cl, \"conversationLink\", ctx, edges);\n }\n}\n\nfunction addLaneNodes(\n laneSet: ModdleElement,\n poolId: string,\n ctx: WalkContext,\n nodes: BpmnRFNode[],\n) {\n for (const lane of asElements(laneSet.lanes)) {\n const id = lane.id as string | undefined;\n if (!id) continue;\n const label = asString(lane.name);\n const shape = ctx.shapes.get(id);\n\n nodes.push({\n id,\n type: \"Lane\",\n position: { x: shape?.x ?? 30, y: shape?.y ?? 0 },\n data: { elementType: \"Lane\", ...(label ? { label } : {}) },\n width: shape?.width ?? 570,\n height: shape?.height ?? 120,\n parentId: poolId,\n });\n\n const child = lane.childLaneSet as ModdleElement | undefined;\n if (child) addLaneNodes(child, poolId, ctx, nodes);\n }\n}\n\n// ─── Public: parseBpmnXml ─────────────────────────────────────────────────────\n\nexport async function parseBpmnXml(xml: string): Promise<BpmnImportResult> {\n const moddle = new BpmnModdle();\n const warnings: string[] = [];\n\n let rootElement: ModdleElement;\n try {\n const result = await moddle.fromXML(xml);\n rootElement = result.rootElement;\n for (const w of result.warnings) warnings.push(w.message);\n } catch (err) {\n throw new Error(`Failed to parse BPMN XML: ${String(err)}`);\n }\n\n const nodes: BpmnRFNode[] = [];\n const edges: BpmnRFEdge[] = [];\n\n const { shapes, waypoints } = extractDiagramInfo(rootElement);\n const ctx: WalkContext = {\n shapes,\n waypoints,\n laneMembership: new Map(),\n warnings,\n autoX: { value: 50 },\n };\n\n for (const rootEl of asElements(rootElement.rootElements)) {\n if (rootEl.$type === \"bpmn:Collaboration\") {\n handleCollaboration(rootEl, ctx, nodes, edges);\n } else if (rootEl.$type === \"bpmn:Process\") {\n const laneMembership = extractLaneMembership(rootEl);\n const laneSet = rootEl.laneSet as ModdleElement | undefined;\n if (laneSet) addLaneNodes(laneSet, \"\", ctx, nodes);\n walkFlowElements(\n asElements(rootEl.flowElements),\n undefined,\n { ...ctx, laneMembership },\n nodes,\n edges,\n );\n }\n }\n\n const defaultFlowById = new Set<string>();\n const nodeIds = new Set(nodes.map((node) => node.id));\n for (const rootEl of asElements(rootElement.rootElements)) {\n collectDefaultFlows(rootEl, defaultFlowById);\n }\n\n const normalizedEdges: BpmnRFEdge[] = edges.map((edge) => {\n if (!defaultFlowById.has(edge.id)) return edge;\n const data: BpmnEdgeData = {\n edgeType: edge.data?.edgeType ?? (edge.type as BpmnEdgeType),\n ...(edge.data ?? {}),\n isDefault: true,\n };\n return { ...edge, data };\n });\n\n return {\n nodes: normalizeChildPositions(nodes, nodeIds),\n edges: normalizedEdges,\n warnings,\n };\n}\n\nfunction collectDefaultFlows(el: ModdleElement, defaultFlowById: Set<string>): void {\n const defaultRef = el.default as ModdleElement | undefined;\n if (defaultRef?.id) defaultFlowById.add(defaultRef.id as string);\n\n for (const child of asElements(el.rootElements)) collectDefaultFlows(child, defaultFlowById);\n for (const child of asElements(el.flowElements)) collectDefaultFlows(child, defaultFlowById);\n}\n\nfunction normalizeChildPositions(nodes: BpmnRFNode[], nodeIds: Set<string>): BpmnRFNode[] {\n const absoluteById = new Map(nodes.map((node) => [node.id, node.position]));\n\n return nodes.map((node) => {\n if (!node.parentId || !nodeIds.has(node.parentId)) return node;\n const parentPosition = absoluteById.get(node.parentId);\n if (!parentPosition) return node;\n\n return {\n ...node,\n position: {\n x: node.position.x - parentPosition.x,\n y: node.position.y - parentPosition.y,\n },\n };\n });\n}\n","import { BpmnModdle, type ModdleElement } from \"bpmn-moddle\";\nimport { BPMN_ELEMENT_CATALOG } from \"../elements/catalog\";\nimport type { BpmnRFNode, BpmnRFEdge, BpmnExportOptions } from \"./types\";\nimport {\n ELEMENT_TYPE_TO_MODDLE,\n EDGE_TYPE_TO_MODDLE,\n TRIGGER_TO_EVENT_DEF,\n} from \"./mapper\";\n\n// ─── Helpers ──────────────────────────────────────────────────────────────────\n\nfunction uid(prefix: string, id: string): string {\n return `${prefix}_${id}`;\n}\n\nfunction asNodes(nodes: BpmnRFNode[], types: string[]): BpmnRFNode[] {\n return nodes.filter((n) => types.includes(n.data.elementType));\n}\n\n// ─── Build BPMN semantic model ────────────────────────────────────────────────\n\nfunction buildSemanticModel(\n moddle: BpmnModdle,\n nodes: BpmnRFNode[],\n edges: BpmnRFEdge[],\n opts: BpmnExportOptions,\n): ModdleElement {\n const defId = opts.id ?? \"Definitions_1\";\n const defName = opts.name;\n\n // Collect pool nodes → Collaboration + Participants\n const poolNodes = asNodes(nodes, [\"Pool\"]);\n const laneNodes = asNodes(nodes, [\"Lane\"]);\n const isCollaboration = poolNodes.length > 0;\n\n const definitions = moddle.create(\"bpmn:Definitions\", {\n id: defId,\n targetNamespace: \"http://bpmn.io/schema/bpmn\",\n ...(defName ? { name: defName } : {}),\n });\n // Flowable namespace: bpmn-moddle serializes xmlns:* from the element's own namespace map.\n // Injected via the moddle descriptor when a full Flowable extension is loaded.\n // For now, individual elements declare their own flowable:* attributes via $attrs.\n\n const rootElements: ModdleElement[] = [];\n\n if (isCollaboration) {\n const participants: ModdleElement[] = [];\n const processes: ModdleElement[] = [];\n\n for (const pool of poolNodes) {\n const processId = `Process_${pool.id}`;\n const process = buildProcess(moddle, nodes, edges, pool.id, laneNodes, processId);\n processes.push(process);\n\n const participant = moddle.create(\"bpmn:Participant\", {\n id: pool.id,\n name: pool.data.label ?? \"\",\n processRef: process,\n });\n participants.push(participant);\n }\n\n // Message flows and conversation links belong to collaboration\n const messageFlowEdges = edges.filter((e) => e.data?.edgeType === \"messageFlow\");\n const conversationLinkEdges = edges.filter((e) => e.data?.edgeType === \"conversationLink\");\n\n const messageFlows = messageFlowEdges.map((e) =>\n moddle.create(\"bpmn:MessageFlow\", {\n id: e.id,\n name: e.data?.label ?? \"\",\n sourceRef: { id: e.source },\n targetRef: { id: e.target },\n }),\n );\n\n const conversationLinks = conversationLinkEdges.map((e) =>\n moddle.create(\"bpmn:ConversationLink\", {\n id: e.id,\n sourceRef: { id: e.source },\n targetRef: { id: e.target },\n }),\n );\n\n const collaboration = moddle.create(\"bpmn:Collaboration\", {\n id: `Collaboration_${defId}`,\n participants,\n messageFlows,\n conversationLinks,\n });\n\n rootElements.push(collaboration, ...processes);\n } else {\n // Single process — no collaboration\n const process = buildProcess(moddle, nodes, edges, undefined, laneNodes, \"Process_1\");\n rootElements.push(process);\n }\n\n (definitions as Record<string, unknown>).rootElements = rootElements;\n return definitions;\n}\n\n// Build a bpmn:Process element containing flow nodes and sequence flows\nfunction buildProcess(\n moddle: BpmnModdle,\n allNodes: BpmnRFNode[],\n allEdges: BpmnRFEdge[],\n poolId: string | undefined,\n laneNodes: BpmnRFNode[],\n processId: string,\n): ModdleElement {\n // Collect flow nodes that belong to this pool (or all if no pools)\n const subProcessIds = new Set(\n allNodes\n .filter((n) =>\n n.data.elementType === \"SubProcess\" ||\n n.data.elementType === \"Transaction\" ||\n n.data.elementType === \"EventSubProcess\" ||\n n.data.elementType === \"AdHocSubProcess\",\n )\n .map((n) => n.id),\n );\n const isInsideSubProcess = (node: BpmnRFNode) => {\n let parentId = node.parentId;\n while (parentId) {\n if (subProcessIds.has(parentId)) return true;\n parentId = allNodes.find((candidate) => candidate.id === parentId)?.parentId;\n }\n return false;\n };\n\n const myNodes = (poolId\n ? allNodes.filter(\n (n) =>\n n.parentId === poolId ||\n laneNodes.some((l) => l.id === n.parentId && l.parentId === poolId),\n )\n : allNodes.filter((n) => n.data.elementType !== \"Pool\" && n.data.elementType !== \"Lane\"))\n .filter((n) => !isInsideSubProcess(n));\n\n const myLanes = laneNodes.filter((l) => (poolId ? l.parentId === poolId : true));\n\n // Build flow elements\n const flowElements: ModdleElement[] = [];\n\n for (const node of myNodes) {\n const el = buildFlowElement(moddle, node, allNodes, allEdges);\n if (el) flowElements.push(el);\n }\n\n // Sequence flows and associations\n const myNodeIds = new Set(myNodes.map((n) => n.id));\n const myEdges = allEdges.filter(\n (e) =>\n (e.data?.edgeType === \"sequenceFlow\" ||\n e.data?.edgeType === \"association\" ||\n e.data?.edgeType === \"dataAssociation\") &&\n myNodeIds.has(e.source) &&\n myNodeIds.has(e.target),\n );\n\n for (const edge of myEdges) {\n const edgeMeta = buildEdgeElement(moddle, edge);\n if (edgeMeta) flowElements.push(edgeMeta);\n }\n\n const elementById = new Map(\n flowElements\n .filter((element) => typeof element.id === \"string\")\n .map((element) => [element.id as string, element]),\n );\n for (const edge of myEdges) {\n if (!edge.data?.isDefault) continue;\n const sourceElement = elementById.get(edge.source);\n const edgeElement = elementById.get(edge.id);\n if (sourceElement && edgeElement) {\n (sourceElement as Record<string, unknown>).default = edgeElement;\n }\n }\n\n const process = moddle.create(\"bpmn:Process\", {\n id: processId,\n isExecutable: true,\n flowElements,\n });\n\n // Lane set\n if (myLanes.length > 0) {\n const laneElements = myLanes.map((l) =>\n moddle.create(\"bpmn:Lane\", {\n id: l.id,\n name: l.data.label ?? \"\",\n flowNodeRef: myNodes\n .filter((n) => n.parentId === l.id)\n .map((n) => ({ id: n.id })),\n }),\n );\n (process as Record<string, unknown>).laneSet = moddle.create(\"bpmn:LaneSet\", {\n id: `LaneSet_${processId}`,\n lanes: laneElements,\n });\n }\n\n return process;\n}\n\nfunction buildFlowElement(\n moddle: BpmnModdle,\n node: BpmnRFNode,\n allNodes: BpmnRFNode[],\n allEdges: BpmnRFEdge[],\n): ModdleElement | null {\n const { elementType, label, trigger } = node.data;\n\n // Pools and Lanes are handled in buildProcess / collaboration\n if (elementType === \"Pool\" || elementType === \"Lane\") return null;\n\n const moddleType = ELEMENT_TYPE_TO_MODDLE[elementType];\n if (!moddleType) return null;\n\n const attrs: Record<string, unknown> = {\n id: node.id,\n name: label ?? \"\",\n };\n\n if (node.data.documentation) {\n attrs.documentation = [\n moddle.create(\"bpmn:Documentation\", { text: node.data.documentation }),\n ];\n }\n\n // Event definitions\n if (trigger && trigger !== \"none\") {\n const defType = TRIGGER_TO_EVENT_DEF[trigger];\n if (defType) {\n attrs.eventDefinitions = [moddle.create(defType, { id: uid(\"EventDef\", node.id) })];\n }\n }\n\n if (elementType === \"BoundaryEvent\") {\n attrs.attachedToRef = { id: node.data.attachedToRef ?? node.parentId };\n attrs.cancelActivity = node.data.isNonInterrupting ? false : true;\n }\n\n const isSubProcess =\n elementType === \"SubProcess\" ||\n elementType === \"Transaction\" ||\n elementType === \"EventSubProcess\" ||\n elementType === \"AdHocSubProcess\";\n\n if (isSubProcess) {\n attrs.flowElements = buildNestedFlowElements(moddle, node, allNodes, allEdges);\n if (elementType === \"EventSubProcess\" || node.data.subProcessVariant === \"event\") {\n attrs.triggeredByEvent = true;\n }\n }\n\n const element = moddle.create(moddleType, attrs);\n\n return element;\n}\n\nfunction buildNestedFlowElements(\n moddle: BpmnModdle,\n parent: BpmnRFNode,\n allNodes: BpmnRFNode[],\n allEdges: BpmnRFEdge[],\n): ModdleElement[] {\n const childNodes = allNodes.filter((node) => node.parentId === parent.id);\n const childNodeIds = new Set(childNodes.map((node) => node.id));\n const flowElements: ModdleElement[] = [];\n\n for (const child of childNodes) {\n const element = buildFlowElement(moddle, child, allNodes, allEdges);\n if (element) flowElements.push(element);\n }\n\n for (const edge of allEdges) {\n if (!childNodeIds.has(edge.source) || !childNodeIds.has(edge.target)) continue;\n const element = buildEdgeElement(moddle, edge);\n if (element) flowElements.push(element);\n }\n\n return flowElements;\n}\n\nfunction buildEdgeElement(moddle: BpmnModdle, edge: BpmnRFEdge): ModdleElement | null {\n if (!edge.data) return null;\n const moddleType = EDGE_TYPE_TO_MODDLE[edge.data.edgeType];\n if (!moddleType) return null;\n\n const attrs: Record<string, unknown> = {\n id: edge.id,\n name: edge.data.label ?? \"\",\n sourceRef: { id: edge.source },\n targetRef: { id: edge.target },\n };\n\n if (edge.data.documentation) {\n attrs.documentation = [\n moddle.create(\"bpmn:Documentation\", { text: edge.data.documentation }),\n ];\n }\n\n if (edge.data.conditionExpression) {\n attrs.conditionExpression = moddle.create(\"bpmn:FormalExpression\", {\n body: edge.data.conditionExpression,\n });\n }\n\n return moddle.create(moddleType, attrs);\n}\n\n// ─── Build BPMNDI (diagram interchange / layout) ─────────────────────────────\n\nfunction buildBpmnDI(\n moddle: BpmnModdle,\n definitions: ModdleElement,\n nodes: BpmnRFNode[],\n edges: BpmnRFEdge[],\n): void {\n const shapes: ModdleElement[] = [];\n const edgeShapes: ModdleElement[] = [];\n\n const absolutePositionById = buildAbsolutePositionMap(nodes);\n\n for (const node of nodes) {\n const meta = BPMN_ELEMENT_CATALOG[node.data.elementType];\n const w = node.width ?? meta?.defaultWidth ?? 120;\n const h = node.height ?? meta?.defaultHeight ?? 60;\n\n const bounds = moddle.create(\"dc:Bounds\", {\n x: absolutePositionById.get(node.id)?.x ?? node.position.x,\n y: absolutePositionById.get(node.id)?.y ?? node.position.y,\n width: w,\n height: h,\n });\n\n const shape = moddle.create(\"bpmndi:BPMNShape\", {\n id: uid(\"BPMNShape\", node.id),\n bpmnElement: { id: node.id },\n bounds,\n });\n\n if (node.data.isExpanded !== undefined) {\n (shape as Record<string, unknown>).isExpanded = node.data.isExpanded;\n }\n\n shapes.push(shape);\n }\n\n for (const edge of edges) {\n const waypoints =\n edge.data?.routingPoints?.map((p) =>\n moddle.create(\"dc:Point\", { x: p.x, y: p.y }),\n ) ?? [];\n\n edgeShapes.push(\n moddle.create(\"bpmndi:BPMNEdge\", {\n id: uid(\"BPMNEdge\", edge.id),\n bpmnElement: { id: edge.id },\n waypoint: waypoints,\n }),\n );\n }\n\n // Find the main process / collaboration element\n const rootEls = (definitions as Record<string, unknown>).rootElements as ModdleElement[] | undefined;\n const planeElement = rootEls?.[0];\n\n const plane = moddle.create(\"bpmndi:BPMNPlane\", {\n id: \"BPMNPlane_1\",\n bpmnElement: planeElement ?? { id: \"unknown\" },\n planeElement: [...shapes, ...edgeShapes],\n });\n\n const diagram = moddle.create(\"bpmndi:BPMNDiagram\", {\n id: \"BPMNDiagram_1\",\n plane,\n });\n\n (definitions as Record<string, unknown>).diagrams = [diagram];\n}\n\nfunction buildAbsolutePositionMap(nodes: BpmnRFNode[]): Map<string, { x: number; y: number }> {\n const nodeById = new Map(nodes.map((node) => [node.id, node]));\n const absoluteById = new Map<string, { x: number; y: number }>();\n\n function resolve(node: BpmnRFNode): { x: number; y: number } {\n const cached = absoluteById.get(node.id);\n if (cached) return cached;\n\n const parent = node.parentId ? nodeById.get(node.parentId) : undefined;\n const parentPosition = parent ? resolve(parent) : { x: 0, y: 0 };\n const absolute = {\n x: parentPosition.x + node.position.x,\n y: parentPosition.y + node.position.y,\n };\n absoluteById.set(node.id, absolute);\n return absolute;\n }\n\n for (const node of nodes) resolve(node);\n return absoluteById;\n}\n\n// ─── Public: serializeBpmnXml ─────────────────────────────────────────────────\n\nexport async function serializeBpmnXml(\n nodes: BpmnRFNode[],\n edges: BpmnRFEdge[],\n opts: BpmnExportOptions = {},\n): Promise<string> {\n const moddle = new BpmnModdle();\n\n const definitions = buildSemanticModel(moddle, nodes, edges, opts);\n buildBpmnDI(moddle, definitions, nodes, edges);\n\n const { xml } = await moddle.toXML(definitions, {\n format: opts.format ?? true,\n });\n\n return xml;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"chunk-OZKTOILD.js"}
|
|
@@ -568,11 +568,24 @@ function GatewayNode({ data, selected }) {
|
|
|
568
568
|
/* @__PURE__ */ jsx(BpmnLabel, { external: true, children: d.label })
|
|
569
569
|
] });
|
|
570
570
|
}
|
|
571
|
+
function resolveVariant(d) {
|
|
572
|
+
if (d.subProcessVariant) return d.subProcessVariant;
|
|
573
|
+
switch (d.elementType) {
|
|
574
|
+
case "Transaction":
|
|
575
|
+
return "transaction";
|
|
576
|
+
case "EventSubProcess":
|
|
577
|
+
return "event";
|
|
578
|
+
case "AdHocSubProcess":
|
|
579
|
+
return "adhoc";
|
|
580
|
+
default:
|
|
581
|
+
return "embedded";
|
|
582
|
+
}
|
|
583
|
+
}
|
|
571
584
|
function SubProcessNode({ data, selected }) {
|
|
572
585
|
const d = data;
|
|
573
586
|
const stroke = resolveStroke(selected, d.color?.stroke);
|
|
574
587
|
const sw = resolveStrokeWidth(selected);
|
|
575
|
-
const variant = d
|
|
588
|
+
const variant = resolveVariant(d);
|
|
576
589
|
const isExpanded = d.isExpanded ?? true;
|
|
577
590
|
const hasMarkers = d.markers && d.markers.length > 0;
|
|
578
591
|
const borderStyle = variant === "event" ? "dashed" : "solid";
|
|
@@ -664,6 +677,7 @@ function PoolNode({ data, selected }) {
|
|
|
664
677
|
"div",
|
|
665
678
|
{
|
|
666
679
|
"aria-label": "pool-header",
|
|
680
|
+
className: "pool-drag-handle",
|
|
667
681
|
style: {
|
|
668
682
|
height: HEADER_HEIGHT,
|
|
669
683
|
minHeight: HEADER_HEIGHT,
|
|
@@ -672,7 +686,8 @@ function PoolNode({ data, selected }) {
|
|
|
672
686
|
alignItems: "center",
|
|
673
687
|
justifyContent: "center",
|
|
674
688
|
background: headerFill,
|
|
675
|
-
padding: "0 8px"
|
|
689
|
+
padding: "0 8px",
|
|
690
|
+
cursor: "grab"
|
|
676
691
|
},
|
|
677
692
|
children: /* @__PURE__ */ jsx(
|
|
678
693
|
"span",
|
|
@@ -721,7 +736,8 @@ function PoolNode({ data, selected }) {
|
|
|
721
736
|
display: "flex",
|
|
722
737
|
alignItems: "center",
|
|
723
738
|
justifyContent: "center",
|
|
724
|
-
background: headerFill
|
|
739
|
+
background: headerFill,
|
|
740
|
+
cursor: "grab"
|
|
725
741
|
},
|
|
726
742
|
children: /* @__PURE__ */ jsx(
|
|
727
743
|
"span",
|
|
@@ -776,6 +792,7 @@ function LaneNode({ data, selected }) {
|
|
|
776
792
|
"div",
|
|
777
793
|
{
|
|
778
794
|
"aria-label": "lane-header",
|
|
795
|
+
className: "lane-drag-handle",
|
|
779
796
|
style: {
|
|
780
797
|
width: HEADER_WIDTH2,
|
|
781
798
|
minWidth: HEADER_WIDTH2,
|
|
@@ -784,7 +801,8 @@ function LaneNode({ data, selected }) {
|
|
|
784
801
|
alignItems: "center",
|
|
785
802
|
justifyContent: "center",
|
|
786
803
|
background: headerFill,
|
|
787
|
-
padding: "6px 0"
|
|
804
|
+
padding: "6px 0",
|
|
805
|
+
cursor: "grab"
|
|
788
806
|
},
|
|
789
807
|
children: /* @__PURE__ */ jsx(
|
|
790
808
|
"span",
|
|
@@ -830,6 +848,7 @@ function LaneNode({ data, selected }) {
|
|
|
830
848
|
"div",
|
|
831
849
|
{
|
|
832
850
|
"aria-label": "lane-header",
|
|
851
|
+
className: "lane-drag-handle",
|
|
833
852
|
style: {
|
|
834
853
|
height: HEADER_HEIGHT2,
|
|
835
854
|
minHeight: HEADER_HEIGHT2,
|
|
@@ -840,7 +859,8 @@ function LaneNode({ data, selected }) {
|
|
|
840
859
|
background: headerFill,
|
|
841
860
|
fontSize: BPMN_THEME.fontSize,
|
|
842
861
|
fontWeight: 500,
|
|
843
|
-
color: BPMN_THEME.labelColor
|
|
862
|
+
color: BPMN_THEME.labelColor,
|
|
863
|
+
cursor: "grab"
|
|
844
864
|
},
|
|
845
865
|
children: d.label
|
|
846
866
|
}
|
|
@@ -1414,8 +1434,11 @@ var BPMN_NODE_TYPES = {
|
|
|
1414
1434
|
ParallelGateway: GatewayNode,
|
|
1415
1435
|
EventBasedGateway: GatewayNode,
|
|
1416
1436
|
ComplexGateway: GatewayNode,
|
|
1417
|
-
// Containers
|
|
1437
|
+
// Containers — Transaction, EventSubProcess, AdHocSubProcess derive their visual variant from elementType
|
|
1418
1438
|
SubProcess: SubProcessNode,
|
|
1439
|
+
Transaction: SubProcessNode,
|
|
1440
|
+
EventSubProcess: SubProcessNode,
|
|
1441
|
+
AdHocSubProcess: SubProcessNode,
|
|
1419
1442
|
Pool: PoolNode,
|
|
1420
1443
|
Lane: LaneNode,
|
|
1421
1444
|
// Artifacts
|
|
@@ -1439,5 +1462,5 @@ var BPMN_NODE_TYPES = {
|
|
|
1439
1462
|
};
|
|
1440
1463
|
|
|
1441
1464
|
export { AnnotationNode, BPMN_NODE_TYPES, BoundaryEventNode, CallChoreographyNode, CallConversationNode, ChoreographyTaskNode, ConversationNode, DataInputNode, DataObjectNode, DataObjectReferenceNode, DataOutputNode, DataStoreNode, DataStoreReferenceNode, EndEventNode, GatewayNode, GroupNode, IntermediateCatchEventNode, IntermediateThrowEventNode, LaneNode, PoolNode, StartEventNode, SubChoreographyNode, SubConversationNode, SubProcessNode, TaskNode };
|
|
1442
|
-
//# sourceMappingURL=chunk-
|
|
1443
|
-
//# sourceMappingURL=chunk-
|
|
1465
|
+
//# sourceMappingURL=chunk-S3GGEEA5.js.map
|
|
1466
|
+
//# sourceMappingURL=chunk-S3GGEEA5.js.map
|