cc/td/doc/product/rtrmgmt/ana/4_0
hometocprevnextglossaryfeedbacksearchhelp
PDF

Table Of Contents

Drools Rules Engine

Drools Rules Engine Overview

Drools Components and Terminology

Drools and ANA Integration

Drools Definitions in ANA

Upgrading Rule Files


Drools Rules Engine


These topics introduce and describe the Drools rules engine.

Drools Rules Engine Overview

Drools and ANA Integration

Drools Definitions in ANA

Upgrading Rule Files

Drools Rules Engine Overview

The Drools rules engine is a general-purpose expert-system generator and combines rule-based techniques and object-oriented programming. It also provides a customizable mechanism to add decision support and data-flow control functions to business applications.

The Drools rules engine is based on an object-oriented paradigm and uses user-defined rules to perform pattern matching on different conditions. The rules are written in a Java-like syntax, and are organized into source files (known as a rule files), which are plain ASCII files.

Drools Components and Terminology

Drools uses objects as marked out by patterns and rules that invoke certain actions:

Drools objects are Java objects and can be represented by instances of Java classes or XML schemas.

A pattern is a coded expression (program) that manipulates one or more objects to form a pattern to make, adapt, or fashion behavior according to designed logic.

Working memory is where Drools stores, in working memory, all objects that it is handling.

Actions are operations that may change the working memory.

A rule can perform many types of actions, such as:

Add or remove an object from the working memory.

Modify an object.

Execute a method on one of the objects.

Drools stores in the agenda the list of rules to be executed.

Drools and ANA Integration

The Drools rules engine enables you to extend the ANA alarm correlation mechanism with user-defined rules and business logic.

The Drools rules engine is fully integrated within the gateway and does not require any synchronization or maintenance. It can access all ANA information and functions, enabling you to:

Use up-to-date network information (topology, hierarchy, and inventory) as part of its rule processing.

Create and manipulate alarms, and send commands to NEs.

Define operator-logic rules, such as:

If the alarm was not attended to within 2 hours then...

If there are more than 5 open alarms on this network element then...

If today is Tuesday then...

The rules are written for Drools in XML-format files, and can be modified and reloaded in runtime. There is no need to compile the rules, nor to restart any ANA component.

ANA maintains two Drools processing instances (contexts), with two respective rule files:

Pre-correlation processing context

Post-correlation processing context

The Rule files are located under ANAHOME/Main/data in the ANA gateway.

Drools Definitions in ANA

The Drools mechanism runs in two processing contexts:

Pre-correlation context—Defined in the pre.drl rule file.

Post-correlation context—Defined in the post.drl rule file.

The Drools parameters are stored in the registry file mmvm.xml under the event-management key:

Context ID—The Drools context name.

Rule filename—The name of the respective rule file. The specified rule (the filename under mmvm.xml).

Upgrading Rule Files

To upgrade a rule file:


Step 1 Make a copy of the required rule file (pre.drl or post.drl), and edit it.

Step 2 Copy the updated file (under a temporary name) to the gateway (directory ANAHOME/Main/data).


Note If the rule file is edited on a PC, make sure that the text format is compliant to the UNIX version that runs on the gateway. If necessary, use a utility such as DOS2UNIX for the conversion.


Step 3 Check the validity of the new file by running the check-rules.sh utility to validate the rules syntax, as follows:

check-rules.csh rule-file-name

Step 4 Once the rule file has been validated:

a. Copy the new rule file on top of the existing rule file.

b. Reload rules files by stopping and restarting the gateway, as follows:


Note You must be logged in as anauser to use this command. The command assumes that you have installed ANA in the default location, /export/home/ana40.


# cd /export/home/ana40/Main
# ./cmpctl stop
#
#
./cmpctl start

For more information about Drools, go to www.drools.org.



hometocprevnextglossaryfeedbacksearchhelp

Posted: Mon Sep 24 07:29:00 PDT 2007
All contents are Copyright © 1992--2007 Cisco Systems, Inc. All rights reserved.
Important Notices and Privacy Statement.