10-28-2016 11:32 AM
12-21-2016 12:24 PM
Hi,
You can get it via process instance query API
execution.getEngineServices().getRuntimeService().createProcessInstanceQuery().processInstanceId(execution.getProcessInstanceId()).singleResult().getName();
01-10-2017 01:48 PM
Thanks for the reply Ciju!
Tried the code it gave me null pointer exception so tried to get the query count for the process instance
ProcessInstanceQuery pqry = execution.getEngineServices().getRuntimeService().createProcessInstanceQuery().processInstanceId(execution.getProcessInstanceId())
and the query count is 0.
We are using Enterprise Activiti 1.5
Regards,
Durai
01-10-2017 06:23 PM
Hi Ramesh,
That is probably because the process instance is not yet committed into the database at the time of your query.
For example if you do query count in a script/service task in a process that looks like Start->Script->End it doesn't work.
Now if you make the script/service task "Async" and do the process instance query, it works.
Regards,
Ciju
01-11-2017 08:35 AM
Hi Ciju,
Yes I had the query count logic in "Execution Listeners" start event in the task following Process Start. After marking the checkbox "Asyncronous" checked in the task where my script exists then I was able to get the query result.
When you got minute can you please throw some light on the purpose of the "Asynchronous" checkbox in the user task does.
Thank you very much for the help!!
Regards,
Ramesh
01-11-2017 12:11 PM
Hi Ramesh,
Upon starting a process, activiti persists the data to database upon reaching the first asynchronous task. Hence the query was able to fetch from the name from the database!
It is explained here in detail Activiti User Guide ( section Asynchronous Continuations)
Regards,
Ciju
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.