Interface BPMQueryTaskClient

interface BPMQueryTaskClient {
    getComments: ((taskInsID, options?) => Dict);
    queryActiveList: ((cond?) => Dict);
    queryAttachments: ((taskInsID, options?) => Dict);
    queryByCondition: ((cond?) => Dict);
    queryClosedList: ((cond?) => Dict);
    queryClosedListWithMultipleRootID: ((cond?) => Dict);
    queryCompletedList: ((cond?) => Dict);
    queryList: ((cond?) => Dict);
    queryMyList: ((cond?) => Dict);
    queryMyListWithMultipleRootID: ((cond?) => Dict);
    queryMyListWithProcDefIDs: ((cond?) => MyListResult);
    querySuspendList: ((cond?) => Dict);
}

Properties

getComments: ((taskInsID, options?) => Dict)

获取BPM任务的评论,与bp.newTaskClient的getComments用法完全一样,只是多返回total值

Type declaration

    • (taskInsID, options?): Dict
    • Parameters

      • taskInsID: string

        任务实例ID

      • Optional options: OptionItem

        可选,可部分置空或全部置空

      Returns Dict

Example


import * as bp from 'bp'
let queryTaskClient = bp.newQueryTaskClient()
let res = taskClient.getComments("taskInsId")
console.log(res.recs) // 数组结果
console.log(res.total) // 统计数

Returns

返回相关的评论记录

queryActiveList: ((cond?) => Dict)

查询活跃状态的BPM任务列表,这里激活状态包括New/Dispatched/InProcess这三种任务状态,与bp.newTaskClient的queryActiveList用法完全一样,只是多返回total值

Type declaration

    • (cond?): Dict
    • Parameters

      • Optional cond: ActiveTaskCondition

        查询活跃状态任务的条件,可部分留空或全部留空

      Returns Dict

Example


import * as bp from 'bp'
let queryTaskClient = bp.newQueryTaskClient()
let res = queryTaskClient.queryActiveList({
owner: "002I000000VBjYt2OCYK",
rootID: "002N000000VBjj8I66gC",
options: {
fields: ["assignee", "assigneeID", "assigneeType", "assigneeName", "name", "state", "rootID", "owner"],
}
})
console.log(res.recs) // 数组结果
console.log(res.total) // 统计数

Returns

返回匹配的任务列表

queryAttachments: ((taskInsID, options?) => Dict)

查询BPM任务的文件附件信息记录,与bp.newTaskClient的queryAttachments用法完全一样,只是多返回total值

Type declaration

    • (taskInsID, options?): Dict
    • Parameters

      • taskInsID: string
      • Optional options: OptionItem

        可选,可部分置空或全部置空

      Returns Dict

Example

import * as bp from 'bp'
let queryTaskClient = bp.newQueryTaskClient()
let res = queryTaskClient.queryAttachments("002N000000VwBrSDISbQ", {
fields: ["taskID", "name", "fileName", "url"],
limit: 5,
})
console.log(res.recs) // 数组结果
console.log(res.total) // 统计数

Returns

查询到的文件附件信息记录

queryByCondition: ((cond?) => Dict)
  • 按照指定条件查BPM任务,与bp.newTaskClient的queryByCondition用法完全一样,只是多返回total值

Type declaration

Example

import * as bp from 'bp'
import * as db from 'db'
let queryTaskClient = bp.newQueryTaskClient()
let res = queryTaskClient.queryByCondition({
condition: {
conjunction: db.Conjunction.AND,
conditions: [
{
field: "createdDate",
operator: db.Operator.gt,
value: "2019-08-01 00:00:00"
}
]
},
options: {
fields: ["assignee", "assigneeID", "assigneeType", "assigneeName", "name"],
orderby: [
{
field: "assignee",
order: db.Order.desc
}
],
}
})
console.log(res.recs) // 数组结果
console.log(res.total) // 统计数

Returns

返回查询出的BPM任务的记录

queryClosedList: ((cond?) => Dict)

查询closed状态的bpm任务,与bp.newTaskClient的queryClosedList用法完全一样,只是多返回total值

Type declaration

    • (cond?): Dict
    • Parameters

      • Optional cond: QueryCondition

        查询条件,可以全部为空或部分为空

      Returns Dict

Example


import * as bp from 'bp'
let queryTaskClient = bp.newQueryTaskClient()
let res = queryTaskClient.queryClosedList({
creator: "002I000000VBjYt2OCYK",
owner: "002I000000VBjYt2OCYK"
})
console.log(res.recs) // 数组结果
console.log(res.total) // 统计数

Returns

查询返回的任务列表

queryClosedListWithMultipleRootID: ((cond?) => Dict)

查询closed状态的bpm任务,支持同时查询多个rootID

Type declaration

Example


