cancel
Showing results for 
Search instead for 
Did you mean: 

Modify process instance name

mrahn
Confirmed Champ
Confirmed Champ

Dear community.

Is there a way to modify the name of a process instance?

I'd prefer to use an execution (or task) listener for this purpose. Having ${processInfoBean.getProcessName(execution)} to get the process instance name I wonder whether there is a method to modify the process instance name.

Best regards

Marco

1 ACCEPTED ANSWER

daisuke-yoshimo
Star Collaborator
Star Collaborator

> Is there a way to modify the name of a process instance?

You can user public api 'RuntimeService.setProcessInstanceName(String processInstanceId, String name)'.

RuntimeService (Activiti - Engine 5.22.0 API) 

* Java example

execution.getEngineServices().getRuntimeService().setProcessInstanceName(execution.getProcessInstanceId(), %NAME%);

* Expression example

${execution.getEngineServices().getRuntimeService().setProcessInstanceName(execution.getProcessInstanceId() , %NAME%)}

View answer in original post

12 REPLIES 12

ah ok .. understood.

I was hoping that I could stay on the modelling site of the game but anyhow: thank you very much for the effort .. your help is most appreciated!

agnishu
Champ on-the-rise
Champ on-the-rise

i tried setting the process instance name in the first user task listener, but it doesnt change the title, i have tried keeping this listener at multiple places but it seems to not change the header in the web.

has anyone tried and got results

agnishu
Champ on-the-rise
Champ on-the-rise

it seems i can change the title by simply editing it before starting the process. but im still unable to retrieve the same during the execution. can someone help how can i retrieve the title during the execution? i tried to access all fields but no luck.

PS: the title we see in activiti-app whic usualu has format - "process name-current date"