bpmn-io / bpmn-js

A BPMN 2.0 rendering toolkit and web modeler.
https://bpmn.io/toolkit/bpmn-js/
Other
8.52k stars 1.31k forks source link

Cancel Event is handled like regular End Event #1954

Open mnp-mid opened 1 year ago

mnp-mid commented 1 year ago

Describe the Bug

Cancel Event is handled like regular End Event on bpmn.io

Steps to Reproduce

  1. Select Cancel End Event from the tool bar on the left
  2. Place Cancel End Event => Cancel End Event is replaced with End Event

image

image

image

Expected Behavior

Environment

smbea commented 1 year ago

Thank you for reporting. I can reproduce the issue.

nikku commented 1 year ago

The BPMN spec defines that cancel end events are only permitted in transactions:

image

Our tooling ensures you don't build inconsistent models, hence it does not allow you to place the cancel end event outside of a transaction, it allows you to place it inside though:

capture yAZwlc_optimized

Given this information, what do you expect?

mnp-mid commented 1 year ago

In this case my expectation would be to show an error like this.

image

That says: "Cancel Events can only be placed in Transaction Sub-Processes".

This would help the user not to get confused why the cancel event is transformed to regular end event. A hint or a warning would be useful. However, this seems to be very tricky to deal with this, since the transaction sub process can be changed to something else as well.

Thank you for the bpmn definition reminder. So, I leave it up to you on closing this ticket or adding a hint in any way.

smbea commented 1 year ago

I would suggest we prevent placing cancel events with an error like mentioned above. And when replacing the transaction with another sub process, I suggest we maintain the same behaviour of casting it to a normal end event.

nikku commented 1 year ago

What about the following: