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:
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.
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.