|
Binding Processing Sessions |
Top Previous Next |
|
All bindings in the widget are processed in special sessions. There are several types of binding processing sessions:
Only bindings that have their On event flag enabled may be included in the session. The following bindings are included into one session: To recapitulate, before running a binding session, AggreGate Server first finds all bindings which will participate in it. AggreGate Server groups all bindings participating in a given session. Each binding is not processed separately, but may affect processing of other bindings within the same session. Within a single session, bindings are processed in a certain order, depending on their targets (see Processing Precedence). When a binding is processed, its Expression is evaluated and its result is written to the Target. The Target expects a value of a certain type (e.g, an integer), so the Expression must indeed evaluate to that type -- otherwise the binding won't process correctly (try putting a string value into a field which needs an integer -- it won't work). Any errors during binding processing are shown using the Show Error UI Procedure:
Context Data Caching Values of context variables and output values of context functions are cached during a binding processing session. When the processing engine resolves a standard reference pointing to a certain field and gets its value, the Data Table containing this value will be cached in session data. If there's another reference to the same variable (even if it refers to another field within that variable) it'll be retrieved from the cache. The same applies for context functions. If there are several references pointing to various output fields of a function, the function will be called just once in the session. Other references to its output will be resolved through the cache. Within a given session, bindings are processed according to their targets. 1. Bindings to function input fields Bindings whose targets point to an input field of a function are processed first. The expressions of such bindings are evaluated and resulting values are used to fill the input Data Table of the function before it is called. The actual function call is performed during processing of bindings those target point to context functions itself (see next step). 2. Bindings to context functions At this step, bindings pointing to context functions are processed. When such a binding is processed, function is called with parameters collected at the previous step. 3. Bindings to fields of variables Bindings to the fields of context variables are processed next. Several steps are performed for every variable:
4. Bindings to variables Expressions of bindings whose target points to the value of a variable (and not a certain field within it) are now evaluated. The evaluation of each such expression must result in a Data Table. Assuming this Data Table has the same format as the variable, it now replaces the variable value. 5. Bindings to widget component properties Bindings to properties of widget components are the last to be processed. The target points to a component property, and this property is now set to the result of the binding expression evaluation. |