diff --git a/lib/features/rules/BpmnRules.js b/lib/features/rules/BpmnRules.js index 69cd0ee83..79b29203e 100644 --- a/lib/features/rules/BpmnRules.js +++ b/lib/features/rules/BpmnRules.js @@ -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) { @@ -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); } /**