As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
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?
Use the query api, something like below...Check Activiti User Guide - Query API for more details
runtimeService.createProcessInstanceQuery()
.processDefinitionKey("myProcessDefinitionKey")
.variableValueEquals("myVar", "someValue")
.list()
I adjusted your code according to my case of use as below:
.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.