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

Skip rules no-disconnect no-implicit-start no-implicit-end within AdHoc SubProcesses #181

Merged
merged 3 commits into from
Mar 20, 2025

Conversation

Buckwich
Copy link
Member

@Buckwich Buckwich commented Mar 19, 2025

Closes #180

Proposed Changes

Skip rules no-disconnect no-implicit-start no-implicit-end for activities within AdHoc SubProcesses

rule no-implicit-start no-implicit-end

Valid

AdHoc SubProcess still needs start & end
image

rule no-disconnect

Valid

image

Checklist

To ensure you provided everything we need to look at your PR:

  • Brief textual description of the changes present
  • Visual demo attached
  • Steps to try out present, i.e. using the @bpmn-io/sr tool
  • Related issue linked via Closes {LINK_TO_ISSUE} or Related to {LINK_TO_ISSUE}

@bpmn-io-tasks bpmn-io-tasks bot added the needs review Review pending label Mar 19, 2025
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.

Thanks for this PR, and the comprehensive visual description of what it does.

One thing that both of you discussed is whether it should only "disable for activities" or any flow-nodes, which is this case you attached, right?

image

Ad-hoc sub-processes are special, because start events and disconnected gateways are forbidden anyway, and elements are fine ("meant to be") disconnected there. Using bpmn-js-bpmnlint I validated this new rule against the recommended bpmnlint settings, some feedback:

To my knowledge, implicit start does not exist in the context of an ad-hoc sub-process. Elements must always be explicity activated.

image

Implicit ends do not exist inside an ad-hoc sub-process. It is completed by the user once "all work is done", whatever that means.

image

no-disconnected also generally does not make sense, within that element. We do have ad-hoc-sub-process as a rule that validates strictly connection semantics within an ad-hoc sub-process.

In this light, I propose to simplify your solution:

  • The no-disconnected, no-implicit-end and no-implicit-start should be disabled for all flow nodes within an ad-hoc sub process

@nikku
Copy link
Member

nikku commented Mar 20, 2025

We also have to be careful to return false from a rule evaluation, because it will prevent entering the sub-tree to check nested nodes.

@bpmn-io-tasks bpmn-io-tasks bot added in progress Currently worked on and removed needs review Review pending labels Mar 20, 2025
@barmac
Copy link
Member

barmac commented Mar 20, 2025

implicit start does not exist in the context of an ad-hoc sub-process
Implicit ends do not exist inside an ad-hoc sub-process

I agree with these statements.

no-disconnected also generally does not make sense, within that element. We do have ad-hoc-sub-process as a rule that validates strictly connection semantics within an ad-hoc sub-process.

Yes, but the rule does not apply to the gateways. Perhaps most suitable solution would be to disable no-disconnected for ad-hoc subprocess, and implement gateway validation in ad-hoc-sub-process (both incoming and outgoing required).

@nikku
Copy link
Member

nikku commented Mar 20, 2025

Perhaps most suitable solution would be to disable no-disconnected for ad-hoc subprocess, and implement gateway validation in ad-hoc-sub-process (both incoming and outgoing required).

Yes, I'd disable that rule. No, I'd not add dedicated validation for gateways, unless a user reports that as an issue. In other words, the following is an absolutely fine use of an ad-hoc sub-process to me. You can decide whether you want that "complex decision" to be taken, or any other decision, at any point in time:

image

This is also backed by the spec text you shared, I think.


Update: The following shows what things can still be an issue, but I think that these are edge cases. Especially the event-sub-process could be handled explicitly (independent of ad-hoc parent or not), because without following catch events it does not resemble a meaningful BPMN construct. The other one is a no-op:

image

@barmac
Copy link
Member

barmac commented Mar 20, 2025

Sure we can always wait for more feedback. Still, the main problem to solve is that activities are marked as disconnected/implicit-start/implicit-end where they should not be marked (false positive).

@Buckwich
Copy link
Member Author

I've adjusted the rules to always skip if in an adhoc-subprocess. I've kept returning false. And removed the invalid test case as they are now valid. I'll probably also squash all commits into one as it is always the same line of codes

@Buckwich Buckwich requested a review from nikku March 20, 2025 13:18
@bpmn-io-tasks bpmn-io-tasks bot added needs review Review pending and removed in progress Currently worked on labels Mar 20, 2025
@barmac
Copy link
Member

barmac commented Mar 20, 2025

Suggestion: The PR title could be human readable. We will not be able to find "180-adhoc-activities" in the future.

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.

Simple enough, thanks for following up! ⭐

Let's squash and merge things.

@Buckwich Buckwich changed the title 180-adhoc-activities Skip rules no-disconnect no-implicit-start no-implicit-end within AdHoc SubProcesses Mar 20, 2025
@Buckwich Buckwich merged commit da68d15 into main Mar 20, 2025
6 of 9 checks passed
@bpmn-io-tasks bpmn-io-tasks bot removed the needs review Review pending label Mar 20, 2025
@Buckwich Buckwich deleted the 180-adhoc-activities branch March 20, 2025 14:25
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.

Element is not connected, implicit start/end are incorrect in ad-hoc subprocess
3 participants