REST interface for BPD-related resources - Process Instance All Variables (bulk update) Resource - PUT Method

Use this method to update the values of multiple variables in a process or subprocess or event subprocess or linked process instance. Only admin users can run this method.

Sample method invocation

PUT /rest/bpm/wle/v1/process/{instanceId}/allVariables[?serverId={string}]

Parameters

Optional parameters
NameValue TypeDescription
serverId string
The workflow server in which to perform the action. Perform the action on the workflow center if not specified.

Request content

The variable value in JSON format. For example:

For subprocess or event subprocess: {"variables":{"variable_name":"variable_value"},"contexts":{"activity_task_flow_object_id":{"processId":"25.subprocess_id","variables":["variable_name"]}}}.
Note: The activity_task_flow_object_id is the flowObjectId of the activity task that is a subprocess or event subproces type. The ids (flowObjectId and subProcessId) can be retrieved by using the REST API /rest/bpm/wle/v1/process/{instanceId}?parts=executionTree.

For linked subprocess: {"variables":{"variable_name":"variable_value"},"contexts":{"activity_task_flow_object_id":{"processId":"25.linked_process_id","variables":["variable_name"]}}}.
Note: The activity_task_flow_object_id is the flowObjectId of the activity task that is a linked process type. The linked_process_id is the processId of the linked process. The ids (flowObjectId and processId) can be retrieved by using the REST API /rest/bpm/wle/v1/process/{instanceId}?parts=executionTree.

The default content type is application/json.

MIME type: application/json


Schema
{  "description": "The variables in JSON format as a set of key-value pairs",
   "type": "object"
}
Example content
{
	"variables":{
		"variable_name":"variable_value"
		},
		"contexts":{
			"activity_ID_implemented_subprocess":{
				"processId":"25.activity_ID_implemented_subprocess",
				"variables":["variable_name"]
				}
		}
}

MIME type: application/xml

Response content

The execution status of the REST API.

The default content type is application/json.

MIME type: application/json


Schema
{
	"description": "The execution status of the REST API",
	"type": "object",
	"properties": {
		"status": "200",
		"data": {
			"type": Object,
			"properties": {
				"message": {
					"type": "string",
					"description": "Indicates that the API has been sucessfully completed."
				}
			}
		}
	}
}
Example content
{
   "status": "200",
   "data":    {
      "message": "Successfully updated."
   }
}

Error Response content

Detailed error information.

The default content type is application/json.

MIME type: application/json


Schema
{  "description": "WLE Error Response", 
   "type": "object",
   "properties":
   {  "status": {"type": "string",
         "description": "The status of the previous API call."
      },
      "exceptionType": {"type": "string",
         "description": "The classname associated with the exception."
      },
      "errorNumber": {"type": "string",
         "description": "Message ID of the exception."
      },
      "errorMessage": {"type": "string",
         "description": "Message text of the exception."
      },
      "errorMessageParameters": {"type": ["string"], "optional": true,
         "description":"Message text parameters of the exception."
      },
      "programmersDetails": {"type": "object", "optional": true,
         "description":"Additional exception details, for example, a stack trace."
      }
   }
} 

MIME type: application/xml


Schema
<?xml version="1.0" encoding="UTF-8"?>
<schema targetNamespace="http://rest.bpm.ibm.com/v1/data/exception"
	elementFormDefault="unqualified" xmlns="http://www.w3.org/2001/XMLSchema"
	xmlns:tns="http://rest.bpm.ibm.com/v1/data/exception"
	xmlns:dat="http://rest.bpm.ibm.com/v1/data/root">

    <import schemaLocation="BPMRestData.xsd" namespace="http://rest.bpm.ibm.com/v1/data/root" />
    
    <!--
	This type represents an error response.
    -->    
    <element name="RestRuntimeException">
	<complexType>
	    <sequence>
		<element name="status" type="string"/>
		<element name="Data" type="tns:ExceptionData">
    		</element>
	    </sequence>
	</complexType>
    </element>

    <!-- 
	 This type contains detailed error information associated with an exception.
    -->
    <complexType name="ExceptionData">
	<sequence>
	    <element name="status" type="string"/>

	    <!-- This specifies the java class name of the exception -->
	    <element name="exceptionType" type="string"/>

	    <!-- The message ID of the error message -->
	    <element name="errorNumber" type="string" minOccurs="0"/>

	    <!-- The complete error message -->
	    <element name="errorMessage" type="string"/>

	    <!-- The list of strings inserted into the error message -->
	    <element name="errorMessageParameters" type="string" minOccurs="0" maxOccurs="unbounded"/>

	    <!-- 
		 The stacktrace associated with the exception.
		 Note that this will be omitted unless the "server-stacktrace-enabled" property
		 is enabled in the server's 100Custom.xml file.
	    -->     
	    <element name="programmersDetails" type="string"></element>
	    
	    <!-- Prior responses.  Set if a bulk command was used -->
	    <element name="responses" type="dat:BulkCommandResponses" minOccurs="0"></element>

            <element name="errorData" type="tns:ErrorData" minOccurs="0" />
	</sequence>
    </complexType>

    <complexType name="ErrorData">
        <sequence>
            <element name="code" type="string" />
            <element name="data" type="string" minOccurs="0" />
        </sequence>
    </complexType>
    
</schema>

MIME type: application/x-javascript

Status codes

The method returns one of the following status codes:
CodeDescription
200 OK
The request was successfully completed.
400 Bad Request
The instanceId parameter is missing or not valid, or the body of the request is not a JSON object or does not comply to the schema of the business object.
401 Unauthorized
The caller is not authorized for this request.
404 Not Found
The instanceId does not exist on server.
406 Not AcceptableThe requested content type or content encoding is not supported.
409 Conflict
The status of the business process definition (BPD) instance is not Active, Suspended or Failed. You can use this API only to update variables of an active, suspended, or failed BPD instance.
415 Unsupported Media TypeThe content type or content encoding of the request is not supported.
500 Internal Server Error
A severe problem has occurred.

Available since

8.6.0.0 CF2017.12

Parent Topic: Process Instance All Variables (bulk update) Resource