Interface BatchClient

interface BatchClient {
    batchCancelProcess: ((syncCommit, input) => BatchOutputCommon);
    batchCompleteTask: ((syncCommit, input) => BatchOutputCommon);
    batchDelegateTask: ((syncCommit, input) => BatchOutputCommon);
    batchRevokeProcessTask: ((syncCommit, input) => BatchOutputCommon);
    batchRollbackProcessTask: ((syncCommit, input) => BatchOutputCommon);
    batchStartProcess: ((syncCommit, input) => BatchOutputCommon);
    batchTransferTask: ((syncCommit, input) => BatchOutputCommon);
}

Properties

batchCancelProcess: ((syncCommit, input) => BatchOutputCommon)

批量取消流程

Type declaration

    • (syncCommit, input): BatchOutputCommon
    • Parameters

      • syncCommit: boolean

        默认值为true,表示所有成功或者或者失败,为false时表示出错后继续执行后续启动流程

      • input: Dict[]

        流程取消参数数组,用于批量取消流程

      Returns BatchOutputCommon

Example


import * as bp from 'bp'
let batchClient = bp.newBatchClient()
let batchOutput = batchClient.batchCancelProcess(
syncCommit: true,
input: [ {
"processInsID": "002N000000uKGAT6ZXM0",
"reason": "cancel process",
},
{
"processInsID": "002N000000uKGATFehW4",
"reason": "cancel process",
}])
console.log(batchOutput)

Returns

返回取消成功的流程的基本信息,以及取消失败的流程的错误信息

batchCompleteTask: ((syncCommit, input) => BatchOutputCommon)

批量完成任务

Type declaration

    • (syncCommit, input): BatchOutputCommon
    • Parameters

      • syncCommit: boolean

        默认值为true,表示所有成功或者或者�����败,为false时表示出错后继续执行后续启动流程

      • input: Dict[]

        任务完成参数数组,用于批量任务完成

      Returns BatchOutputCommon

Example


import * as bp from 'bp'
let batchClient = bp.newBatchClient()
let batchOutput = batchClient.batchCompleteTask(
syncCommit: true,
input: [ {
"taskInsId":"002q000000uAMQutQXtA",
"action": "complete this task",
"variables": {}
},
{
"taskInsId":"002q000000uAMQv0o7Gq",
"action": "complete this task",
"variables": {}
}])
console.log(batchOutput)

Returns

返回完成的task的基本信息,以及完成失败的流程的错误信息

batchDelegateTask: ((syncCommit, input) => BatchOutputCommon)

批量委派

Type declaration

    • (syncCommit, input): BatchOutputCommon
    • Parameters

      • syncCommit: boolean

        默认值为true,表示所有成功或者或者失败,为false时表示出错后继续执行后续启动流程

      • input: Dict[]

        任务委派参数数组,用于批量任务委派

      Returns BatchOutputCommon

Example


import * as bp from 'bp'
let batchClient = bp.newBatchClient()
let batchOutput = batchClient.batchDelegateTask(
syncCommit: true,
input: [ {
"taskInsId":"002q000000uAMQutQXtA",
"assignee": "user:zhangshan",
"reason": "delegate task to assignee",
},
{
"taskInsId":"002q000000uAMQv0o7Gq",
"assignee": "user:lisi",
"reason": "delegate task to assignee",
}])
console.log(batchOutput)

Returns

返回委派的task的基本信息,以及委派失败的流程的错误信息

batchRevokeProcessTask: ((syncCommit, input) => BatchOutputCommon)

批量撤回

Type declaration

    • (syncCommit, input): BatchOutputCommon
    • Parameters

      • syncCommit: boolean

        默认值为true,表示所有成功或者或者失败,为false时表示出错后继续执行后续启动流程

      • input: Dict[]

        流程撤回参数数组,用于批量撤回流程的task

      Returns BatchOutputCommon

Example


import * as bp from 'bp'
let batchClient = bp.newBatchClient()
let batchOutput = batchClient.batchRevokeProcessTask(
syncCommit: true,
input: [ {
"taskInsId":"002q000000uAMQutQXtA",
"processInsID": "002N000000uKGAT6ZXM0",
"allowClose": true,
"allowCreate": true
},
{
"taskInsId":"002q000000uAMQv0o7Gq",
"processInsID": "002N000000uKGATFehW4",
"allowClose": true,
"allowCreate": true
}])
console.log(batchOutput)

Returns

返回撤回成功的流程的基本信息,以及撤回失败的流程的错误信息

batchRollbackProcessTask: ((syncCommit, input) => BatchOutputCommon)

批量打回

Type declaration

    • (syncCommit, input): BatchOutputCommon
    • Parameters

      • syncCommit: boolean

        默认值为true,表示所有成功或者或者失败,为false时表示出错后继续执行后续启动流程

      • input: Dict[]

        流程撤回参数数组,用于批量撤回流程的task

      Returns BatchOutputCommon

Example


import * as bp from 'bp'
let batchClient = bp.newBatchClient()
let batchOutput = batchClient.batchRollbackProcessTask(
syncCommit: true,
input: [ {
"taskInsId":"002q000000uAMQutQXtA",
"processInsID": "002N000000uKGAT6ZXM0",
"allowClose": true,
"allowCreate": true
},
{
"taskInsId":"002q000000uAMQv0o7Gq",
"processInsID": "002N000000uKGATFehW4",
"allowClose": true,
"allowCreate": true
}])
console.log(batchOutput)

Returns

返回撤回成功的流程的基本信息,以及撤回失败的流程的错误信息

batchStartProcess: ((syncCommit, input) => BatchOutputCommon)

批量启动流程

Type declaration

    • (syncCommit, input): BatchOutputCommon
    • Parameters

      • syncCommit: boolean

        默认值为true,表示所有成功或者或者失败,为false时表示出错后继续执行后续启动流程

      • input: Dict[]

        流程启动参数数组,用于批量启动流程

      Returns BatchOutputCommon

Example


import * as bp from 'bp'
let batchClient = bp.newBatchClient()
let batchOutput = batchClient.batchStartProcess(
syncCommit: true,
input: [ {
"name": "AutoTest1640426626697965_168",
"version": "1.0.1",
"variables": {}
},
{
"name": "AutoTest1640426678948802_168",
"version": "1.0.1",
"variables": {}
}])
console.log(batchOutput)

Returns

返回启动成功的流程的基本信息,以及启动失败的流程的错误信息

batchTransferTask: ((syncCommit, input) => BatchOutputCommon)

批量委派

Type declaration

    • (syncCommit, input): BatchOutputCommon
    • Parameters

      • syncCommit: boolean

        默认值为true,表示所有成功或者或者失败,为false时表示出错后继续执行后续启动流程

      • input: Dict[]

        任务转派参数数组,用于批量任务转派

      Returns BatchOutputCommon

Example


import * as bp from 'bp'
let batchClient = bp.newBatchClient()
let batchOutput = batchClient.batchTransferTask(
syncCommit: true,
input: [ {
"taskInsId":"002q000000uAMQutQXtA",
"assignee": "user:zhangshan",
"reason": "delegate task to assignee",
},
{
"taskInsId":"002q000000uAMQv0o7Gq",
"assignee": "user:lisi",
"reason": "delegate task to assignee",
}])
console.log(batchOutput)

Returns

返回转派的task的基本信息,以及转派失败的流程的错误信息