How does simulator methods of BPMN Token stimulation works?

Hi,
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({
element:elementRegistry.get(id)
});
this.simulator.enter(scope);

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:
this.simulator.waitAtElement(id)

For trigger particular flow:
const scope = this.simulator.createScope({
element:elementRegistry.get(‘Activity_1ondrys’)
});
console.log(scope);
this.simulator.exit({element:‘Activity_1ondrys’,scope:scope});
this.simulator.enter({element:‘Activity_1wfy1pk’})
this.simulator.signal({element:‘Activity_1wfy1pk’});

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.EventBus.fire (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)