#WORKFLOW SDK ###NOTE THIS IS JUST TEMPORARILY DOCUMENTATION AND WILL BE UPDATE SOON. ####All methods build with bluebird promise dependancy.
##CONTAINER:
-
What is Container, container is just a vessel which contains the data from activity to another in single workflow.
-
Container methods as mentioned below:
- create: "create container"
- getDetails: "get container details".
- update: "update container according to activity status".
let client = require('workflow_sdk');
let container = {
name: 'C01',
data: {
test: 'test3',
test2: 'test4'
}
};
//create Container
client.container.create(container);
//get container details
console.log(client.container.getDetails('C01'));
//update container
client.container.update(container);
##ACTIVITIES:
- workflow methods as mentioned below:
- forward
- reject
- getDetails
- updateActivity
- updateQueuedItem
- getActivitiesByPerformers
- findActivity
- findActivitiesByWfId
- createQueuedItem
- findQueuedItemsByProcessId
- cancel
- getQueuedItemsByPerformers
- getQueuedItemCount
let client = require('workflow_sdk');
client.activity.forward(2,container);
client.activity.reject(2);
client.activity.getQueuedItemsByPerformers(2)
.then(result=>{
console.log(result);
})
.catch(err=>{
throw err;
});
##WORKFLOW:
-
workflow is a template which workflow designer to set all activities required based on business requirements.
-
workflow methods as mentioned below:
- initiate
- cancel
- finish
- getDetails
- update
- findWorkflowById
- createProcess
//initiate workflow which will create 'Process' as an
//instance of this workflow and its activities as queuedItems.
let client = require('workflow_sdk');
client.workflow.initiate(workflowId);
//finish process
client.workflow.finish(processId);
//cancel process
client.workflow.cancel(processId);
//update process data
client.workflow.update(processId, {
name:'instance',
status:'dormant',
workflow_template:'01',
packages:'02',
});
//find workflow by Id
client.workflow.findWorkflowById(wfId);
//create process
client.workflow.create({
name:'instance',
status:'dormant',
workflow_template:'01',
packages:'02',
});