Getting a Process Instance name from Script

cancel
Showing results for 
Search instead for 
Did you mean: 
jose_leon_coupa
Active Member II

Getting a Process Instance name from Script

Hi all,

 

I need to update the process instance name based on the current name using a Script. I thought something like below. But I don't know how to get the processInstance object from the execution. Any advice?

 

Thanks,

 

currentProcessName = processInstance.getName();

switch (currentProcessName) {

case "ABC":

   execution.getEngineServices().getRuntimeService().setProcessInstanceName(execution.getProcessInstanceId(), "New ABC");

   break;
 
case "CDE":

   execution.getEngineServices().getRuntimeService().setProcessInstanceName(execution.getProcessInstanceId(), "Something else CDE");

   break;
}