Update of a process' attribute using REST API returns Java exception

following the instructions in par. 5.2.57 of the WebService manual, I’m trying to update a boolean attribute in a process, using the REST API (using PUT method of the http://hostname:port/cmdbuild/services/rest/v3/processes/processId/instances), but the response is always HTTP/500 and I find the following exception:

Caused by: java.lang.NullPointerException: must set ‘activity’ param
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:895) ~[closure-compiler-v20200112.jar:na]
at org.cmdbuild.utils.lang.CmPreconditions.checkNotBlank(CmPreconditions.java:73) ~[cmdbuild-utils-lang-3.2.1-d.jar:na]
at org.cmdbuild.service.rest.v3.endpoint.ProcessInstancesWs.update(ProcessInstancesWs.java:97) ~[cmdbuild-services-rest-v3-3.2.1-d.jar:na]

What is that ‘activity’ parameter to set?

The JSON data passed in the request is only the attribute to be modified: {“docSigned”: true}, i.e. leaving out all the other attributes in the process.
In the manual, I don’t find any reference to an “activity” parameter to set.


1 Like

Hi there,
Have you found any solution?

Hi, after several trials, I found that the missing parameter is named “_activity”, its value is the activity identifier assigned to the current task of the process instance where you want to set the attribute.

var data = {};
data[“docSigned”] = true;
data["_activity"] = activityId;

For sure, the documentation is incomplete related to this topic and doesn’t help very much.


1 Like