How does simulator methods of BPMN Token stimulation works?

TLDR: Learn how the Simulator API works, and you’ll be able to use it, at your own risk. Consider to instead use SimulationSupport instead.


Detailed write-up:

:warning: The Simulator is a low level utility. Use it at your own risk.

:information_source: SimulationSupport is a high-level utility to drive forward the simulation, and hides details that are not relevant to the average user.

The Simulator offers plenty of APIs to inspect the current run-time state, but also drive the simulation state forward.

However:

  • You don’t usually create scopes outside of the simulator (ref)
  • You often times need to reference parent scopes or things will blow up:
    • in the case of entering a scope pass the parent scope, and the actual element to be entered (ref)
    • in the case of exiting a scope, pass the scope and element as context (ref)
1 Like