Skip to content

Commit

Permalink
fix: make check for creating connection stricter when creating elements
Browse files Browse the repository at this point in the history
Closes #1902
  • Loading branch information
philippfromme committed May 4, 2023
1 parent 0722797 commit ce96c74
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/features/rules/BpmnRules.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ BpmnRules.prototype.init = function() {

return every(elements, function(element) {
if (isConnection(element)) {
return canConnect(element.source, element.target, element);
return is(element, (canConnect(element.source, element.target, element) || {}).type);
}

if (element.host) {
Expand Down Expand Up @@ -1061,11 +1061,11 @@ function canConnectMessageFlow(source, target) {
return false;
}

return (
isMessageFlowSource(source) &&
isMessageFlowTarget(target) &&
!isSameOrganization(source, target)
);
return isMessageFlowSource(source)
&& (!!getParent(source, 'bpmn:Participant') || is(source, 'bpmn:Participant'))
&& isMessageFlowTarget(target)
&& (!!getParent(target, 'bpmn:Participant') || is(target, 'bpmn:Participant'))
&& !isSameOrganization(source, target);
}

/**
Expand Down

0 comments on commit ce96c74

Please sign in to comment.