A rule engine is a software component designed to evaluate and execute business rules. A rule is a logical construct that determines certain actions to be conducted in case that defined conditions are kept. Basically, the business processes handled inside VeCare that need to make use of rules are related to products configuration, price calculation, selling products to customers, assembly and delivery of product instances, presentation and analysis of invoice and account data etc.
Usually software systems utilize rules either implicitly (i.e. they are not described anywhere in the software) or in a directly hard-coded manner. Both approaches work well in some situations, but have their limitations. There is an additional approach: rules are specified explicitly in the software, and certain facilities within it can be used to configure and execute them. Within VeCare Rule Engine, all these approaches are used.
Since the rule engine implements all of the logic necessary to perform rule evaluation and execution, the rules are coded as stand-alone atomic units separate from and independent of the rest of application logic. That makes them easier to develop and maintain. Rule engines have a proprietary rule language for writing rules. To implement an application using a rule engine you write the rules in the rule language and embed the rule engine into your application. The rule engine is integrated with the application through an API that controls providing of the rules into the rule engine, activating of rules (only activated rules are eligible to fire), monitoring of application objects referenced by rules, execution of rules etc. The rules are loaded into the rule engine by invoking a method of the rule engine object and passing the rules in XML representation. To evaluate the rules, the rule engine has visibility to the application objects referenced by rules. To provide this type of visibility, the object data members and methods referenced by the rules are specified as public. Through the process of asserting the rule engine obtains references to the objects referred by the rules. Once the objects have been asserted to the rule engine, the rule engine maintains a set of references to these objects. The rule engine's fire rules method is then invoked to cause the rule engine to evaluate all the activated rules. Following evaluation, when the conditions of rules are met, the rules are executed or fired, causing their action statements to execute. An alternate approach (Self-organizing Boolean Network) was used to optimize rules evaluation instead of well-known RETE algorithm.
Programming languages: Java, XML
Platforms: cross-platform solution