import * as bp from 'bp'
let client = bp.newClientV1()
let res=client.activateFSM("id");
return compile result
get active tasks
import * as bp from 'bp'
let client = bp.newClientV1()
let res=client.activeTask("iid");
active tasks
add history record of BP to db
bp interview id
message
import {addHistory} bp from 'bp';
addHistory("iid","message");
inserted record id
complete current task(fill page/screen and commit) and continue the BP instance
import {complete} bp from 'bp';
let client = bp.newClientV1()
let res=client.complete("bpId","inputData");
result
continue to complete current task
import {continue} bp from 'bp';
let client = bp.newClientV1()
let res=client.continue("bpId","inputData");
result
create a new FSM in BP
import * as bp from 'bp'
let client = bp.newClientV1()
let fsm = client.createFSM("data");
if create fsm, only return record id
deactivate one FSM in BP
record id
import * as bp from 'bp'
let client = bp.newClientV1()
let fsm = client.createFSM("data");
fsm.deactivateFSM("fsmId");
delegate task to another user or queue to process
bp interview id
import * as bp from 'bp'
let client = bp.newClientV1()
client.delegate("002N000000VwBrSDISbQ","user","resons")
delete one bp record
record id
import {delete} from 'bp'
let res=delete("002N000000VwBrSDISbQ");
deleted number
delete flow instance and related resource
delete reason
import {deleteInstance} from 'bp'
let client = bp.newClientV1()
client.deleteInstance("flowId","Unnecessary flow");
add one fsm sla
import {fsmAddSLA} from 'bp'
let res =fsmAddSLA("id","data"); // 返回null代表成功,失败的话会抛出错误信息
compile result
add one fsm step
import {fsmAddStep} from 'bp'
fsm.fsmAddStep("stepId","stepData"); // 返回null代表成功,失败的话会抛出错误信息
compile result
add one fsm var
import {fsmAddVar} from 'bp'
fsm.fsmAddVar("varId","varData"); // 返回null代表成功,失败的话会抛出错误信息
compile result
delete one fsm SLA
record id
Optional
objName: stringoptional
import {fsmDeleteSLA} from 'bp'
let res=fsm.fsmDeleteSLA("002N000000VwBrSDISbQ")
deleted count
delete one fsm step
record id
Optional
objName: stringoptional
import {fsmDeleteStep} from 'bp
fsm.fsmDeleteStep("002N000000VwBrSDISbQ")
deleted count
get process steps in one bp record
import * as bp from 'bp'
let bpInstance=bp.newClientV1();
let progessList = bpInstance.getProcessSteps("002N000000VwBrSDISbQ")
process steps
get sla in one bp record
import * as bp from 'bp'
let bpInstance=bp.newClientV1();
let slaList = bpInstance.getSLA("002N000000VwBrSDISbQ")
sla
get values of variables
import * as bp from 'bp'
let client=bp.newClientV1();
let vars = client.getVars("002N000000VwBrSDISbQ", ["foo", "bar"])
console.log(vars)
variable values
modify one FSM in BP
import * as bp from 'bp'
let instClient = bp.newClientV1();
let res = bp.modifyFSM("002N000000VwBrSDISbQ","FSMData") // 返回null代表成功,失败的话会抛出错误信息
compile result
resume bp
instance id
import * as bp from 'bp'
let client = bp.newClientV1()
let res = client.resume("002N000000VwBrSDISbQ")
set values to according variables
instance id
variables
import * as bp from 'bp'
let client = bp.newClientV1()
client.setVars("002N000000VwBrSDISbQ", {"foo": "aaa","bar": "bbb"})
start executing a BP
import * as bp from 'bp'
let client = bp.newClientV1()
let res = client.start("test", { "foo": 1, "bar": 3}, "1.0.1")
input the parameters of bp
result. For example,
{
"interviewId": "002N000000FdtN6xwgjI",
"screen": {
"allowBack": false,
"allowFinish": true,
"allowNext": true,
"allowPause": false,
"helpText": "",
"label": "input phone number",
"name": "inputphonenumber",
"pausedText": "",
"screenFields": [
{
"dataType": "text",
"defaultValue": "135xxxxxxxx",
"fieldType": "InputField",
"helpText": "",
"isRequired": false,
"label": "phone number",
"name": "phoneNumber"
}
]
}
suspend bp
instance id
import * as bp from 'bp'
let client = bp.newClientV1()
let res = client.suspend("002N000000VwBrSDISbQ")
terminate BP and related resource
instance id
terminate reason
import * as bp from 'bp'
let client = bp.newClientV1()
client.terminate("bpId","bp is end")
active one FSM in BP