bpmonline is an extensible for node. Module contains api for bpm'online 7.x solution
var bpmonline = require('bpmonline');
var bpm = new bpmonline({
uri: "http://demo.bpmonline.com"
});
Authorization function. The function returns authorization cookies.
Arguments
- *
connectInfo
- Json object with connect properties. callback(err, res)
- A callback which is called when function complete, or an error occurs.
Examples
bpm.connect({login: "Supervisor", password: "Supervisor"}, function(err, res) {
if (err) {
console.log(err);
} else {
var cookies = res; //Authorized Cookies
}
});
Function, that run business process in bpm'online.
Arguments
- *
processName
- Name of bpm`online process that must be run. args
- Process arguments(Json object).cookies
- Cookie container fromconnect
response. Optional when first callconnect
methodcallback(err, res)
- A callback which is called when function complete, or an error occurs.
Examples
//cookies get from connect and using in runProcess
bpm.connect({login: "Supervisor", password: "Supervisor"}, function(err, res) {
bpm.runProcess("ProcessName", {
Param1: "Hello,",
Param2: "world",
ResultParameterName: "Out1"},
null, function(err, res) {
if (err) {
console.log(err);
} else {
var bpmXmlResponse = res; //process response
}
});
});
//runProcess with cookies from store
var cookies = {}; //take from connect method
bpm.runProcess("ProcessName", {Param1: "Hello,", Param2: "world", ResultParameterName: "Out1"},
cookies, function(err, res) {
if (err) {
console.log(err);
} else {
var bpmXmlResponse = res; //process response
}
});
Function, that run business process in bpm'online by signal.
Arguments
- *
signalName
- Name of the bpm`online signal that runs the processes. cookies
- Cookie container fromconnect
response. Optional when first callconnect
methodcallback(err, res)
- A callback which is called when function complete, or an error occurs.
Examples
//cookies get from connect and using in throwProcessSignal
bpm.connect({login: "Supervisor", password: "Supervisor"}, function(err, res) {
bpm.throwProcessSignal("SignalName", null, function(err, res) {
if (err) {
console.log(err);
} else {
var bpmXmlResponse = res; //process response
}
});
});
//throwProcessSignal with cookies from store
var cookies = {}; //take from connect method
bpm.throwProcessSignal("SignalName", cookies, function(err, res) {
if (err) {
console.log(err);
} else {
var bpmXmlResponse = res; //process response
}
});
Function, that run any configuration rest-service in bpm'online.
Arguments
- *
serviceName
- Name of the bpm`online rest-service. - *
methodName
- Method name of the bpm`online rest-service. json
- json.cookies
- Cookie container fromconnect
response. Optional when first callconnect
methodcallback(err, res)
- A callback which is called when function complete, or an error occurs.
Examples
//cookies get from connect and using in throwProcessSignal
bpm.connect({login: "Supervisor", password: "Supervisor"}, function(err, res) {
bpm.customRestService('CustomBpmService', 'Invoke', {param1: "Hello", param2: "World"}, null, function(err, res) {
if (err) {
console.log(err);
} else {
var bpmJsonResponse = res; //service response
}
});
});
//throwProcessSignal with cookies from store
var cookies = {}; //take from connect method
bpm.customRestService('CustomBpmService', 'Invoke', {param1: "Hello", param2: "World"}, cookies, function(err, res) {
if (err) {
console.log(err);
} else {
var bpmJsonResponse = res; //service response
}
});