API

A bpm object is accessible in the global connector visibility area. You may use this object in the pre and post section of the connector. The object provides a basic system api for processes, which allows to manage process behaviour and create new connectors.

Properties

bpm.connector

Object describing current connector

bpm.ctx

Object of context, intended for working with the it

bpm.data

The data object received from the previous connector. Always contains the lastId field, the value of which is the identifier of the previous connector.

Methods

Please note

All methods return the object Promise

Working with connectors

bpm.getConnectorById(id)

Method for obtaining the connector based on its identifier

Name Type Description
id String Connector identifier

bpm.reject(requeue)

The method allows to refuse the execution of the current connector. The requeue parameter is responsible for re-executing the connector.

Name Type Description
requeue bool Re-executing the connector

Working with the Process

bpm.setData(data)

Method for transferring data to the next connector. Always contains a lastId field, the value of which is the identifier of the previous connector.

Name Type Description
data object Object of data for send to next connector

bpm.stopProcess()

Method to abort the process

bpm.log(msg)

Method to log the process

Name Type Description
msg string Logged message

bpm.error(err)

Method to log errors the process

Name Type Description
err string Logged errors

Working with the Storage

bpm.storage.get(name, data)

This method is used to select documents from the Storage

Name Type Description
name String Storage name
data Object Storage protocol

bpm.storage.create(name, data)

This method is used to create a document in the Storage

Name Type Description
name String Storage name
data Object Storage protocol

bpm.storage.update(name, data)

This method is used to update a document in the Storage

Name Type Description
name String Storage name
data Object Storage protocol

bpm.storage.remove(name, data)

This method is used to delete documents from the Storage

Name Type Description
name String Storage name
data Object Storage protocol

bpm.storage.count(name, data)

This method is used to count the number of documents in the Storage

Name Type Description
name String Storage name
data Object Storage protocol