Skip to content

Query Workflow Review Information

Overview

This article will use the common "Leave Application" process as an example to introduce how to query workflow review information through script APIs. Through this example, you will understand how to obtain workflow review information outside of workflow forms.

Process Introduction

Detailed process configuration see Leave Process

Query

Process Example

Example

Query Method

js
const instanceList = informat.bpmn.queryInstanceList("Workflow Module Identifier", {
  pageIndex: 1,
  pageSize: 10,
  varList: [{ name: "form_recordId", value: "Workflow Binding Module Data Record ID" }],
});
let instance = null;
if (instanceList.length) {
  instance = instanceList[0];
}

if (instance) {
  const data = informat.bpmn.queryCommentList("Workflow Module Identifier", {
    pageIndex: 1,
    pageSize: 10,
    procInstId: instance.id,
  });
  console.log(data, "........");
}

Query Results

json
[
  {
    "createTime": 1744963207327,
    "id": "vb7ryvto4x7oi",
    "message": "{\"type\":\"doc\",\"content\":[{\"type\":\"paragraph\",\"content\":[{\"type\":\"text\",\"text\":\"Administrative Assistant Review Comments: Rejected, feeling jealous\"}]}]}",
    "procInstId": "fbecf59d-1c2a-11f0-85ef-36aaa8d4f244",
    "taskId": "10777194-1c2b-11f0-85ef-36aaa8d4f244",
    "type": "comment",
    "userId": "hujiayu2"
  },
  {
    "createTime": 1744963173281,
    "id": "sgqap0l42btfu",
    "message": "{\"type\":\"doc\",\"content\":[{\"type\":\"paragraph\",\"content\":[{\"type\":\"text\",\"text\":\"Supervisor Review Comments: Approved, wishing success\"}]}]}",
    "procInstId": "fbecf59d-1c2a-11f0-85ef-36aaa8d4f244",
    "taskId": "fbf3102c-1c2a-11f0-85ef-36aaa8d4f244",
    "type": "comment",
    "userId": "hujiayu2"
  }
]