Change Callback Methods

The CA Rule Engine inference engine invokes a Change Callback Method upon modifying a pre or post-condition field value, and when dynamically creating or deleting class instances visible to the client. However, a change callback method will not be invoked if the change is requested by the client, such as invoking the “updateObject” call of a stateful rule session, or as the result of client provided initialization callback.

Some situations where the Change Callbacks may be particularly useful:

A Change Callback Method is the inverse of an Initialization Callback Method and may be used in conjunction with it.

Unlike an initialization callback method which is invoked at most only once, a change callback method may be invoked multiple times if the engine needs to update the same field multiple times. For value change callback, the new value provided may be the Java null value if the field is to be set to unknown by the engine and the client provided callback is expected to handle that special case.

Another difference between an initialization callback method and a change callback method is that new objects cannot be created and added to the session in a change callback method.

Depending on whether the field is a collection, or whether the operation is on an instance itself, the following three types of change callback methods may be defined.