Plugin API

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 or api.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.

Index

Type aliases

AttributeValue

AttributeValue: string | number | ApiDate | DateInterval | boolean

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

BuildingBlockType

BuildingBlockType: "BusinessDomain" | "BusinessProcess" | "BusinessUnit" | "Product" | "Project" | "BusinessFunction" | "BusinessObject" | "InformationSystemDomain" | "InformationSystem" | "InformationFlow" | "ItService" | "ArchitecturalDomain" | "TechnicalComponent" | "InfrastructureElement"

Possible building block types.

ChangeEvent

ChangeEvent: ModelChange[]

A change event triggered by a BB Change contains several changes to building blocks of a specific type

FeatureType

FeatureType: "DECIMAL" | "TEXT" | "RICHTEXT" | "ENUMERATION" | "RESPONSIBILITY" | "DATE" | "DATETIME" | "DURATION" | "DIRECTION" | "BOOLEAN" | "RELATIONSHIP"

Types of features a building block can hold.

This includes all attributes and relations.

HttpMethod

HttpMethod: "GET" | "PUT" | "POST" | "DELETE"

Possible HTTP request methods

LDAPResult

LDAPResult: LDAPRow[]

A Result from an LDAP Query consists of rows.

LDAPRow

LDAPRow: {}

One LDAP Row contains values for all the requested fields.

Type declaration

  • [name: string]: string

ModelChangeType

ModelChangeType: "UPDATE" | "INSERT" | "DELETE"

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')

PropertyType

PropertyType: "responsibility" | "enum" | "number" | "text" | "date" | "dateinterval" | "boolean"

Possible property types

ResponseHeaders

ResponseHeaders: {}

Headers of a Http Response as a map from header name to header value

Type declaration

  • [name: string]: string

SubscriptionCb

SubscriptionCb: (buildingBlockType: BuildingBlockType, event: ChangeEvent) => void

Type of the function called when a change event occurs

param

Type of the building block that was changed

param

Description of the changes that occurred

Type declaration

Variables

Const api

api: Api

Api accessible in all plugin scripts

Legend

Generated using TypeDoc