Generate custom taskId and ProcessInstanceId instead of flowable's id

Hi Guys,

I want to generate custom processInstanceId and TaksId for our workflows. Depending upon the deployed workflows, we keep custom prefix for each and assosciate custom uuid with it. Similarly we want to generate custom uuid for individual tasks also. Can you guys suggest the correct way to override it.

I have seen the question: Can I generator Id (task or processInstance) by special rule?. But I didn’t uderstood what are the steps for implementing custom DbSqlSession. How I can implement it’s custom implementation(like where I should tell my custom implemented class. Can I add it in SpringProcessEngineConfiguration like Delegates and event listeners?). What are steps need to make flowable understand about my custom implementation?

Thanks

Hi guys… Anybody have any idea?..@martin.grofcik @joram

No need to ping anyone here … this is an open source forum and @-ing someone won’t get you a response faster.

If you want custom ID’s, you need to set a custom IdGenerator implementation on your engine configuration. See https://github.com/flowable/flowable-engine/blob/master/modules/flowable-engine/src/main/java/org/flowable/engine/impl/cfg/ProcessEngineConfigurationImpl.java#L3034

I am really sorry joram, for directly mentioning…
I have figured that out(for generating id), but my current problem is that to follow different rules for generating processId and taskId. Even if I implement custom implementation for an IdGenerator, it is going to generate id for processInstance as well as taskId with a common implementation…right?

From the question previously mentioned, I understood that overriding DbSqlSession.insert(Entity entity) give me the flexibility to generate different kind of Id for process instance and task. But still I didn’t understood how we can set that in engine config?

Is there any other methods?

Thanks…

That’s correct, the IdGenerator needs to generate ids only, but doesn’t know about the final entity.

You can do that by setting a customSessionFactory on the engine configuration, returning DbSqlSessionc.class to have your version ‘win’ over the default one.

None that I can think of right now. Having fully customised id’s is not something that’s requested often.