OpenAjax Run-Time Behaviour Overview |
DEVELOPER |
PROIV can subscribe to OpenAjax events whereby PROIV Functions can receive events published by the OpenAjax HubOpenAjax Hub , 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.
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::
The data mapped is loaded into the PROIV Variables.
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. |
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.
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.
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. |
If any OAES names or data element names are typed incorrectly, the subscribe cannot work at run-time.
Topic ID: 500611