Get Process Instance

Get the details of a process instance.

Request Format

GET https://{apigw-address}/enos-bpm-service/v2.0/work/process-instances

Request Parameters (Header)

Name

Location

Mandatory/Optional

Data Type

Description

Authorization

Header

Mandatory

String

The access token, which is represented by the bearer token. It can be obtained by invoking the Log In or Refresh Access Token API.

Request Parameters (URI)

Name

Location (Path/Query)

Mandatory/Optional

Data Type

Description

processInstanceId

Query

Mandatory

String

The process instance ID.

Response Parameters

Name

Data Type

Description

data

Data Struct

The details of the process instance.

Data Struct

Name

Data Type

Description

id

String

The process instance ID.

name

String

The process name.

businessKey

String

The key of the process instance.

processDefinitionId

String

The process definition ID.

processDefinitionName

String

The process definition name.

processDefinitionDescription

String

The process definition description.

processDefinitionKey

String

The process definition key.

processDefinitionCategory

String

The process definition type.

processDefinitionVersion

Integer

The process definition version number.

processDefinitionDeploymentId

String

The deployment resource ID corresponding to the process definition.

graphicalNotationDefined

Boolean

Whether to define the process icon.

startFormDefined

Boolean

Whether to define the process start form.

tenantId

String

The organization ID.

createdTime

Timestamp

The creation time of the process instance.

completedTime

Timestamp

The end time of the process instance.

terminable

Boolean

Whether the current process can be terminated by the current user.

terminatedTime

Timestamp

The termination time of the process instance.

terminateReason

String

The reason for terminating the process instance.

startedBy

UserRepresentation Struct

Information about the process starter.

terminatedBy

UserRepresentation Struct

Information about the process terminator.

assignee

UserRepresentation Struct

Information about the current task assignee.

taskName

String

The name of the current task.

url

String

The URL of the process details in the BPM application.

UserRepresentation Struct

Name

Data Type

Description

id

String

The user ID.

firstName

String

The user’s first name.

lastName

String

The user’s last name.

email

String

The user’s email.

fullName

String

The user’s full name.

tenantId

String

The organization ID.

groups

UserRepresentation Struct Array

The user group.

privileges

String array

The user permissions.

GroupRepresentation Struct

Name

Data Type

Description

id

String

The user group ID.

name

String

The user group name.

type

String

The user group type.

Error Codes

Code

Description

33404

The process instance ID does not exist or you do not have the permission to view it.

Samples

Request Sample

url: https://{apigw-address}/enos-bpm-service/v2.0/work/process-instances?processInstanceId={your_process_instance_id}

method: GET

headers: {"Authorization":"Bearer {your_access_token}"}

Return Sample

{
  "code": 0,
  "msg": "",
  "data": {
        "id": "2e0130f7-e39a-11ea-b667-e2b39eaec113",
        "name": "0821终止",
        "businessKey": "a2e00e2d6e39a11eab667e2b39eaec113",
        "processDefinitionId": "5abd9f71-e365-11ea-8a6b-be43f0d99bcd",
        "tenantId": "o15874765326651",
        "started": 1598006192452,
        "ended": null,
        "startedBy": {
          "id": "u15935734241501",
          "firstName": null,
          "lastName": null,
          "email": "john.smith@envision-digital.com",
          "fullName": "john.smith",
          "tenantId": "o15874765326651",
          "groups": [],
          "privileges": []
        },
        "processDefinitionName": "0821终止",
        "processDefinitionDescription": null,
        "processDefinitionKey": "ad970b963e35511ea8a6bbe43f0d99bcd",
        "processDefinitionCategory": "http://flowable.org/test",
        "processDefinitionVersion": 3,
        "processDefinitionDeploymentId": "5a9be69e-e365-11ea-8a6b-be43f0d99bcd",
        "graphicalNotationDefined": true,
        "startFormDefined": true,
        "assignee": null,
        "taskName": null,
        "url": null,
        "terminable": false,
        "terminatedBy": {
          "id": "u15935734241501",
          "firstName": null,
          "lastName": null,
          "email": "john.smith@envision-digital.com",
          "fullName": "john.smith",
          "tenantId": "o15874765326651",
          "groups": [],
          "privileges": []
        },
        "terminateReason": "终止原因",
        "variables": [],
        "terminatedTime": 1598006269443,
        "processInstanceId": "2e0130f7-e39a-11ea-b667-e2b39eaec113",
        "completedTime": null,
        "processName": "0821终止",
        "createdTime": 1598006192452,
        "processStatus": "terminated"
  }
}

Java SDK Sample

public class BpmSdkTest{
    @Test
    public void getProcessInstanceTest() {
        String bearerToken = "your_bearer_token";
        String processInstanceId = "process_instance_id";
        ProcessInstanceGetRequest request = new ProcessInstanceGetRequest(processInstanceId, bearerToken);
        ProcessInstanceGetResponse response = Poseidon.config(PConfig.init().appKey("your_access_key")
        .appSecret("your_secret_key").debug()).url("https://{apigw-address}")
        .getResponse(request, ProcessInstanceGetResponse.class);
        assertNotNull("response cannot be null", response);
    }
}