The scripts can have one of the following forms:
Subscription Scripts listen for an event to happen and react to that event
'use strict';
api.subscribeFor('ExampleBuildingBlockType', test);
/**
* @param {BuildingBlockType} buildingblocktype
* @param {ChangeEvent} event
*/
function test(buildingblocktype, event) {
// React on the event
}
Direct Execution Scripts are executed on schedule or on manual execution
'use strict';
api.registerExecution(onDirectExecute);
function onDirectExecute() {
// Do something when the execution was triggered
}
Be advised
In any reaction script, do not use any direct statements other than
api.registerExecution
orapi.subscribeFor
. All functionality has to be placed within functions. Scripts are executed arbitrarily by the Plugin system, so direct statements in the scripts will have unintended effects.
Possible building block types.
A change event triggered by a BB Change contains several changes to building blocks of a specific type
Types of features a building block can hold.
This includes all attributes and relations.
Possible HTTP request methods
A Result from an LDAP Query consists of rows.
One LDAP Row contains values for all the requested fields.
A change can either be creation of a building block ('INSERT'), update of properties/relations of a building block ('UPDATE') or deletion of a building block ('DELETE')
Possible property types
Headers of a Http Response as a map from header name to header value
Type of the function called when a change event occurs
Api accessible in all plugin scripts
Generated using TypeDoc
Possible types for attribute values
The mapping between attributes types and value types is as follows
Enumeration attribute -> string
Responsibility attribute -> string
Numeric attribute -> number
Text attribute -> string
Date attribute -> ApiDate
Date interval - > DateInterval
Boolean attribute -> boolean