bpmn-io / bpmn-js-token-simulation

A BPMN 2.0 specification compliant token simulator.
https://bpmn-io.github.io/bpmn-js-token-simulation/modeler.html?e=1&pp=1
MIT License
243 stars 69 forks source link

Exclusive Gateway Throws Error When There Are No Outgoing Elements #134

Closed lukagerlach closed 1 year ago

lukagerlach commented 1 year ago

Describe the Bug

whenever a process has an exclusive gateway without any outgoing activities and the token simulation reaches the gateway, an error is thrown and the simulation stops working. With every other gateway this does not happen, the simulation finishes as expected.

I believe this comes from lines 41-43 inside the ExclusiveGatewayBehavior class.

Steps to Reproduce

  1. Create model with exclusive gateway that has no following activities.
  2. Start token simulation.
  3. Simulation throws an error as soon as the token reaches the exclusive gateway.

Expected Behavior

Like every other gateway, let the simulation finish when it reaches an element with no outgoings

nikku commented 1 year ago

@lukagerlach Would you take a stab at fixing the behavior? You'd want to verify this through a test case, too.