12-20-2017 06:16 AM
Hi,
Did any one has an idea about how to get the process instance id of a running process by using a script task in another process in which i can enter the process identifier of the called process as input?
12-20-2017 09:00 AM
Use the query api, something like below...Check Activiti User Guide - Query API for more details
runtimeService.createProcessInstanceQuery() .processDefinitionKey("myProcessDefinitionKey") .variableValueEquals("myVar", "someValue") .list() |
12-22-2017 02:27 AM
I adjusted your code according to my case of use as below:
runtimeService.createProcessInstanceQuery()
.processDefinitionKey("calledprocesstest")
.variableValueEquals("calledprocesstest_id", execution.getProcessInstanceId())
.list();
"calledprocesstest" is the process id of the process which i want to get its process instance id.
"calledprocesstest_id" is the variable that i want to set in the previous process instance id and map it in another process.
but it gives me "calledprocesstest_id" = empty
I don't know how to use your code correctly.
Explore our Alfresco products with the links below. Use labels to filter content by product module.