-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do Not Copy Message Flows Without Participant #1904
base: develop
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -144,7 +144,7 @@ BpmnRules.prototype.init = function() { | |
|
||
return every(elements, function(element) { | ||
if (isConnection(element)) { | ||
return canConnect(element.source, element.target, element); | ||
return (canConnect(element.source, element.target, element) || {}).type === element.type; | ||
} | ||
|
||
if (element.host) { | ||
|
@@ -1068,11 +1068,11 @@ function canConnectMessageFlow(source, target) { | |
return false; | ||
} | ||
|
||
return ( | ||
isMessageFlowSource(source) && | ||
isMessageFlowTarget(target) && | ||
!isSameOrganization(source, target) | ||
); | ||
return isMessageFlowSource(source) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm hesitant to merge this, as this is completely unclear what these additions ensure. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll have to check whether this check is strictly necessary. The point is to make sure source and target are in different participants. |
||
&& (is(source, 'bpmn:Participant') || !!getParent(source, 'bpmn:Participant')) | ||
&& isMessageFlowTarget(target) | ||
&& (is(target, 'bpmn:Participant') || !!getParent(target, 'bpmn:Participant')) | ||
&& !isSameOrganization(source, target); | ||
} | ||
|
||
/** | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,7 +58,8 @@ describe('features/modeling/rules - BpmnRules', function() { | |
sequenceFlow = elementFactory.createConnection({ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As we're fixing something I'd expect a test case that verifies the new behavior. |
||
type: 'bpmn:SequenceFlow', | ||
source: task1, | ||
target: task2 | ||
target: task2, | ||
waypoints: [] | ||
}); | ||
|
||
// then | ||
|
@@ -74,7 +75,8 @@ describe('features/modeling/rules - BpmnRules', function() { | |
sequenceFlow = elementFactory.createConnection({ | ||
type: 'bpmn:MessageFlow', | ||
source: task1, | ||
target: task2 | ||
target: task2, | ||
waypoints: [] | ||
}); | ||
|
||
// then | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's elaborate what this does.
My guess is it ensures that connections can only be created if they would not change their type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the check was useless before because we want to create a number of shapes and connections that are predefined and must not change their type during creation.