Updating a variable value can take several forms. A variable can receive an unrequested value or one that is requested. Both types of update have effects on the KB.
conclude action from a procedure, method, or rule
Obtaining Requested Values
The events that create a request for a new variable value are:
Default-update-interval attribute
collect data statement, or a wait until statement in a procedure that references the variable
update action that references the variable
Last-recorded-value is still valid by checking the Validity-interval attribute. The validity interval of a variable is described in Specifying a Validity Interval. If the value has not expired, G2 uses it and does not seek a new value. G2 seeks a value for a variable only when an item needs a value for the variable and the variable's value has expired. The attempt to obtain a new value for a variable is called data seeking.
Value expiration does not itself cause G2 to data seek for a value. If a variable value expires and no outstanding request for that value exists, G2 does not try to obtain a value automatically.
Data-server attribute. A data server is the process or task that tries to obtain a value for the variable. The variable data servers are as follows:
When the data server is other than the inference engine, G2 can receive both requested and unrequested values from that data server. The rest of this section shows how each of the data servers gets a value for the variable. Variable failures are described in Handling a Variable Failure.
Inference Engine Data Server
The inference engine can obtain values from rules or formulas.
To obtain a value for a variable, the inference engine:
Formula attribute.
Options attribute of both rules and variables. For variables to be able to backward chain to a rule, and for variables and parameters to forward chain to a rule, both items must have their Options attribute set appropriately.
G2, G2 Gateway, or GFI Data Server
If the variable is using one of the other data servers, G2 sends a request to that data server for a value. G2 then performs other tasks until it receives a value. Timeout-for-variables, G2 fails to get a value for the variable.
Handling a Variable Failure
A variable fails to receive a value if G2 requests a value and one of the following is true:
Timeout-for-variables attribute in the Inference Engine Parameters system table.
When a variable fails, G2 does two things:
whenever rules that check for a failure in the variable.
whenever rules automatically when at least one statement in the antecedent is true. Two forms of
whenever rules that you can write to test variable values are:
whenever variable receives a value
whenever variable fails to receive a value
whenever rules to initiate specific action in the event of a failed variable. For example, a rule such as this:
whenever any temperature-variable V fails to receive a value
then start value-test (V)
whenever rules this way is analogous to writing on error statements in procedures. Such whenever rules are invoked once after each time the variable fails to receive a value, not after each retry task.
Retry-interval-after-timeout attribute in the Inference Engine Parameters system table. When no more requests for the value of the variable exist, G2 stops retrying the variable, but the variable is still considered failed. A variable remains failed until it receives a value.