Custom ID Generator

Hi,
I want to generate custom ID’s for flowable taskId and processInstanceId but if i want implement with Id Generator that will change all the ID’s that flowable uses

So lets say i am process one and i have two taskId i want it to by
task1 will have task id=1
task2 will have task id =2

is this possible ?

Hey @kartik,

What’s the business use case you are trying to achieve?

Flowable provides the option to provide your own IdGenerator, which would then be used for generating all the ids for all the entities that Flowable has.

Cheers,
Filip

A user has a business key and on the basis of the process is started

So lets say a main process it instantiated with a processInstanceId as 1
and then i have 2 task which should have taskId as 1 and 2.

and then after that a decision maker decides whether two create sub-process or not

Main Process
–processInstanceId 1
—task1 taskId 1
—task2 taskId 2
Sub Process
–parent process InstanceId 1
–sub process Instanceid 2
—task1 taskId 1
—task2 taskId 2
and so on

This is what i want to achieve through flowable

regards,
kartik

@kartik, I don’t understand the business use case to control the ids. What’s the use case for you providing different IDs?

Keep in mind that the ids are the primary key, so they have to be unique. You cannot have task1 in Main process and sub process having the same id.

Cheers,
Filip

yes as per the flowable that is a condition but in our entity
we need a taskId that is readable by the user and what flowable provides is a longer but secure UUID code that is what i want to change i want to be an alpha numeric Long Integer

regards,
Kartik

I would advice you to use the name or the business key to make something readable to the user.

You can try to achieve what you want with a custom IdGenerator, but I am not sure that you can even achieve what you are looking for. As I said you cannot have 2 tasks with the same ID and from what you are explaining here it seems like that’s what you are looking for here

Cheers,
Filip

1 Like