import * as bp from 'bp'
let queryTaskClient = bp.queryTaskClient()
let res = queryTaskClient.queryClosedListWithMultipleRootID({
creator: "002I000000VBjYt2OCYK",
owner: "002I000000VBjYt2OCYK",
rootIDList: ["002N000000VBjj8I66gC","002N000000VBjj8I66gD","002N000000VBjj8I66gE"]
})
console.log(res.recs) // 数组结果
console.log(res.total) // 统计数

Returns

查询返回的任务列表

queryCompletedList: ((cond?) => Dict)

查询completed状态的bpm任务,与bp.newTaskClient的queryCompletedList用法完全一样,只是多返回total值

Type declaration

    • (cond?): Dict
    • Parameters

      • Optional cond: QueryCondition

        查询条件,可以全部为空或部分为空

      Returns Dict

Example


import * as bp from 'bp'
let queryTaskClient = bp.newQueryTaskClient()
let res = queryTaskClient.queryCompletedList({
creator: "002I000000VBjYt2OCYK",
owner: "002I000000VBjYt2OCYK"
})
console.log(res.recs) // 数组结果
console.log(res.total) // 统计数

Returns

查询返回的任务列表

queryList: ((cond?) => Dict)

按照指定条件查询BPM任务列表,与bp.newTaskClient的queryList用法完全一样,只是多返回total值

Type declaration

Example


import * as bp from 'bp'
let queryTaskClient = bp.newQueryTaskClient()
let res = queryTaskClient.queryList({
rootID: "002N000000VBk5qqWi1I",
states: [bp.State.Terminated, bp.State.New],
procInsID: "xxxxxxxxxxxxxxxxxx",
})
console.log(res.recs) // 数组结果
console.log(res.total) // 统计数

Returns

查询返回的任务列表

queryMyList: ((cond?) => Dict)

查询属主是调用者本人的BPM任务列表,与bp.newTaskClient的queryMyList用法完全一样,只是多返回total值

Type declaration

    • (cond?): Dict
    • Parameters

      • Optional cond: MyTaskCondition

        查询自己BPM任务的条件,可部分留空或全部留空

      Returns Dict

Example


import * as bp from 'bp'
let queryTaskClient = bp.newQueryTaskClient()
let res = queryTaskClient.queryMyLis({
instID: "002N000000VwBrSDISbQ",
rootID: "002N000000VBjj8I66gC",
options: {
fields: ["assignee", "assigneeID", "assigneeType", "assigneeName", "name", "state", "rootID", "owner"],
}
})
console.log(res.recs) // 数组结果
console.log(res.total) // 统计数

Returns

返回匹配的任务列表

queryMyListWithMultipleRootID: ((cond?) => Dict)

查询属主是调用者本人的BPM任务列表和总数,支持同时查询多个rootID

Type declaration

    • (cond?): Dict
    • Parameters

      • Optional cond: MyTaskRootIDListCondition

        查询自己BPM任务的条件,支持同时查询多个rootID留空,可部分留空或全部留空

      Returns Dict

Example


import * as bp from 'bp'
let queryTaskClient = bp.newQueryTaskClient()
let tasks = queryTaskClient.queryMyListWithMultipleRootID({
rootIDList: ["002N000000VBjj8I66gC","002N000000VBjj8I66gD","002N000000VBjj8I66gE"]
options: {
fields: ["assignee", "assigneeID", "assigneeType", "assigneeName", "name", "state", "rootID", "owner"],
}
})
console.log(tasks)

Returns

返回匹配的任务列表和符合条件的统计数量,limit限制5000条

queryMyListWithProcDefIDs: ((cond?) => MyListResult)

查询属主是调用者本人的BPM任务列表和总数,支持同时查询多个流程定义 ID

Type declaration

Example

import * as bp from 'bp'
let queryTaskClient = bp.newQueryTaskClient()
let tasks = queryTaskClient.queryMyListWithProcDefIDs({
processDefIDList: ["003i000000kmKb3rA8X2"],
options: {
fields: ["assignee", "assigneeID", "assigneeType", "assigneeName", "name", "state", "rootID", "owner"],
}
})
console.log(tasks)

Returns

返回匹配的任务列表和符合条件的统计数量,单次查询限制5000条

querySuspendList: ((cond?) => Dict)

查询suspended状态的bpm任务,与bp.newTaskClient的querySuspendList用法完全一样,只是多返回total值

Type declaration

    • (cond?): Dict
    • Parameters

      • Optional cond: QueryCondition

        查询条件,可以全部为空或部分为空

      Returns Dict

Example


import * as bp from 'bp'
let queryTaskClient = bp.newQueryTaskClient()
let res = queryTaskClient.querySuspendList({
creator: "002I000000VBjYt2OCYK",
owner: "002I000000VBjYt2OCYK"
})
console.log(res.recs) // 数组结果
console.log(res.total) // 统计数

Returns

查询返回的任务列表