bpmn-js 16.1.0 → 16.3.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/dist/bpmn-modeler.development.js +394 -31
- package/dist/bpmn-modeler.production.min.js +34 -34
- package/dist/bpmn-navigated-viewer.development.js +151 -15
- package/dist/bpmn-navigated-viewer.production.min.js +5 -5
- package/dist/bpmn-viewer.development.js +151 -15
- package/dist/bpmn-viewer.production.min.js +5 -5
- package/lib/features/modeling/behavior/CompensateBoundaryEventBehavior.d.ts +12 -0
- package/lib/features/modeling/behavior/CompensateBoundaryEventBehavior.js +216 -0
- package/lib/features/modeling/behavior/ReplaceConnectionBehavior.js +5 -7
- package/lib/features/modeling/behavior/index.js +3 -0
- package/lib/features/replace/BpmnReplace.js +4 -0
- package/lib/features/rules/BpmnRules.d.ts +10 -1
- package/lib/features/rules/BpmnRules.js +26 -9
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* bpmn-js - bpmn-modeler v16.
|
|
2
|
+
* bpmn-js - bpmn-modeler v16.3.0
|
|
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: 2023-12-
|
|
11
|
+
* Date: 2023-12-22
|
|
12
12
|
*/
|
|
13
13
|
(function (global, factory) {
|
|
14
14
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
@@ -832,6 +832,58 @@
|
|
|
832
832
|
return Object.assign(target, ...others);
|
|
833
833
|
}
|
|
834
834
|
|
|
835
|
+
/**
|
|
836
|
+
* Sets a nested property of a given object to the specified value.
|
|
837
|
+
*
|
|
838
|
+
* This mutates the object and returns it.
|
|
839
|
+
*
|
|
840
|
+
* @template T
|
|
841
|
+
*
|
|
842
|
+
* @param {T} target The target of the set operation.
|
|
843
|
+
* @param {(string|number)[]} path The path to the nested value.
|
|
844
|
+
* @param {any} value The value to set.
|
|
845
|
+
*
|
|
846
|
+
* @return {T}
|
|
847
|
+
*/
|
|
848
|
+
function set$2(target, path, value) {
|
|
849
|
+
|
|
850
|
+
let currentTarget = target;
|
|
851
|
+
|
|
852
|
+
forEach$1(path, function(key, idx) {
|
|
853
|
+
|
|
854
|
+
if (typeof key !== 'number' && typeof key !== 'string') {
|
|
855
|
+
throw new Error('illegal key type: ' + typeof key + '. Key should be of type number or string.');
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
if (key === 'constructor') {
|
|
859
|
+
throw new Error('illegal key: constructor');
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
if (key === '__proto__') {
|
|
863
|
+
throw new Error('illegal key: __proto__');
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
let nextKey = path[idx + 1];
|
|
867
|
+
let nextTarget = currentTarget[key];
|
|
868
|
+
|
|
869
|
+
if (isDefined(nextKey) && isNil(nextTarget)) {
|
|
870
|
+
nextTarget = currentTarget[key] = isNaN(+nextKey) ? {} : [];
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
if (isUndefined$2(nextKey)) {
|
|
874
|
+
if (isUndefined$2(value)) {
|
|
875
|
+
delete currentTarget[key];
|
|
876
|
+
} else {
|
|
877
|
+
currentTarget[key] = value;
|
|
878
|
+
}
|
|
879
|
+
} else {
|
|
880
|
+
currentTarget = nextTarget;
|
|
881
|
+
}
|
|
882
|
+
});
|
|
883
|
+
|
|
884
|
+
return target;
|
|
885
|
+
}
|
|
886
|
+
|
|
835
887
|
/**
|
|
836
888
|
* Pick properties from the given target.
|
|
837
889
|
*
|
|
@@ -8770,6 +8822,17 @@
|
|
|
8770
8822
|
this.idProperty = p;
|
|
8771
8823
|
};
|
|
8772
8824
|
|
|
8825
|
+
DescriptorBuilder.prototype.assertNotTrait = function(typeDescriptor) {
|
|
8826
|
+
|
|
8827
|
+
const _extends = typeDescriptor.extends || [];
|
|
8828
|
+
|
|
8829
|
+
if (_extends.length) {
|
|
8830
|
+
throw new Error(
|
|
8831
|
+
`cannot create <${ typeDescriptor.name }> extending <${ typeDescriptor.extends }>`
|
|
8832
|
+
);
|
|
8833
|
+
}
|
|
8834
|
+
};
|
|
8835
|
+
|
|
8773
8836
|
DescriptorBuilder.prototype.assertNotDefined = function(p, name) {
|
|
8774
8837
|
var propertyName = p.name,
|
|
8775
8838
|
definedProperty = this.propertiesByName[propertyName];
|
|
@@ -8788,6 +8851,10 @@
|
|
|
8788
8851
|
|
|
8789
8852
|
DescriptorBuilder.prototype.addTrait = function(t, inherited) {
|
|
8790
8853
|
|
|
8854
|
+
if (inherited) {
|
|
8855
|
+
this.assertNotTrait(t);
|
|
8856
|
+
}
|
|
8857
|
+
|
|
8791
8858
|
var typesByName = this.allTypesByName,
|
|
8792
8859
|
types = this.allTypes;
|
|
8793
8860
|
|
|
@@ -8921,7 +8988,9 @@
|
|
|
8921
8988
|
});
|
|
8922
8989
|
|
|
8923
8990
|
forEach$1(type.extends, bind$2(function(extendsName) {
|
|
8924
|
-
var
|
|
8991
|
+
var extendsNameNs = parseName(extendsName, ns.prefix);
|
|
8992
|
+
|
|
8993
|
+
var extended = this.typeMap[extendsNameNs.name];
|
|
8925
8994
|
|
|
8926
8995
|
extended.traits = extended.traits || [];
|
|
8927
8996
|
extended.traits.push(name);
|
|
@@ -8950,24 +9019,33 @@
|
|
|
8950
9019
|
|
|
8951
9020
|
var self = this;
|
|
8952
9021
|
|
|
9022
|
+
/**
|
|
9023
|
+
* Traverse the selected super type or trait
|
|
9024
|
+
*
|
|
9025
|
+
* @param {String} cls
|
|
9026
|
+
* @param {Boolean} [trait=false]
|
|
9027
|
+
*/
|
|
9028
|
+
function traverse(cls, trait) {
|
|
9029
|
+
var parentNs = parseName(cls, isBuiltIn(cls) ? '' : nsName.prefix);
|
|
9030
|
+
self.mapTypes(parentNs, iterator, trait);
|
|
9031
|
+
}
|
|
9032
|
+
|
|
8953
9033
|
/**
|
|
8954
9034
|
* Traverse the selected trait.
|
|
8955
9035
|
*
|
|
8956
9036
|
* @param {String} cls
|
|
8957
9037
|
*/
|
|
8958
9038
|
function traverseTrait(cls) {
|
|
8959
|
-
return
|
|
9039
|
+
return traverse(cls, true);
|
|
8960
9040
|
}
|
|
8961
9041
|
|
|
8962
9042
|
/**
|
|
8963
|
-
* Traverse the selected super type
|
|
9043
|
+
* Traverse the selected super type
|
|
8964
9044
|
*
|
|
8965
9045
|
* @param {String} cls
|
|
8966
|
-
* @param {Boolean} [trait=false]
|
|
8967
9046
|
*/
|
|
8968
|
-
function traverseSuper(cls
|
|
8969
|
-
|
|
8970
|
-
self.mapTypes(parentNs, iterator, trait);
|
|
9047
|
+
function traverseSuper(cls) {
|
|
9048
|
+
return traverse(cls, false);
|
|
8971
9049
|
}
|
|
8972
9050
|
|
|
8973
9051
|
if (!type) {
|
|
@@ -9050,7 +9128,7 @@
|
|
|
9050
9128
|
throw new TypeError('property name must be a non-empty string');
|
|
9051
9129
|
}
|
|
9052
9130
|
|
|
9053
|
-
var property = this.
|
|
9131
|
+
var property = this.getProperty(target, name);
|
|
9054
9132
|
|
|
9055
9133
|
var propertyName = property && property.name;
|
|
9056
9134
|
|
|
@@ -9061,7 +9139,7 @@
|
|
|
9061
9139
|
if (property) {
|
|
9062
9140
|
delete target[propertyName];
|
|
9063
9141
|
} else {
|
|
9064
|
-
delete target.$attrs[name];
|
|
9142
|
+
delete target.$attrs[stripGlobal(name)];
|
|
9065
9143
|
}
|
|
9066
9144
|
} else {
|
|
9067
9145
|
|
|
@@ -9074,7 +9152,7 @@
|
|
|
9074
9152
|
defineProperty(target, property, value);
|
|
9075
9153
|
}
|
|
9076
9154
|
} else {
|
|
9077
|
-
target.$attrs[name] = value;
|
|
9155
|
+
target.$attrs[stripGlobal(name)] = value;
|
|
9078
9156
|
}
|
|
9079
9157
|
}
|
|
9080
9158
|
};
|
|
@@ -9089,10 +9167,10 @@
|
|
|
9089
9167
|
*/
|
|
9090
9168
|
Properties.prototype.get = function(target, name) {
|
|
9091
9169
|
|
|
9092
|
-
var property = this.
|
|
9170
|
+
var property = this.getProperty(target, name);
|
|
9093
9171
|
|
|
9094
9172
|
if (!property) {
|
|
9095
|
-
return target.$attrs[name];
|
|
9173
|
+
return target.$attrs[stripGlobal(name)];
|
|
9096
9174
|
}
|
|
9097
9175
|
|
|
9098
9176
|
var propertyName = property.name;
|
|
@@ -9146,6 +9224,44 @@
|
|
|
9146
9224
|
this.define(target, '$model', { value: model });
|
|
9147
9225
|
};
|
|
9148
9226
|
|
|
9227
|
+
/**
|
|
9228
|
+
* Return property with the given name on the element.
|
|
9229
|
+
*
|
|
9230
|
+
* @param {any} target
|
|
9231
|
+
* @param {string} name
|
|
9232
|
+
*
|
|
9233
|
+
* @return {object | null} property
|
|
9234
|
+
*/
|
|
9235
|
+
Properties.prototype.getProperty = function(target, name) {
|
|
9236
|
+
|
|
9237
|
+
var model = this.model;
|
|
9238
|
+
|
|
9239
|
+
var property = model.getPropertyDescriptor(target, name);
|
|
9240
|
+
|
|
9241
|
+
if (property) {
|
|
9242
|
+
return property;
|
|
9243
|
+
}
|
|
9244
|
+
|
|
9245
|
+
if (name.includes(':')) {
|
|
9246
|
+
return null;
|
|
9247
|
+
}
|
|
9248
|
+
|
|
9249
|
+
const strict = model.config.strict;
|
|
9250
|
+
|
|
9251
|
+
if (typeof strict !== 'undefined') {
|
|
9252
|
+
const error = new TypeError(`unknown property <${ name }> on <${ target.$type }>`);
|
|
9253
|
+
|
|
9254
|
+
if (strict) {
|
|
9255
|
+
throw error;
|
|
9256
|
+
} else {
|
|
9257
|
+
|
|
9258
|
+
// eslint-disable-next-line no-undef
|
|
9259
|
+
typeof console !== 'undefined' && console.warn(error);
|
|
9260
|
+
}
|
|
9261
|
+
}
|
|
9262
|
+
|
|
9263
|
+
return null;
|
|
9264
|
+
};
|
|
9149
9265
|
|
|
9150
9266
|
function isUndefined(val) {
|
|
9151
9267
|
return typeof val === 'undefined';
|
|
@@ -9160,6 +9276,10 @@
|
|
|
9160
9276
|
});
|
|
9161
9277
|
}
|
|
9162
9278
|
|
|
9279
|
+
function stripGlobal(name) {
|
|
9280
|
+
return name.replace(/^:/, '');
|
|
9281
|
+
}
|
|
9282
|
+
|
|
9163
9283
|
// Moddle implementation /////////////////////////////////////////////////
|
|
9164
9284
|
|
|
9165
9285
|
/**
|
|
@@ -9182,8 +9302,10 @@
|
|
|
9182
9302
|
* var moddle = new Moddle([pkg]);
|
|
9183
9303
|
*
|
|
9184
9304
|
* @param {Array<Package>} packages the packages to contain
|
|
9305
|
+
*
|
|
9306
|
+
* @param { { strict?: boolean } } [config] moddle configuration
|
|
9185
9307
|
*/
|
|
9186
|
-
function Moddle(packages) {
|
|
9308
|
+
function Moddle(packages, config = {}) {
|
|
9187
9309
|
|
|
9188
9310
|
this.properties = new Properties(this);
|
|
9189
9311
|
|
|
@@ -9191,6 +9313,8 @@
|
|
|
9191
9313
|
this.registry = new Registry(packages, this.properties);
|
|
9192
9314
|
|
|
9193
9315
|
this.typeCache = {};
|
|
9316
|
+
|
|
9317
|
+
this.config = config;
|
|
9194
9318
|
}
|
|
9195
9319
|
|
|
9196
9320
|
|
|
@@ -9284,6 +9408,12 @@
|
|
|
9284
9408
|
$type: name,
|
|
9285
9409
|
$instanceOf: function(type) {
|
|
9286
9410
|
return type === this.$type;
|
|
9411
|
+
},
|
|
9412
|
+
get: function(key) {
|
|
9413
|
+
return this[key];
|
|
9414
|
+
},
|
|
9415
|
+
set: function(key, value) {
|
|
9416
|
+
set$2(this, [ key ], value);
|
|
9287
9417
|
}
|
|
9288
9418
|
};
|
|
9289
9419
|
|
|
@@ -9299,6 +9429,8 @@
|
|
|
9299
9429
|
|
|
9300
9430
|
this.properties.defineDescriptor(element, descriptor);
|
|
9301
9431
|
this.properties.defineModel(element, this);
|
|
9432
|
+
this.properties.define(element, 'get', { enumerable: false, writable: true });
|
|
9433
|
+
this.properties.define(element, 'set', { enumerable: false, writable: true });
|
|
9302
9434
|
this.properties.define(element, '$parent', { enumerable: false, writable: true });
|
|
9303
9435
|
this.properties.define(element, '$instanceOf', { enumerable: false, writable: true });
|
|
9304
9436
|
|
|
@@ -37182,6 +37314,216 @@
|
|
|
37182
37314
|
|
|
37183
37315
|
e$2(BoundaryEventBehavior, CommandInterceptor);
|
|
37184
37316
|
|
|
37317
|
+
/**
|
|
37318
|
+
* @typedef {import('diagram-js/lib/core/EventBus').default} EventBus
|
|
37319
|
+
* @typedef {import('../lib/features/modeling/Modeling').default} Modeling
|
|
37320
|
+
*/
|
|
37321
|
+
|
|
37322
|
+
/**
|
|
37323
|
+
*
|
|
37324
|
+
*
|
|
37325
|
+
* @param {import('diagram-js/lib/core/EventBus').default} eventBus
|
|
37326
|
+
* @param {import('../Modeling').default} modeling
|
|
37327
|
+
* @param {import('../../rules/BpmnRules').default} bpmnRules
|
|
37328
|
+
*/
|
|
37329
|
+
function CompensateBoundaryEventBehavior(eventBus, modeling, bpmnRules) {
|
|
37330
|
+
|
|
37331
|
+
CommandInterceptor.call(this, eventBus);
|
|
37332
|
+
|
|
37333
|
+
this.preExecute('shape.replace', handleReplacement, true);
|
|
37334
|
+
this.postExecuted('shape.replace', handleReplacementPostExecuted, true);
|
|
37335
|
+
this.preExecute('connection.create', handleNewConnection, true);
|
|
37336
|
+
this.postExecuted('connection.delete', handleConnectionRemoval, true);
|
|
37337
|
+
this.postExecuted('connection.reconnect', handleReconnection, true);
|
|
37338
|
+
this.postExecuted('element.updateProperties', handlePropertiesUpdate, true);
|
|
37339
|
+
|
|
37340
|
+
/**
|
|
37341
|
+
* Given a connection from boundary event is removed, remove the forCompensation property.
|
|
37342
|
+
*/
|
|
37343
|
+
function handleConnectionRemoval(context) {
|
|
37344
|
+
const source = context.source,
|
|
37345
|
+
target = context.target;
|
|
37346
|
+
|
|
37347
|
+
if (isCompensationBoundaryEvent(source) && isForCompensation$1(target)) {
|
|
37348
|
+
removeIsForCompensationProperty(target);
|
|
37349
|
+
}
|
|
37350
|
+
}
|
|
37351
|
+
|
|
37352
|
+
/**
|
|
37353
|
+
* Add forCompensation property and make sure only a single compensation activity is connected.
|
|
37354
|
+
*/
|
|
37355
|
+
function handleNewConnection(context) {
|
|
37356
|
+
const source = context.source,
|
|
37357
|
+
target = context.target;
|
|
37358
|
+
|
|
37359
|
+
if (isCompensationBoundaryEvent(source) && canBeForCompensation(target)) {
|
|
37360
|
+
addIsForCompensationProperty(target);
|
|
37361
|
+
removeExistingAssociation(source);
|
|
37362
|
+
}
|
|
37363
|
+
}
|
|
37364
|
+
|
|
37365
|
+
function handleReconnection(context) {
|
|
37366
|
+
const newTarget = context.newTarget,
|
|
37367
|
+
oldSource = context.oldSource,
|
|
37368
|
+
oldTarget = context.oldTarget;
|
|
37369
|
+
|
|
37370
|
+
// target changes
|
|
37371
|
+
if (oldTarget !== newTarget) {
|
|
37372
|
+
const source = oldSource;
|
|
37373
|
+
|
|
37374
|
+
// oldTarget perspective
|
|
37375
|
+
if (isForCompensation$1(oldTarget)) {
|
|
37376
|
+
removeIsForCompensationProperty(oldTarget);
|
|
37377
|
+
}
|
|
37378
|
+
|
|
37379
|
+
// newTarget perspective
|
|
37380
|
+
if (isCompensationBoundaryEvent(source) && canBeForCompensation(newTarget)) {
|
|
37381
|
+
addIsForCompensationProperty(newTarget);
|
|
37382
|
+
}
|
|
37383
|
+
}
|
|
37384
|
+
}
|
|
37385
|
+
|
|
37386
|
+
function handlePropertiesUpdate(context) {
|
|
37387
|
+
const { element } = context;
|
|
37388
|
+
|
|
37389
|
+
if (isForCompensation$1(element)) {
|
|
37390
|
+
removeIllegalConnections(element);
|
|
37391
|
+
removeAttachments(element);
|
|
37392
|
+
} else if (canBeForCompensation(element)) {
|
|
37393
|
+
removeIncomingCompensationAssociations(element);
|
|
37394
|
+
}
|
|
37395
|
+
}
|
|
37396
|
+
|
|
37397
|
+
/**
|
|
37398
|
+
* When replacing a boundary event, make sure the compensation activity is connected,
|
|
37399
|
+
* and remove the potential candidates for connection replacement to have a single compensation activity.
|
|
37400
|
+
*/
|
|
37401
|
+
function handleReplacement(context) {
|
|
37402
|
+
const { targetElement } = context.hints || {},
|
|
37403
|
+
{ oldShape } = context;
|
|
37404
|
+
|
|
37405
|
+
// from compensate boundary event
|
|
37406
|
+
if (isCompensationBoundaryEvent(context.oldShape) &&
|
|
37407
|
+
targetElement.eventDefinitionType !== 'bpmn:CompensateEventDefinition' ||
|
|
37408
|
+
targetElement.type !== 'bpmn:BoundaryEvent'
|
|
37409
|
+
) {
|
|
37410
|
+
const targetConnection = oldShape.outgoing.find(
|
|
37411
|
+
({ target }) => isForCompensation$1(target)
|
|
37412
|
+
);
|
|
37413
|
+
|
|
37414
|
+
if (targetConnection && targetConnection.target) {
|
|
37415
|
+
context._connectionTarget = targetConnection.target;
|
|
37416
|
+
}
|
|
37417
|
+
}
|
|
37418
|
+
|
|
37419
|
+
// to compensate boundary event
|
|
37420
|
+
else if (
|
|
37421
|
+
!isCompensationBoundaryEvent(context.oldShape) &&
|
|
37422
|
+
targetElement.eventDefinitionType === 'bpmn:CompensateEventDefinition' &&
|
|
37423
|
+
targetElement.type === 'bpmn:BoundaryEvent'
|
|
37424
|
+
) {
|
|
37425
|
+
const targetConnection = oldShape.outgoing.find(
|
|
37426
|
+
({ target }) => canBeForCompensation(target)
|
|
37427
|
+
);
|
|
37428
|
+
|
|
37429
|
+
if (targetConnection && targetConnection.target) {
|
|
37430
|
+
context._connectionTarget = targetConnection.target;
|
|
37431
|
+
}
|
|
37432
|
+
|
|
37433
|
+
removeOutgoingSequenceFlows(oldShape);
|
|
37434
|
+
}
|
|
37435
|
+
}
|
|
37436
|
+
|
|
37437
|
+
function handleReplacementPostExecuted(context) {
|
|
37438
|
+
const { _connectionTarget: target, newShape } = context;
|
|
37439
|
+
|
|
37440
|
+
if (target) {
|
|
37441
|
+
modeling.connect(newShape, target);
|
|
37442
|
+
}
|
|
37443
|
+
}
|
|
37444
|
+
|
|
37445
|
+
function addIsForCompensationProperty(target) {
|
|
37446
|
+
modeling.updateProperties(target, { isForCompensation: true });
|
|
37447
|
+
}
|
|
37448
|
+
|
|
37449
|
+
function removeIsForCompensationProperty(target) {
|
|
37450
|
+
modeling.updateProperties(target, { isForCompensation: undefined });
|
|
37451
|
+
}
|
|
37452
|
+
|
|
37453
|
+
function removeIllegalConnections(element) {
|
|
37454
|
+
|
|
37455
|
+
for (const connection of element.incoming) {
|
|
37456
|
+
if (!bpmnRules.canConnect(connection.source, element)) {
|
|
37457
|
+
modeling.removeConnection(connection);
|
|
37458
|
+
}
|
|
37459
|
+
}
|
|
37460
|
+
|
|
37461
|
+
for (const connection of element.outgoing) {
|
|
37462
|
+
if (!bpmnRules.canConnect(element, connection.target)) {
|
|
37463
|
+
modeling.removeConnection(connection);
|
|
37464
|
+
}
|
|
37465
|
+
}
|
|
37466
|
+
}
|
|
37467
|
+
|
|
37468
|
+
function removeExistingAssociation(boundaryEvent) {
|
|
37469
|
+
const associations = boundaryEvent.outgoing.filter(connection => is$1(connection, 'bpmn:Association'));
|
|
37470
|
+
const associationsToRemove = associations.filter(association => isForCompensation$1(association.target));
|
|
37471
|
+
|
|
37472
|
+
// remove existing associations
|
|
37473
|
+
associationsToRemove.forEach(association => modeling.removeConnection(association));
|
|
37474
|
+
}
|
|
37475
|
+
|
|
37476
|
+
function removeAttachments(element) {
|
|
37477
|
+
const attachments = element.attachers.slice();
|
|
37478
|
+
|
|
37479
|
+
if (!attachments.length) {
|
|
37480
|
+
return;
|
|
37481
|
+
}
|
|
37482
|
+
|
|
37483
|
+
modeling.removeElements(attachments);
|
|
37484
|
+
}
|
|
37485
|
+
|
|
37486
|
+
function removeIncomingCompensationAssociations(element) {
|
|
37487
|
+
const compensationAssociations = element.incoming.filter(
|
|
37488
|
+
connection => isCompensationBoundaryEvent(connection.source)
|
|
37489
|
+
);
|
|
37490
|
+
|
|
37491
|
+
modeling.removeElements(compensationAssociations);
|
|
37492
|
+
}
|
|
37493
|
+
|
|
37494
|
+
function removeOutgoingSequenceFlows(element) {
|
|
37495
|
+
const sequenceFlows = element.outgoing.filter(
|
|
37496
|
+
connection => is$1(connection, 'bpmn:SequenceFlow')
|
|
37497
|
+
);
|
|
37498
|
+
|
|
37499
|
+
modeling.removeElements(sequenceFlows);
|
|
37500
|
+
}
|
|
37501
|
+
}
|
|
37502
|
+
|
|
37503
|
+
e$2(CompensateBoundaryEventBehavior, CommandInterceptor);
|
|
37504
|
+
|
|
37505
|
+
CompensateBoundaryEventBehavior.$inject = [
|
|
37506
|
+
'eventBus',
|
|
37507
|
+
'modeling',
|
|
37508
|
+
'bpmnRules'
|
|
37509
|
+
];
|
|
37510
|
+
|
|
37511
|
+
// helpers //////////
|
|
37512
|
+
|
|
37513
|
+
function isForCompensation$1(element) {
|
|
37514
|
+
const bo = getBusinessObject(element);
|
|
37515
|
+
return bo && bo.get('isForCompensation');
|
|
37516
|
+
}
|
|
37517
|
+
|
|
37518
|
+
function isCompensationBoundaryEvent(element) {
|
|
37519
|
+
return element && is$1(element, 'bpmn:BoundaryEvent') &&
|
|
37520
|
+
hasEventDefinition$2(element, 'bpmn:CompensateEventDefinition');
|
|
37521
|
+
}
|
|
37522
|
+
|
|
37523
|
+
function canBeForCompensation(element) {
|
|
37524
|
+
return element && is$1(element, 'bpmn:Activity') && !isEventSubProcess(element);
|
|
37525
|
+
}
|
|
37526
|
+
|
|
37185
37527
|
/**
|
|
37186
37528
|
* @typedef {import('didi').Injector} Injector
|
|
37187
37529
|
*/
|
|
@@ -41048,11 +41390,6 @@
|
|
|
41048
41390
|
}
|
|
41049
41391
|
}
|
|
41050
41392
|
|
|
41051
|
-
if (is$1(connection, 'bpmn:Association') && !bpmnRules.canConnectAssociation(source, target)) {
|
|
41052
|
-
remove = true;
|
|
41053
|
-
}
|
|
41054
|
-
|
|
41055
|
-
|
|
41056
41393
|
// remove invalid connection,
|
|
41057
41394
|
// unless it has been removed already
|
|
41058
41395
|
if (remove) {
|
|
@@ -41086,11 +41423,14 @@
|
|
|
41086
41423
|
|
|
41087
41424
|
replacement = modeling.connect(source, target, {
|
|
41088
41425
|
type: allowed.type,
|
|
41426
|
+
associationDirection: allowed.associationDirection,
|
|
41089
41427
|
waypoints: connection.waypoints.slice()
|
|
41090
41428
|
});
|
|
41091
41429
|
|
|
41092
|
-
// remove old connection
|
|
41093
|
-
|
|
41430
|
+
// remove old connection unless it's already removed
|
|
41431
|
+
if (connection.parent) {
|
|
41432
|
+
modeling.removeConnection(connection);
|
|
41433
|
+
}
|
|
41094
41434
|
|
|
41095
41435
|
// replace connection in context to reconnect end/start
|
|
41096
41436
|
context.connection = replacement;
|
|
@@ -42982,6 +43322,7 @@
|
|
|
42982
43322
|
'associationBehavior',
|
|
42983
43323
|
'attachEventBehavior',
|
|
42984
43324
|
'boundaryEventBehavior',
|
|
43325
|
+
'compensateBoundaryEventBehaviour',
|
|
42985
43326
|
'createBehavior',
|
|
42986
43327
|
'createDataObjectBehavior',
|
|
42987
43328
|
'createParticipantBehavior',
|
|
@@ -43021,6 +43362,7 @@
|
|
|
43021
43362
|
associationBehavior: [ 'type', AssociationBehavior ],
|
|
43022
43363
|
attachEventBehavior: [ 'type', AttachEventBehavior ],
|
|
43023
43364
|
boundaryEventBehavior: [ 'type', BoundaryEventBehavior ],
|
|
43365
|
+
compensateBoundaryEventBehaviour: [ 'type', CompensateBoundaryEventBehavior ],
|
|
43024
43366
|
createBehavior: [ 'type', CreateBehavior ],
|
|
43025
43367
|
createDataObjectBehavior: [ 'type', CreateDataObjectBehavior ],
|
|
43026
43368
|
createParticipantBehavior: [ 'type', CreateParticipantBehavior ],
|
|
@@ -43091,7 +43433,7 @@
|
|
|
43091
43433
|
* @typedef {import('diagram-js/lib/util/Types').Rect} Rect
|
|
43092
43434
|
*
|
|
43093
43435
|
* @typedef { {
|
|
43094
|
-
* associationDirection?:
|
|
43436
|
+
* associationDirection?: 'None' | 'One' | 'Both';
|
|
43095
43437
|
* type: string;
|
|
43096
43438
|
* } | boolean | null } CanConnectResult
|
|
43097
43439
|
*
|
|
@@ -43245,6 +43587,8 @@
|
|
|
43245
43587
|
|
|
43246
43588
|
BpmnRules.prototype.canConnectAssociation = canConnectAssociation;
|
|
43247
43589
|
|
|
43590
|
+
BpmnRules.prototype.canConnectCompensationAssociation = canConnectCompensationAssociation;
|
|
43591
|
+
|
|
43248
43592
|
BpmnRules.prototype.canMove = canMove;
|
|
43249
43593
|
|
|
43250
43594
|
BpmnRules.prototype.canAttach = canAttach;
|
|
@@ -43591,7 +43935,7 @@
|
|
|
43591
43935
|
return connectDataAssociation;
|
|
43592
43936
|
}
|
|
43593
43937
|
|
|
43594
|
-
if (
|
|
43938
|
+
if (canConnectCompensationAssociation(source, target)) {
|
|
43595
43939
|
return {
|
|
43596
43940
|
type: 'bpmn:Association',
|
|
43597
43941
|
associationDirection: 'One'
|
|
@@ -43599,9 +43943,9 @@
|
|
|
43599
43943
|
}
|
|
43600
43944
|
|
|
43601
43945
|
if (canConnectAssociation(source, target)) {
|
|
43602
|
-
|
|
43603
43946
|
return {
|
|
43604
|
-
type: 'bpmn:Association'
|
|
43947
|
+
type: 'bpmn:Association',
|
|
43948
|
+
associationDirection: 'None'
|
|
43605
43949
|
};
|
|
43606
43950
|
}
|
|
43607
43951
|
|
|
@@ -44068,11 +44412,6 @@
|
|
|
44068
44412
|
*/
|
|
44069
44413
|
function canConnectAssociation(source, target) {
|
|
44070
44414
|
|
|
44071
|
-
// compensation boundary events are exception
|
|
44072
|
-
if (isCompensationBoundary(source) && isForCompensation(target)) {
|
|
44073
|
-
return true;
|
|
44074
|
-
}
|
|
44075
|
-
|
|
44076
44415
|
// don't connect parent <-> child
|
|
44077
44416
|
if (isParent(target, source) || isParent(source, target)) {
|
|
44078
44417
|
return false;
|
|
@@ -44088,6 +44427,22 @@
|
|
|
44088
44427
|
return !!canConnectDataAssociation(source, target);
|
|
44089
44428
|
}
|
|
44090
44429
|
|
|
44430
|
+
/**
|
|
44431
|
+
* @param {Element} source
|
|
44432
|
+
* @param {Element} target
|
|
44433
|
+
*
|
|
44434
|
+
* @return {boolean}
|
|
44435
|
+
*/
|
|
44436
|
+
function canConnectCompensationAssociation(source, target) {
|
|
44437
|
+
return (
|
|
44438
|
+
isSameScope(source, target) &&
|
|
44439
|
+
isCompensationBoundary(source) &&
|
|
44440
|
+
is$1(target, 'bpmn:Activity') &&
|
|
44441
|
+
!isHostOfElement(target, source) &&
|
|
44442
|
+
!isEventSubProcess(target)
|
|
44443
|
+
);
|
|
44444
|
+
}
|
|
44445
|
+
|
|
44091
44446
|
/**
|
|
44092
44447
|
* @param {Element} source
|
|
44093
44448
|
* @param {Element} target
|
|
@@ -44214,6 +44569,10 @@
|
|
|
44214
44569
|
return getParent(element, 'bpmn:Process') || getParent(element, 'bpmn:Collaboration');
|
|
44215
44570
|
}
|
|
44216
44571
|
|
|
44572
|
+
function isHostOfElement(potentialHost, element) {
|
|
44573
|
+
return potentialHost.attachers.includes(element);
|
|
44574
|
+
}
|
|
44575
|
+
|
|
44217
44576
|
var RulesModule = {
|
|
44218
44577
|
__depends__: [
|
|
44219
44578
|
RulesModule$1
|
|
@@ -46488,6 +46847,10 @@
|
|
|
46488
46847
|
return false;
|
|
46489
46848
|
}
|
|
46490
46849
|
|
|
46850
|
+
if (propertyName === 'isForCompensation') {
|
|
46851
|
+
return !isEventSubProcess(newBusinessObject);
|
|
46852
|
+
}
|
|
46853
|
+
|
|
46491
46854
|
return true;
|
|
46492
46855
|
});
|
|
46493
46856
|
|