分页查询用户的参与流程

  • SDK调用
MyWorkflowClient client = new MyWorkflowClient();
client.setUrl(URL+"/my");
QueryOptions options = new QueryOptions();
options.setPageSize(10);
options.setPageIndex(1);
Filter filter = new Filter();
//设置排序
options.setOrderBy("appCode desc");
options.setFilters(JSONObject.fromObject(filter,getJsonConfig()).toString());
List<Rule> rules = new ArrayList<Rule>();
Rule rule = new Rule();
rule.setField("data");
rule.setData("RS");
rule.setFieldType("str");
rule.setOp(Rule.OP_CN);
rules.add(rule);
filter.setRules(rules);
options.setFilters(JSONObject.fromObject(filter,getJsonConfig()).toString());
ResultEntity<ResultPage<List<WorkflowInstance>>> resultPageResultEntity = client.pageQueryInstance(options);
String result = JSONObject.fromObject(resultPageResultEntity,getJsonConfig()).toString();
System.out.println(result);
  • CURL 调用
curl -X GET "URL/my/pageQueryInstance?page_size=10&page=1&orderby=appCode desc&filters=%7b%22rules%22%3a%5b%7b%22data%22%3a%22RS%22%2c%22field%22%3a%22appType%22%2c%22type%22%3a%22str%22%2c%22op%22%3a%22cn%22%7d%5d%7d"

注:参数说明
1. page_size 页码大小
2. page 页码
3. orderby 排序字段
4. filters 查询参数(需要对url进行编码,编码之前的字符串为:{"rules":[{"data":"RS","field":"appType","fieldType":"str","op":"cn"}]})    
rules: 参数说明
data:  查询的值
field: 查询的字段,本查询方法提供以下查询字段
        status:流程实例状态 executing-执行中,end-结束 start-发起
        procName:流程实例名称
        receiveTime:接收时间,时间类型(yyyy-MM-dd HH:mm:ss)
        taskName:工作项名称
        taskText:工作项显示名称
        createUserName:拟稿人
        passUserName:发送人
        appType:流程应用类型
        appTypeName:流程应用类型名称
        appName:流程应用名称
        appCode 流程应用编码
        finishTime:处理(完成)时间,时间类型(yyyy-MM-dd HH:mm:ss)
        procId:流程实例id
    以上除特别说明,字段类型均为字符串。
fieldType: 查询字段类型(date,日期:str 日期,num 数值)
op:查询逻辑关系,提供以下关系cn-模糊查询(like),eq-等于(=),ne-不等于(!=),lt-小于(<),le-小于等于(<=) gt-大于(>),ge-大于等于(>=)


  • 响应示例
{
  "businessObject": {
    "datas": [
      {
        "appCode": "test-user1",
        "appName": "流程实例参与者测试",
        "beginTime": "2019-08-27 16:09:50",
        "businessDataId": "59244ff7f3dd4439982e5c2fdd015425",
        "createOrgId": "2dc9f805-f0df-42e7-b312-d7395da2018a",
        "createOrgName": "广州轨道交通建设监理有限公司财务部",
        "createUserId": "27b3f6ef-2647-4232-b064-3b5721e51dd5",
        "createUserName": "唐琪",
        "currentSeqId": 2,
        "currentTaskId": 2,
        "currentTaskNames": "传阅步骤",
        "currentTaskUsers": "",
        "currentWorkItem": null,
        "endTime": null,
        "extendedFieldOne": "",
        "extendedFieldThree": "",
        "extendedFieldTwo": "",
        "important": 0,
        "procId": "20190827000025",
        "procName": "0827test2",
        "secret": 0,
        "status": "executing",
        "workflowId": 0,
        "workflowVersion": ""
      },
      {
        "appCode": "08212",
        "appName": "子流程测试",
        "beginTime": "2019-08-27 14:13:51",
        "businessDataId": "119395861acf4096b83b1cf735242709",
        "createOrgId": "2dc9f805-f0df-42e7-b312-d7395da2018a",
        "createOrgName": "广州轨道交通建设监理有限公司财务部",
        "createUserId": "27b3f6ef-2647-4232-b064-3b5721e51dd5",
        "createUserName": "唐琪",
        "currentSeqId": 7,
        "currentTaskId": 7,
        "currentTaskNames": "审批步骤",
        "currentTaskUsers": "",
        "currentWorkItem": null,
        "endTime": "2019-08-27 16:06:02",
        "extendedFieldOne": "",
        "extendedFieldThree": "",
        "extendedFieldTwo": "",
        "important": 0,
        "procId": "20190827000014",
        "procName": "0827test2",
        "secret": 0,
        "status": "end",
        "workflowId": 0,
        "workflowVersion": ""
      },
      {
        "appCode": "08202",
        "appName": "test_ys2",
        "beginTime": "2019-08-26 17:51:02",
        "businessDataId": "be4b91b6a18c4f958fa29e79aaee654b",
        "createOrgId": "2dc9f805-f0df-42e7-b312-d7395da2018a",
        "createOrgName": "广州轨道交通建设监理有限公司财务部",
        "createUserId": "27b3f6ef-2647-4232-b064-3b5721e51dd5",
        "createUserName": "唐琪",
        "currentSeqId": 2,
        "currentTaskId": 1,
        "currentTaskNames": "会议通知",
        "currentTaskUsers": "",
        "currentWorkItem": null,
        "endTime": null,
        "extendedFieldOne": "",
        "extendedFieldThree": "",
        "extendedFieldTwo": "",
        "important": 0,
        "procId": "20190826000026",
        "procName": "0826test",
        "secret": 0,
        "status": "executing",
        "workflowId": 0,
        "workflowVersion": ""
      }
    ],
    "pageCount": 1,
    "pageIndex": 1,
    "pageSize": 10,
    "totalCount": 3
  },
  "message": "成功",
  "statusCode": 200,
  "success": true
}