Having trouble integrating the lib token simulator in modeler bpmn-js

I am new to npm. After managing to install it as well as bpmn-js, I tried to follow the instruction (GitHub - bpmn-io/bpmn-js-token-simulation: A BPMN 2.0 specification compliant token simulator.) by first importing modeler and stuck at the step. It is frustrating!

The error message I got is:SyntaxError: Cannot use import statement inside the Node.js REPL, alternatively use dynamic import.

I searched the forum for some help, but didn’t find helpful instructions. Any help or guidance would be greatly appreciated!


Given the error message you shared, are you using Node Command Line tools (REPL)? Or in which setup are you trying to install the token simulation extension?

Note that this needs to run in the browser.

I think I was using the node command line (REPL), NIklas. I was trying to exit REPL by using the command process.exit().

That won’t work then, any bpmn-js application needs to run in the browser. I’d recommend checking out the starters and see how to run a simple Modeler application.

Thank you for your fast response, Niklas. Obviously I am really new to this. I went to the site you recommended, but still couldn’t figure out where to start. It seems that I still need to install nodejs and npm. But I am still at loss as to how to proceed from there. Sorry for the trouble, Niklas. Any pointers would be appreciated!

I think it makes sense for you to share what you already got, e.g. a GitHub project or something else, so that we can have a look. Afterward, please also point out where you are exactly stuck.

I am not able to get far, Niklas.

So far I installed nodejs and npm. I tried to import bpmn token simulator and bpmnlint, but didn’t know how to do that. The instructions on the web page are difficult to follow for a person who is new to both nodejs and npm. Again, appreciate your kind offer of help, Niklas!

Linying (Lin) Dong, Ph.D., Professor

Ted Rogers School of Information Technology Management
Toronto Metropolitan University
Tel: 416 9795000 ext. 554516
Office TRS2-072

Address: Room 2-072 575 Bay Street, Toronto, ON Canada M5G 2C5

Mailing Address: 350 Victoria Street, Toronto, ON, Canada M5B 2K3

Strategic. Global. Collaborative. Research-driven

Can you explain your use case? Are you trying to show a bpmn-js instance plus the token simulation in the browser?

Thank you for your question Philipp. I think it might be helpful to provide a bit of background of my inquiries. I am teaching an undergraduate course Business Process Management. While I’ve found bpmn.io a very useful tool to develop bpmn diagrams, I would like the tool to be able to check errors made in bpmn diagrams so I don’t need to read through each diagram. Students will receive fast and immediate feedback on their work. In addition, it would be helpful to understand the flow of a complex diagram by using the token simulation feature. Another feature I am hoping to access is process simulation which provides the estimates of cycle time taken to complete a process and identifies bottlenecks. Hope that this helps answer your question, Philipp. Let me know if you have any other questions.


That’s an interesting use case. Depending on what errors you want to detect, you could use bpmnlint. For example, you could detect a task with no outgoing sequence flow. The token simulation is primarily meant to be used to understand how a diagram will be executed. There’s no built-in error detection. You’d detect an error by observing the execution.

The general setup is fairly easy: token-simulation-example - CodeSandbox You just include the token simulation as an additional module when creating the modeler.