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

fix(no-loop): return no next elements if no call activity loop #156

Closed
wants to merge 1 commit into from

Conversation

philippfromme
Copy link
Collaborator

Test was broken. We need to return no next elements if the call activity does not call the parent process.

brave_IIl41jA7oT

Closes #155

@@ -71,25 +71,28 @@ const valid = [
moddleElement: createModdle(createDefinitions(`
<bpmn:process id="Process_1" isExecutable="true">
<bpmn:startEvent id="StartEvent_1">
<bpmn:outgoing>SequenceFlow_1</bpmn:outgoing>
<bpmn:outgoing>SeqeuenceFlow_1</bpmn:outgoing>
Copy link
Member

Choose a reason for hiding this comment

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

Feedback: I find it hard to assess the changes that we're testing here as I cannot see the BPMN diaram.

Why don't we source the test samples from a diagram that I can open?

Please share the before and after diagrams that you used.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Since there are so many test cases they each have their own diagram, we'd end up with hundreds of diagrams. I agree that it's difficult without being able to open the diagram. 😞

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Before 🤡

before

After

after

Copy link
Member

Choose a reason for hiding this comment

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

Since there are so many test cases they each have their own diagram, we'd end up with hundreds of diagrams.

As long as we don't dynamically generate the contents, what's wrong with 100 test diagrams? 🙂

Copy link
Member

Choose a reason for hiding this comment

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

Looking at before and after what did we fix? And why don't we keep before as a valid test case, and add another one (after)? What does adding the X gateway brings to the table?

A general good practice could be to give each of these tests human readable names:

NOT:

  • call activity

BUT:

  • call activity (calling other process)
  • call activity (calling dynamically computed process)
  • ...
  • call activity (calling itself)

Copy link
Member

Choose a reason for hiding this comment

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

I do understand that what we're testing here is

call activity (calling other process)

Copy link
Contributor

Choose a reason for hiding this comment

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

We could have a separate folder for each of the rules.

@@ -122,6 +122,8 @@ function getNextFlowElements(flowElement) {
}
}
}

return [];
Copy link
Member

Choose a reason for hiding this comment

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

From what I understand we either dive into the called process (when invoked via a call activity) or fallback to the default behavior, which is to continue the normal flow. Is my assumption correct?

Then why would we want to not continue the normal flow if referenced start event cannot be found / called reference cannot resolve?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It seems I got a little bit confused here. There is no bug and the behavior was correct. 🙈 I will close this pull request and the issue and leave a message in the Slack thread.

Copy link
Member

Choose a reason for hiding this comment

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

🚂

@bpmn-io-tasks bpmn-io-tasks bot removed the needs review Review pending label Feb 15, 2024
@nikku nikku deleted the fix-no-loop branch February 15, 2024 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

no-loop Rule Detects False Positives
3 participants