跳转至

节点监控(NodeMonitorController)

节点监控(后台管理视角)接口:节点列表查询(分页+多条件过滤,按审批人/处理时间/摘要等过滤)。是流程监控页面「节点视图」的查询入口。

  • 接口类型:REST 资源(@Controller未继承 AbstractRuntimeController——控制器自带 getUser()request;方法返回 ResponseEntity<?>body 由服务层 INodeMonitorService.getNodeList(...) 提供(结构由服务层决定,通常为 Resource 或分页 JSON),由 Spring Jackson 序列化为 JSON。实际接口类型按返回类型判定为 REST 资源,而非 HTML 页面视图,据源码;方法级显式 produces="application/json;charset=utf-8"
  • 基址${myapps.context-path.runtime:}/api/runtime/{applicationId}/monitors/workflows
  • Tag:节点监控模块

公共说明

  • 鉴权(据源码):类级基址位于 /api/runtime/**,在 RestSecurityHandlerInterceptor 覆盖范围内,且不在豁免名单(豁免仅覆盖 /api/runtime/login.*/api/runtime/dingding/authlogin/api/runtime/synchronization.* 等,详见 login.md「公共说明 · 鉴权」)。拦截器走 Security.getUserIdFromToken(request),未取到再尝试 Security.getDebugUserIdFromToken(request),两者皆无则拒绝。故需 accessToken(或 debugToken),可通过 Cookie / 请求头 / query 参数任一方式传递。控制器内 getUser()(通过 AuthTimeServiceManager.getWebUser(request) 获取)必须能取到非空 WebUser,否则在 DesUtil.decryptTextByUserId(applicationId, getUser().getId()) 时即抛 NPE。
  • 路径变量 {applicationId}:必填,经 DES 加密(按当前执行用户密钥),服务端在方法入口处 DesUtil.decryptTextByUserId(applicationId, getUser().getId()) 解密。
  • 响应结构ResponseEntity<?>body 由服务层 INodeMonitorService.getNodeList(applicationId, json) 返回(结构由服务层决定)。失败统一返回 new Resource(500,"server innernal error") + HttpStatus.INTERNAL_SERVER_ERROR
  • HTTP 状态码:无方法级 @ResponseStatus 声明,成功走 ResponseEntity.ok(...)(HTTP 200);失败时显式返回 HttpStatus.INTERNAL_SERVER_ERROR
  • content-type:方法级 produces = "application/json;charset=utf-8",强制 UTF-8 编码 JSON 响应。

1. 获取节点列表

按企业域、流程名、状态、审批人、处理时间区间、摘要、流程分类索引等多条件分页查询节点列表(监控视角)。

  • 接口类型:REST 资源
  • 请求方式GET
  • 请求路径/nodes(完整:{runtime-context}/api/runtime/{applicationId}/monitors/workflows/nodes
  • 鉴权:是(需 accessToken,据源码)
  • Tag:节点监控模块

请求参数

参数名 位置 类型 必填 说明
applicationId path string 应用Id(DES 加密密文)
domainId query string 企业域Id
_currpage query string 当前页
_pagelines query string 每页显示条数
_orderby query string 排序字段,默认空
_flowName query string 流程名称,默认空
_status query string 节点状态
_flowIndex query string 流程分类索引
_auditor query string 审批人Id,默认空
_actionTimeBegin query string 处理时间起(含),默认空
_actionTimeEnd query string 处理时间止(含),默认空
_summary query string 摘要关键字,默认空

请求示例

GET /api/runtime/__APPID__/monitors/workflows/nodes?domainId=__DOMAINID__&_currpage=1&_pagelines=20&_status=running&_flowIndex=0&_auditor=__USERID__ HTTP/1.1
Cookie: accessToken=eyJhbGciOiJIUzI1NiJ9...

响应

结构ResponseEntity<?>body 由服务层 INodeMonitorService.getNodeList(applicationId, json) 返回(结构由服务层决定,通常为分页 JSON:含 datas/pageCount/rowCount 等)。

成功示例

{
  "errcode": 0,
  "errmsg": "ok",
  "data": {
    "datas": [
      {
        "instanceId": "__INSTANCEID__",
        "flowName": "请假流程",
        "nodeName": "部门经理审批",
        "auditorName": "张三",
        "status": "running"
      }
    ],
    "pageCount": 3,
    "rowCount": 50
  },
  "errors": null
}

失败示例(HTTP 500):

{ "errcode": 500, "errmsg": "server innernal error", "data": null, "errors": null }

说明:源码文案为 "server innernal error"(含拼写错误,与 FlowMonitorControllerFlowStatisticsController 一致),据源码如实记录。