Hi,
I’ve just started using Flowable, and have a question on obtaining task IDs when starting a process. Given that I start a process using something like
final ProcessInstance process = runtimeService.startProcessInstanceByKey("someProcessName", variables);
Is it possible to immediately obtain the task ID(s) associated with this specific instance of the process?
Thanks,
Steve
Hi Steve,
Yes that’s possible. In the case when the process task is the first wait state (in fact it means that there is no asynchronous task between process start event and user task), you can query for the tasks of the started process instance with taskService query.
Martin
Hi Martin,
thanks for the help. I’ll code this up and see how it goes. There may be more questions!
Regards,
Steve
shweta
November 2, 2017, 1:14pm
5
Hi Martin,
I didnt get how we can actually achieve this. Could you elaborate.
TaskService.getTaskFormModel(String taskId)
What to place here for taskID?
zhiyin
November 5, 2017, 2:19am
6
hi shweta:
maybe you can try this code:
TaskService().createTaskQuery().processInstanceId(processInstanceId).list();
According to the different starting flow chart design, where the task ID may have a plurality of, or null.
Hint: asynchronous, service node, concurrent process
shweta
November 6, 2017, 4:59am
7
Hi Zhiyin,
Thanks for the solution. Worked for me
Cheers
Thanks and regards
Shweta