Business Data Scripting by Example
The data objects that are passed around the ActiveMatrix BPM system, both within and between processes, can sometimes be mapped as whole objects from one process to another, or attributes of one object can be mapped onto attributes of another object in graphical ways using the mappers. However, there are some places where the processes require custom processing of the data beyond the direct mapping of attributes. In these cases, the scripting capabilities can be used.
This section illustrates how to write BDS server-side scripts, through a number of examples. The scripting is provided by the Business Data Services (BDS) component that allows process definers to manipulate the data objects defined within the BOM.
BPM Script scriptingcan be used in a lot of places within ActiveMatrix BPM processes by selecting JavaScript as the script grammar, for example:
- Script tasks within processes
- Action Scripts that are run on particular events related to tasks (for example, initiate, complete, timeout, cancel, open, submit and close)
- Timer Scripts - used to calculate a deadline or duration of a task within a process
- Condition Scripts – used to determine which direction flow should take within a process
- Loop Scripts – control how many times loops are executed within processes
The BPM Script is based on the JavaScript language, but has some unique restrictions and extensions, all of which are described later in this guide.