Update businesskey of started process with API

Hi,

Is it possible to update/change the businesskey of a started but not completed yet process using camunda api ?

It shouldbe possible, yes. There is an API call for this.

I saw this method https://docs.camunda.org/manual/7.12/reference/rest/process-instance/post-modification/ but there is nothing about businesskey
Did i miss something ?

The java API call for this is setProcessBusinessKey. I have never worked with the REST API.

Hi @Vincent_Gueguem,

yo can find background information here: https://docs.camunda.org/manual/7.12/user-guide/process-engine/delegation-code/#set-business-key-from-delegation-code.

Hope this helps, Ingo

Hi @Ingo_Richtsmeier ,
Is there a way to update a businesskey value via REST API ?
I’ve looked into the rest api documentation but couldn’t find a suitable endpoint.

Thanks in advance

Rest API not available to set the business key.

You can try adding listener like below to set business key.

Hi @aravindhrs ,
Thanks for your feedback.
Perhaps, I should add more details about my use case.
I’m using the tasklist application. I have a simple process application with embedded forms. The business key is generated by using the cam-business-key directive. The requirement is that users enter it manually.
And of course, sometimes there are mistakes made to the value, despite the validation rules applied to the field.
I’m coming back with my question, is there a way to modify the business key, in a running process instance, if not via REST maybe a sql script?

One remark, I observed that in a copy/paste scenario, the cam-business-key value preserves white space on the value. Ng-model, on the other hand, doesn’t.

Thanks

Hey @roman.levinta,

for your use case you can provide the new value as a transient process variable in the form and use an execution listener on the end event to copy the value into the business key.

Hope this helps, Ingo