Hi.
when I start a processInstance, can I specially some rule for generating id such like each processInstance will start with ”P_", each serviceTask is “ST_” and so on.
Thx
Hi.
when I start a processInstance, can I specially some rule for generating id such like each processInstance will start with ”P_", each serviceTask is “ST_” and so on.
Thx
Hi Denny.
Simple answer is yes.
Have a look on org.flowable.common.engine.impl.AbstractEngineConfiguration#usePrefixId
.
It is not clear for me why do you need serviceTaskId (except model id). Could you provide some use case?
Regards
Martin
halo Martin,
In my case, some business service need to use workflow, the processId, taskId will be the only way to connect workflow service. Someone will not carry what ID it is and someone has some special rule. I would like to get some convenient way for showing like OA task are look like OA_TASK_someUUID etc (actually it does not needful requirement).
By the way, are these any hook for getting execution type( like porcess, task, gateway) so that I can set some special ID.
Not only add prefix, but also specially generator rule, not like UUID which is ruleless.
As for I know, It IdGenerator.getNextId()
Interface can not do it directly.
Thx
Denny,
Gateway is not persisted, it does not have id in the runtime.
Each EngineConfiguration (ProcessEngineConfiguration too) can have its own idGenerator (org.flowable.common.engine.impl.AbstractEngineConfiguration#idGenerator).
So just set your own idGenerator impl. for the process engine.
It helps for executions/processes, cases, etc., but it does not work for e.g. tasks because they do not have their own engine configuration.
Have a look on org.flowable.common.engine.impl.db.DbSqlSession#insert
I see two possibilities there:
org.flowable.task.service.impl.persistence.entity.data.impl.MybatisTaskDataManager
) to handle task Ids.Regards
Martin
Thx a lot. I will try it