Help Center/ Huawei Cloud Astro Zero/ API Reference/ APIs/ BPMs/ Setting or Modifying the Values of Variables in a BPM Instance
Updated on 2025-08-14 GMT+08:00

Setting or Modifying the Values of Variables in a BPM Instance

Function

Modify variable values in a BPM instance, allowing updates to single, multiple, or all variables simultaneously. Nonexistent or read-only variables are ignored. A request parameter is in the key-value format, in which key indicates the variable name and value indicates the variable value.

URI

PUT Huawei Cloud Astro Zero domain name/u-route/baas/bp/v2.0/runtime/instances/{instance_id}/variables

Table 1 URI parameters

Parameter

Mandatory

Type

Description

instance_id

Yes

String

Explanation

ID of a BPM instance, which can be obtained by calling the API of Querying a BPM Instance (id in the response message).

Constraints

None

Value

None

Default value

None

Request Parameters

A request parameter is in the key-value format, in which key indicates the variable name and value indicates the variable value.

There is no fixed request parameter. All parameters are customized by developers. For details about the structure packet, see "Example Request."

Response Parameters

Table 2 Response parameters

Parameter

Type

Description

resCode

String

Explanation

Return code.

Value

If the request is successful, 0 is returned. For details about other error codes, see Error Codes.

resMsg

String

Explanation

Message returned.

Value

If the request is successful, "Success" is returned. In other cases, an error message is returned.

Example Request

To change the value of custom field cpuNumber to 1 and that of custVar1 to value1 for the BPM instance whose ID is 002N000000Q3QW4IMAOO, send the following request:
PUT https://Huawei Cloud Astro Zero domain name/u-route/baas/bp/v2.0/runtime/instances/002N000000Q3QW4IMAOO/variables
    
{
    "cpuNumber":1,
    "custVar1":"value1"
}

Example Response

{
    "resCode":"0",
    "resMsg":"Success"
}

Status Code

See Status Codes.

Error Code

See Error Codes.