Comparing version 16.2.0 to 16.3.0
@@ -6,2 +6,3 @@ import AdaptiveLabelPositioningBehavior from './AdaptiveLabelPositioningBehavior'; | ||
import BoundaryEventBehavior from './BoundaryEventBehavior'; | ||
import CompensateBoundaryEventBehavior from './CompensateBoundaryEventBehavior'; | ||
import CreateBehavior from './CreateBehavior'; | ||
@@ -51,2 +52,3 @@ import CreateDataObjectBehavior from './CreateDataObjectBehavior'; | ||
'boundaryEventBehavior', | ||
'compensateBoundaryEventBehaviour', | ||
'createBehavior', | ||
@@ -91,2 +93,3 @@ 'createDataObjectBehavior', | ||
boundaryEventBehavior: [ 'type', BoundaryEventBehavior ], | ||
compensateBoundaryEventBehaviour: [ 'type', CompensateBoundaryEventBehavior ], | ||
createBehavior: [ 'type', CreateBehavior ], | ||
@@ -93,0 +96,0 @@ createDataObjectBehavior: [ 'type', CreateDataObjectBehavior ], |
@@ -79,7 +79,2 @@ import { | ||
if (is(connection, 'bpmn:Association') && !bpmnRules.canConnectAssociation(source, target)) { | ||
remove = true; | ||
} | ||
// remove invalid connection, | ||
@@ -118,7 +113,10 @@ // unless it has been removed already | ||
type: allowed.type, | ||
associationDirection: allowed.associationDirection, | ||
waypoints: connection.waypoints.slice() | ||
}); | ||
// remove old connection | ||
modeling.removeConnection(connection); | ||
// remove old connection unless it's already removed | ||
if (connection.parent) { | ||
modeling.removeConnection(connection); | ||
} | ||
@@ -125,0 +123,0 @@ // replace connection in context to reconnect end/start |
@@ -207,2 +207,6 @@ import { | ||
if (propertyName === 'isForCompensation') { | ||
return !isEventSubProcess(newBusinessObject); | ||
} | ||
return true; | ||
@@ -209,0 +213,0 @@ }); |
@@ -10,2 +10,3 @@ /** | ||
canConnectAssociation: typeof canConnectAssociation; | ||
canConnectCompensationAssociation: typeof canConnectCompensationAssociation; | ||
canMove: typeof canMove; | ||
@@ -31,3 +32,3 @@ canAttach: typeof canAttach; | ||
export type CanConnectResult = { | ||
associationDirection?: string; | ||
associationDirection?: 'None' | 'One' | 'Both'; | ||
type: string; | ||
@@ -76,2 +77,10 @@ } | boolean | null; | ||
/** | ||
* @param source | ||
* @param target | ||
* | ||
* @return | ||
*/ | ||
declare function canConnectCompensationAssociation(source: Element, target: Element): boolean; | ||
/** | ||
* @param elements | ||
@@ -78,0 +87,0 @@ * @param target |
@@ -53,3 +53,3 @@ import { | ||
* @typedef { { | ||
* associationDirection?: string; | ||
* associationDirection?: 'None' | 'One' | 'Both'; | ||
* type: string; | ||
@@ -208,2 +208,4 @@ * } | boolean | null } CanConnectResult | ||
BpmnRules.prototype.canConnectCompensationAssociation = canConnectCompensationAssociation; | ||
BpmnRules.prototype.canMove = canMove; | ||
@@ -555,3 +557,3 @@ | ||
if (isCompensationBoundary(source) && isForCompensation(target)) { | ||
if (canConnectCompensationAssociation(source, target)) { | ||
return { | ||
@@ -564,5 +566,5 @@ type: 'bpmn:Association', | ||
if (canConnectAssociation(source, target)) { | ||
return { | ||
type: 'bpmn:Association' | ||
type: 'bpmn:Association', | ||
associationDirection: 'None' | ||
}; | ||
@@ -1034,7 +1036,2 @@ } | ||
// compensation boundary events are exception | ||
if (isCompensationBoundary(source) && isForCompensation(target)) { | ||
return true; | ||
} | ||
// don't connect parent <-> child | ||
@@ -1061,2 +1058,18 @@ if (isParent(target, source) || isParent(source, target)) { | ||
*/ | ||
function canConnectCompensationAssociation(source, target) { | ||
return ( | ||
isSameScope(source, target) && | ||
isCompensationBoundary(source) && | ||
is(target, 'bpmn:Activity') && | ||
!isHostOfElement(target, source) && | ||
!isEventSubProcess(target) | ||
); | ||
} | ||
/** | ||
* @param {Element} source | ||
* @param {Element} target | ||
* | ||
* @return {boolean} | ||
*/ | ||
function canConnectMessageFlow(source, target) { | ||
@@ -1181,1 +1194,5 @@ | ||
} | ||
function isHostOfElement(potentialHost, element) { | ||
return potentialHost.attachers.includes(element); | ||
} |
{ | ||
"name": "bpmn-js", | ||
"version": "16.2.0", | ||
"version": "16.3.0", | ||
"description": "A bpmn 2.0 toolkit and web modeler", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4985633
361
126628