bpmn-js 16.3.0 → 16.3.2
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/dist/bpmn-modeler.development.js +28 -22
- package/dist/bpmn-modeler.production.min.js +2 -2
- package/dist/bpmn-navigated-viewer.development.js +2 -2
- package/dist/bpmn-navigated-viewer.production.min.js +1 -1
- package/dist/bpmn-viewer.development.js +2 -2
- package/dist/bpmn-viewer.production.min.js +1 -1
- package/lib/features/modeling/behavior/CompensateBoundaryEventBehavior.d.ts +5 -0
- package/lib/features/modeling/behavior/CompensateBoundaryEventBehavior.js +26 -20
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* bpmn-js - bpmn-modeler v16.3.
|
|
2
|
+
* bpmn-js - bpmn-modeler v16.3.2
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) 2014-present, camunda Services GmbH
|
|
5
5
|
*
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* Source Code: https://github.com/bpmn-io/bpmn-js
|
|
10
10
|
*
|
|
11
|
-
* Date:
|
|
11
|
+
* Date: 2024-01-09
|
|
12
12
|
*/
|
|
13
13
|
(function (global, factory) {
|
|
14
14
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
@@ -37320,7 +37320,8 @@
|
|
|
37320
37320
|
*/
|
|
37321
37321
|
|
|
37322
37322
|
/**
|
|
37323
|
-
*
|
|
37323
|
+
* Behavior ensuring that only a single compensation activity is connected to a
|
|
37324
|
+
* compensation boundary event when connecting, reconnecting or replacing shapes.
|
|
37324
37325
|
*
|
|
37325
37326
|
* @param {import('diagram-js/lib/core/EventBus').default} eventBus
|
|
37326
37327
|
* @param {import('../Modeling').default} modeling
|
|
@@ -37338,7 +37339,7 @@
|
|
|
37338
37339
|
this.postExecuted('element.updateProperties', handlePropertiesUpdate, true);
|
|
37339
37340
|
|
|
37340
37341
|
/**
|
|
37341
|
-
* Given a connection from boundary event is removed, remove the
|
|
37342
|
+
* Given a connection from boundary event is removed, remove the `isForCompensation` property.
|
|
37342
37343
|
*/
|
|
37343
37344
|
function handleConnectionRemoval(context) {
|
|
37344
37345
|
const source = context.source,
|
|
@@ -37350,15 +37351,16 @@
|
|
|
37350
37351
|
}
|
|
37351
37352
|
|
|
37352
37353
|
/**
|
|
37353
|
-
* Add
|
|
37354
|
+
* Add `isForCompensation` property and make sure only a single compensation activity is connected.
|
|
37354
37355
|
*/
|
|
37355
37356
|
function handleNewConnection(context) {
|
|
37356
|
-
const
|
|
37357
|
+
const connection = context.connection,
|
|
37358
|
+
source = context.source,
|
|
37357
37359
|
target = context.target;
|
|
37358
37360
|
|
|
37359
|
-
if (isCompensationBoundaryEvent(source) &&
|
|
37361
|
+
if (isCompensationBoundaryEvent(source) && isForCompensationAllowed(target)) {
|
|
37360
37362
|
addIsForCompensationProperty(target);
|
|
37361
|
-
|
|
37363
|
+
removeExistingAssociations(source, [ connection ]);
|
|
37362
37364
|
}
|
|
37363
37365
|
}
|
|
37364
37366
|
|
|
@@ -37377,7 +37379,7 @@
|
|
|
37377
37379
|
}
|
|
37378
37380
|
|
|
37379
37381
|
// newTarget perspective
|
|
37380
|
-
if (isCompensationBoundaryEvent(source) &&
|
|
37382
|
+
if (isCompensationBoundaryEvent(source) && isForCompensationAllowed(newTarget)) {
|
|
37381
37383
|
addIsForCompensationProperty(newTarget);
|
|
37382
37384
|
}
|
|
37383
37385
|
}
|
|
@@ -37387,9 +37389,9 @@
|
|
|
37387
37389
|
const { element } = context;
|
|
37388
37390
|
|
|
37389
37391
|
if (isForCompensation$1(element)) {
|
|
37390
|
-
|
|
37392
|
+
removeDisallowedConnections(element);
|
|
37391
37393
|
removeAttachments(element);
|
|
37392
|
-
} else if (
|
|
37394
|
+
} else if (isForCompensationAllowed(element)) {
|
|
37393
37395
|
removeIncomingCompensationAssociations(element);
|
|
37394
37396
|
}
|
|
37395
37397
|
}
|
|
@@ -37399,13 +37401,15 @@
|
|
|
37399
37401
|
* and remove the potential candidates for connection replacement to have a single compensation activity.
|
|
37400
37402
|
*/
|
|
37401
37403
|
function handleReplacement(context) {
|
|
37402
|
-
const {
|
|
37403
|
-
|
|
37404
|
+
const {
|
|
37405
|
+
newData,
|
|
37406
|
+
oldShape
|
|
37407
|
+
} = context;
|
|
37404
37408
|
|
|
37405
37409
|
// from compensate boundary event
|
|
37406
37410
|
if (isCompensationBoundaryEvent(context.oldShape) &&
|
|
37407
|
-
|
|
37408
|
-
|
|
37411
|
+
newData.eventDefinitionType !== 'bpmn:CompensateEventDefinition' ||
|
|
37412
|
+
newData.type !== 'bpmn:BoundaryEvent'
|
|
37409
37413
|
) {
|
|
37410
37414
|
const targetConnection = oldShape.outgoing.find(
|
|
37411
37415
|
({ target }) => isForCompensation$1(target)
|
|
@@ -37419,11 +37423,11 @@
|
|
|
37419
37423
|
// to compensate boundary event
|
|
37420
37424
|
else if (
|
|
37421
37425
|
!isCompensationBoundaryEvent(context.oldShape) &&
|
|
37422
|
-
|
|
37423
|
-
|
|
37426
|
+
newData.eventDefinitionType === 'bpmn:CompensateEventDefinition' &&
|
|
37427
|
+
newData.type === 'bpmn:BoundaryEvent'
|
|
37424
37428
|
) {
|
|
37425
37429
|
const targetConnection = oldShape.outgoing.find(
|
|
37426
|
-
({ target }) =>
|
|
37430
|
+
({ target }) => isForCompensationAllowed(target)
|
|
37427
37431
|
);
|
|
37428
37432
|
|
|
37429
37433
|
if (targetConnection && targetConnection.target) {
|
|
@@ -37450,7 +37454,7 @@
|
|
|
37450
37454
|
modeling.updateProperties(target, { isForCompensation: undefined });
|
|
37451
37455
|
}
|
|
37452
37456
|
|
|
37453
|
-
function
|
|
37457
|
+
function removeDisallowedConnections(element) {
|
|
37454
37458
|
|
|
37455
37459
|
for (const connection of element.incoming) {
|
|
37456
37460
|
if (!bpmnRules.canConnect(connection.source, element)) {
|
|
@@ -37465,9 +37469,11 @@
|
|
|
37465
37469
|
}
|
|
37466
37470
|
}
|
|
37467
37471
|
|
|
37468
|
-
function
|
|
37472
|
+
function removeExistingAssociations(boundaryEvent, ignoredAssociations) {
|
|
37469
37473
|
const associations = boundaryEvent.outgoing.filter(connection => is$1(connection, 'bpmn:Association'));
|
|
37470
|
-
const associationsToRemove = associations.filter(association =>
|
|
37474
|
+
const associationsToRemove = associations.filter(association => {
|
|
37475
|
+
return isForCompensation$1(association.target) && !ignoredAssociations.includes(association);
|
|
37476
|
+
});
|
|
37471
37477
|
|
|
37472
37478
|
// remove existing associations
|
|
37473
37479
|
associationsToRemove.forEach(association => modeling.removeConnection(association));
|
|
@@ -37520,7 +37526,7 @@
|
|
|
37520
37526
|
hasEventDefinition$2(element, 'bpmn:CompensateEventDefinition');
|
|
37521
37527
|
}
|
|
37522
37528
|
|
|
37523
|
-
function
|
|
37529
|
+
function isForCompensationAllowed(element) {
|
|
37524
37530
|
return element && is$1(element, 'bpmn:Activity') && !isEventSubProcess(element);
|
|
37525
37531
|
}
|
|
37526
37532
|
|