OpenAjax Run-Time Behaviour Overview

  

DEVELOPER

OpenAjax Run-Time Behaviour Overview

PROIV can subscribe to OpenAjax events whereby PROIV Functions can receive events published by the OpenAjax HubOpenAjax Hub (The OpenAjax Alliance describes the OpenAjax Hub as the following: "The OpenAjax Hub is a set of standard JavaScript functionality defined by the OpenAjax Alliance that addresses key interoperability issues that arise when multiple Ajax libraries are used within the same web page." Copyright 2007-2008 OpenAjax Alliance  'OpenAjax Hub 1.0 Specification' OpenAjax Alliance Wiki, 14 December 2009. Web. 29 February 2012.), accept data from the event and run logic to process the data. This functionality is supported via Screen functions (because events can only be sent when the kernel is waiting for input, see Event Queuing) and only when connected using the Open Client.

Basic

When an OpenAjax Event Subscription (OAES) is stored against a Function Header, the function is in effect subscribing to that event. This means that when the OpenAjax Hub publishes an event and the function is running, the Open Client sends it to the function and the following steps occur::

  1. The data mapped is loaded into the PROIV Variables.

  2. The associated action (Local Logic, Global Logic or Function Key) is called. The data assigned from the OAES is made available and if the data sent is too long for the defined lengths, it is truncated silently.

Note: The PROIV Kernel must be waiting for input for the above to occur. See Event Queuing below.

Unsubscribe and Re-Subscribe

If the function is exited, or another function is called (i.e. the current function changes) then the OAESs are unsubscribed. If the called or linked function also needs the subscription, the list of OAESs must be added into that function as well.

In the case of a function call, when the call is complete (returned to the original function) then all OAESs are automatically be re-subscribed.

Changing Cycles

When a function moves between cycles, there is no automatic effect on the OAESs. You cannot unsubscribe for certain cycles or change the data mapping. However, the behaviour can change if Function Keys are set as the action because these can call different logics in different cycles.

Event Queuing

The PROIV Kernel can only handle events when it is waiting for input. This is controlled by the Open Client, which only sends one event when the kernel is available. If the Open Client needs to send multiple events, it sends them one at a time, with each one waiting for the kernel to be ready. If after an event, the kernel switches functions and consequently unsubscribes OAESs, any queuing events are discarded by the Open Client. Actions can cause a function to exit, and therefore unsubscribe from the OAESs. Any events remaining in the queue are then discarded.

Note: The order of the OAESs in a function is not related to the order in which they are subscribed. This is defined by whatever is publishing them.

Error Handling

If any OAES names or data element names are typed incorrectly, the subscribe cannot work at run-time.


 

Comment on this topic

Topic ID: 500611