Modify process instance name

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

Re: Modify process instance name

Jump to solution

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"

wojtekb
Customer

Re: Modify process instance name

Jump to solution

Your solution works very well. But I have a question, is it possible to use a process variable in the process name? I tried to use a variable eg ${ClaimNumber} but unfortunately it doesn't work for me.

agnishu
Active Member

Re: Modify process instance name

Jump to solution

this may not be possible because the name is set just after the process start and h epocess insance might not be aware of this variable.

however if you started your process through Java code, then you can sart a process and immediately set a name of your choice. it can be a dynamic value passed from outside.

suppose "title" is a variable, you can create REST end point and execute this. you can then see this started process in the UI.

ProcessInstance processInstance = processEngine.getRuntimeService().startProcessInstanceByKey("someKey", variables);
processEngine.getRuntimeService().setProcessInstanceName(processInstance.getId(), title);