Skip to content
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

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

philippfromme
Copy link
Contributor

Closes #1902

@bpmn-io-tasks bpmn-io-tasks bot added the needs review Review pending label May 4, 2023
@@ -1164,10 +1154,18 @@ function canCopy(elements, element) {
return true;
}

if (is(element, 'bpmn:Lane') && !includes(elements, element.parent)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're getting rid of null-safety here. Is this intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me have a look.

isMessageFlowTarget(target) &&
!isSameOrganization(source, target)
);
return isMessageFlowSource(source)
Copy link
Member

Choose a reason for hiding this comment

The 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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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.

@@ -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;
Copy link
Member

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?

Copy link
Contributor Author

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.

@@ -58,7 +58,8 @@ describe('features/modeling/rules - BpmnRules', function() {
sequenceFlow = elementFactory.createConnection({
Copy link
Member

Choose a reason for hiding this comment

The 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.

Copy link
Member

@nikku nikku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As indicated in my comments it is fairly hard to understand changes in the BpmnRules. Maybe certain repetitive patterns can be simplified, and moved to a separate function with a human readable name?

This applies to some repetitive patterns, including, but not limited to d84c638#diff-6031dc6e8e3d4e38aef3c1dda35e6ff836a6b6be1263157300284d0191a6d5d4R1165.

@bpmn-io-tasks bpmn-io-tasks bot added in progress Currently worked on and removed needs review Review pending labels May 9, 2023
@nikku
Copy link
Member

nikku commented May 26, 2023

Looks like this PR is stalled. @philippfromme Do you still plan to follow up? If not, let's mark the issue as spring cleaning and move this PR into our backlog.

@philippfromme
Copy link
Contributor Author

philippfromme commented May 26, 2023

It's still on my radar. I just don't have capacity to work on it right now. Since we already have this pull request in progress I'd like to finish it.

@barmac
Copy link
Member

barmac commented May 31, 2023

Let's move it to draft till you come back to the topic.

@barmac barmac marked this pull request as draft May 31, 2023 13:02
@barmac barmac force-pushed the develop branch 6 times, most recently from 1be3741 to 0b4e7a3 Compare December 4, 2023 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in progress Currently worked on
Development

Successfully merging this pull request may close these issues.

Creating Message Flow in Process Not Prevented
3 participants