next up previous contents
Next: Definition of ECArules Up: Advanced Features Previous: Limiting Access to Modules

Active Rules in ConceptBase

 

Active rules allow the user to specify, that certain actions have to be executed if an event occurs and a condition is fulfilled at this time. Because active rules consists of an Event, a Condition and an Action, they are abbrivated with ECArule.

Events (ON-part) of ECArules are insertions and deletions of objects (Tell/Untell) and queries (Ask). The events are detected during the processing of the input frames for a Tell or Untell or Ask operation. For example, if you tell 2 frames at a time, and the first frame contains an event for an ECArule, then the ECArule is executed before the second frame is processed. You can also control the sequencing of the firing of ECA rules by the so-called ECAmode and by priority orderings in the set of defined ECArules.

The condition of the ECArule (IF-part) is a logical expression over the database. It will bind free variables occurring in the condition (if any) and these bindings together with the bindings of the event are passed to the action part of the ECArule.

The action (DO-part) of an ECArule is evaluated for each evaluation of the IF-part that has is true in the database. The elements in a DO-part can be Tell, Untell, and Ask actions. Optionally, one can specify an ELSE-part which consists of actions that are executed when the IF-part is not satisfiable for any binding of the free variables. Possible actions are Tell/Untell of objects, evaluation of queries and execution of any PROLOG predicate. There is a special action 'reject' which will abort the whole transaction.

The effect of ECArules is subject to the regular integrity checking of ConceptBase. If an integrity violation is detected, then the whole transaction including all updated by ECArules is rolled back. The integrity test is started after all enabled ECArules have fired.




next up previous contents
Next: Definition of ECArules Up: Advanced Features Previous: Limiting Access to Modules

ConceptBase Team