cancel
Showing results for 
Search instead for 
Did you mean: 

Getting a Process Instance name from Script

jose_leon_coupa
Confirmed Champ
Confirmed Champ

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;
}
 
 
 
0 REPLIES 0