When posting a persistent dynamic decision table, Aion requires the use of the PostDTbl( ) method, which is provided by the DecTableRuntime services in DynRDLib. For posting non-persistent decision tables, there is a separate posting method, PostRule( ), provided by DecisionTableRule_Services in DynRLib. The former is an instance method of the persistent decision table itself that has been loaded from the (external) rulebase. The latter is a class method. The relationship between them is that the PostDTbl( ) method calls the PostRule( ) method. Thus, in posting a non-persistent dynamic rule, the Aion programmer is explicitly invoking the mechanisms that Aion itself uses internally to post persistent dynamic rules.
Because PostRule( ) is a class method and not a method of the non-persistent decision table itself, when posting a non-persistent decision table it is necessary to pass the pointer to the non-persistent rule definer object, that is, to the instance of the class that implements the DecisionTableRule_Defn_Interface _Interface. The signature of DecisionTableRule_Services:PostRule( ) is:
PostRule(pDefiner is &DecisionTableRule_Defn_Interface, pInstBindings is list of &_Object = NULL) : integer
Where Sample_DTbl_Definer is the class implementing the dynamic decision table _Interface, you can post a non-persistent decision table with the following code:
var hRule is integer var pDefiner is &Sample_DTbl_Definer pDefiner = Sample_DTbl_Definer.Create( ) . . . // Insert code to set the properties of the pDefiner // instance as shown above. Invoke InitRuleData( ) with // the appropriate arguments. . . // Now post the decision table that has been defined: hRule = DecisionTableRule_Services.PostRule(pDefiner)
// Here we assume no (further) instance bindings are // required.
| Copyright © 2009 CA. All rights reserved. | Send E-mail to CA about this topic |