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

Querying a BPM Instance

Function

This API is used to query the BPM instance information of the current account.

URI

GET Huawei Cloud Astro Zero domain name/u-route/baas/bp/v2.0/runtime/instances?states={X}

Table 1 URI parameters

Parameter

Mandatory

Type

Description

states

Yes

String

Explanation

BPM instance status.

Constraints

None

Value

  • New
  • Running
  • Waiting for user interaction
  • Waiting for page event
  • Completed OK
  • Paused
  • Broken
  • Suspended
  • User Terminated
  • Terminated
  • Dispatched
  • CompletedOkWait

Default value

None

Request Parameters

Table 2 Request parameters

Parameter

Mandatory

Type

Description

fields

No

String

Explanation

Fields to be queried. Separate multiple field names with commas (,). If no field is specified, the default field is returned.

Constraints

None

Value

None

Default value

None

orderField

No

String

Explanation

Field names used for sorting.

Constraints

None

Value

None

Default value

None

orderType

No

String

Explanation

Sorting type.

Constraints

None

Value

  • asc: The query results are displayed in ascending order.
  • desc: The query results are displayed in the descending order.

Default value

None

Response Parameters

Table 3 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, a list of BPM instances that meet the search criteria is returned.

Example Request

To query a BPM instance list, send the following request:
GET https://Huawei Cloud Astro Zero domain name/u-route/baas/bp/v2.0/runtime/instances?states=Completed OK&orderField=title&orderType=asc

Example Response

{
    "resCode":"0",
    "resMsg":"Success",
    "result":[
        {
            "bpStage":"Stage 1",
            "bpStatus":"begin",
            "bpStep":"Transfer 1",
            "businessKey":"BK001",
            "createdBy":"10gd0000003T2E10UTfk",
            "createdBy.__objectType":"User",
            "createdBy.name":"ecommerce",
            "createdDate":"2018-08-13 16:21:17",
            "curElement":"",
            "description":"Transfer 1",
            "endTime":"2018-08-17 14:40:09",
            "id":"002N000000IpNGFfNvm4",
            "label":"TestFSM2 2018-08-13 16:21:17",
            "lastHandler":null,
            "lastModifiedBy":"10gd0000003T2E10UTfk",
            "lastModifiedBy.__objectType":"User",
            "lastModifiedBy.name":"ecommerce",
            "lastModifiedDate":"2018-08-17 14:40:09",
            "name":"TestFSM2",
            "owner":"10gd0000003T2E10UTfk",
            "owner.__objectType":"User",
            "owner.name":"ecommerce",
            "startTime":"2018-08-13 16:21:17",
            "state":"Completed OK",
            "suspended":false,
            "title":"Hello, this is a title",
            "type":"BP",
            "urgency":0,
            "version":"0.0.1"
        }
    ]
}

Status Code

See Status Codes.

Error Code

See Error Codes.