How does simulator methods of BPMN Token stimulation works?

Currently i am trying to manually trigger and wait the token of token stimulation for flowing the token only for qualified path.
Wait for element method : this.simulator.waitAtElement(id) is working .
But the method for enter and signal is not working…,that is to start the flow on particular path alone.
Below is the snippet i tried,
const scope = this.simulator.createScope({

Please advise on the above.

Please share a CodeSandbox that reproduces your issue in a way that we can inspect it.

We dont have access to codesandbox in our organisation.
We are trying to control the token flow as interactive stimulation where in every condition flow split, the element will wait at the souce activity and a popup will triggered with all the conditions in the split.When the user choose any condition the token has to flow only on that particular flow.

For Waiting of the token:

For trigger particular flow:
const scope = this.simulator.createScope({

When executing exit method it throws error as
unhandled error in event listener TypeError: Cannot read properties of undefined (reading ‘name’)
at getElementName (Log.js:42:1)
at Log.js:152:1
at invokeFunction (EventBus.js:519:1)
at push…/node_modules/bpmn-js/node_modules/diagram-js/lib/core/EventBus.js.EventBus._invokeListener (EventBus.js:371:1)
at push…/node_modules/bpmn-js/node_modules/diagram-js/lib/core/EventBus.js.EventBus._invokeListeners (EventBus.js:352:1)
at push…/node_modules/bpmn-js/node_modules/diagram-js/lib/core/ (EventBus.js:313:1)
at emit (Simulator.js:602:1)
at trace (Simulator.js:579:1)
at Simulator.js:167:1
at queue (Simulator.js:71:1)

This method involves modeling the process as a series of discrete events and simulating their occurrence over time. Each token represents an instance of the process, and events trigger transitions between activities. Simulation software uses algorithms to simulate the timing and sequencing of events based on defined probabilities and parameters.

Simulator methods for BPMN (Business Process Model and Notation) token stimulation work by emulating the behavior of a business process defined using BPMN notation. In BPMN, a process is represented as a series of interconnected activities, decisions, gateways, and events. Tokens represent the flow of work through these elements in the process.

In a simulator, the process model is interpreted, and tokens are simulated to move through the process following the defined sequence of activities and decisions. The simulation can be executed under different conditions, such as varying input data or different user interactions, to observe how the process behaves under different scenarios.