All persistent entities managed by the process engine (Process Instances, Tasks, …) have uniqueIds. These Ids uniquely identify an individual task, process instance, etc. When these entities arepersisted to the database, the ids are used as primary keys in the corresponding database tables.

Out of the box, the process engine provides two Id generator implementations.

The Database Id Generator

The Database Id Generator is implemented using a sequence Generator on top of the ACT_RU_PROPERTYtable.

This id generator is good for debugging and testing since it generates human readable ids.

The Database Id Generator should never be used in production since it cannot handle high levels of concurrency.

The UUID Generator

The StrongUuidGenerator uses a UUID generator which uses the Java UUID Generator (JUG) libraryinternally.

Always use the StrongUuidGenerator for production setups.

In the Camunda BPM Full Distributions, theStrongUuidGenerator is preconfigured and the default Id Generator used by the process engine.

If you use an embedded process engine configuration and configure the process engine using Spring,you need to add the following lines to the Spring configuration to enable theStrongUuidGenerator:

  1. <bean id="processEngineConfiguration" class="org.camunda.bpm.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration">
  2. [...]
  3. <property name="idGenerator">
  4. <bean class="org.camunda.bpm.engine.impl.persistence.StrongUuidGenerator" />
  5. </property>
  6. </bean>

Additionally, you need the following maven dependency:

  1. <dependency>
  2. <groupId>com.fasterxml.uuid</groupId>
  3. <artifactId>java-uuid-generator</artifactId>
  4. <scope>provided</scope>
  5. <version>3.1.2</version>
  6. </dependency>

原文: https://docs.camunda.org/manual/7.9/user-guide/process-engine/id-generator/