Create a custom Id Generator

Hi all, I need to implement my custom generator but I’d like to create different naming convention for different entity type.

I implemented an interface of ProcessEnginePlugin and overrided the following method but I can’t retrieve the entity type. Is it possible?

public void preInit(ProcessEngineConfigurationImpl processEngineConfiguration) {
  processEngineConfiguration
    .setIdGenerator(new CustomIdGenerator(processEngineConfiguration.getProcessEngineName()));
 }

For Example:
PROCESS INSTANCE-ID: PI-8bee5c6f-3c6f-11e7-9f30-2e5520524153
PROCESS-DEFINITION-ID: PD-2bee5c6f-3c6f-11e7-9f30-2e5520522267
TASK-ID: TS-5bee5c6f-3c6f-11e7-9f30-2e5520524177

Regards
Luca

Hi @lsantaniello,

it’s not possible to use a different id generator per entity type. What is your use case?

Best regards,
Philipp

I’d like to generate different structure id for task and process.

Thanks

Ok, that doesn’t help me to understand why you need different ids :wink:

However, you have to built it by your own. Maybe you can use the table name to identify the entity type,

Best regards,
Philipp