Updated on 2025-08-14 GMT+08:00

Starting a BPM Instance

Function

This API is used to create and start a BPM instance.

Before starting the BMP instance, ensure that BPM metadata is defined through GUI.

URI

POST Huawei Cloud Astro Zero domain name/u-route/baas/bp/v2.0/runtime/instances

Request Parameters

Table 1 Request parameters

Parameter

Mandatory

Type

Description

name

Yes

String

Explanation

BPM name. For details, see Logging In to the Application Designer. Go to the application designer and view the BPM name in the Process > Business Process list.

Constraints

None

Value

None

Default value

None

version

No

String

Explanation

BPM version. A BPM can have multiple versions. If this parameter is not specified, the current version is used. Obtain the version number by performing the following steps:

  1. Access the application designer by referring to Logging In to the Application Designer.
  2. Choose Process > Business Process, click of a BPM and select Detail.
  3. You can view the BPM version number in the Basic Information.

Constraints

None

Value

None

Default value

None

variables

No

Object

Explanation

Variables defined in BPM metadata, including custom variables and system variables. The variable is in key-value format, in which key indicates the variable name and value indicates the variable value. To set BPM variables before starting a BPM instance, you can specify this parameter. To set variables during startup, set the system variable $Flow.BusinessKey in variables. To set BPM title, you can set the system variable $Flow.Title.

Constraints

None

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.

result

Object

Explanation

If the request is successful, the running information about the BPM instance after being started will be returned.

Example Request

To create and start a BPM instance whose name is createCloudOK_NEW, version is 1.0.1, and four input parameters are contained, send the following request:
POST https://Huawei Cloud Astro Zero domain name/u-route/baas/bp/v2.0/runtime/instances
    
 {
    "name":"createCloudOK_NEW",
    "version":"1.0.1",
    "variables":{
        "name":"sun",
        "memorySize":"15",
        "storageSize":"15",
        "expiryDate":"2018-12-12"
    }
}

Example Response

{
    "resCode":"0",
    "resMsg":"Success",
    "result":{
        "name":"bpName1",
        "version":"1.0.1",
        "id":"002N000000Sy2NphoRbU",
        "processDefID":"001L000000S8Yi3xG9Gi",
        "interviewLabel":"BP Label 1",
        "nextElem":"subProcess",
        "isTest":true,
        "state":"Dispatched",
        "bpStatus":"New",
        "urgency":0,
        "taskOutcome":"",
        "businessKey":"002N000000Sy2NphoRbU",
        "startTime":"2019-08-27 10:53:04",
        "endTime":"",
        "Ext1":"",
        "Ext2":"",
        "Ext3":"",
        "Ext4":"",
        "Ext5":"",
        "Ext6":"",
        "Ext7":0,
        "Ext8":0,
        "suspended":false,
        "isClosed":false
    }
}

Status Code

See Status Codes.

Error Code

See Error Codes.