How can I use java api to create a process engine and set it to the process engines

Hello everyone.
I already readed the document of Multiple engines with a distributed Database but there just have a example that via yml config file.

I want to know how can i create multiple engines via java api.
Thanks you all.

Hi @himly,

The docs you found is about Camunda Optimize and I guess that is not what you are using.

To create a process engine in java, you can follow this example: https://docs.camunda.org/manual/7.10/user-guide/process-engine/process-engine-bootstrapping/#bootstrap-a-process-engine-using-the-java-api.

To create multiple engines, run this code multiple times. You should give the engines different names in that case.

Cheers,
Thorben