Event broking

In order to specify the processing order of specific tasks in the Apis modules, the concept of Events and Commands has been introduced together with a so-called Event Broker. An Event is an outgoing notification from an Apis module. The notification could e.g. be sent when a calculation has finished. A Command is an in-coming notification to an Apis module, telling the module to perform a specific task. This could be e.g. to calculate new values based on the present data values.

The Apis Event Broker controls the relationship between events and commands. An Event can be configured to trigger a series of Commands. The Commands will then be executed in the order specified when an event notification is sent from an Apis module to the event broker.

The Events and Commands are specific for each type of Apis module. Common for the modules handling external items, are the event named ExternalItems, and the command named HandleExternalItems. The ExternalItems event is a timer event handling exchange of external items. The period of the timer is specified in the ExchangeRate attribute of the module. The timer is only running if the module has configured external items. The HandleExternalItems command handles the updating of the items connected to external items.