-->

Working with IBM rule engine

2019-04-15 17:19发布

问题:

I have been asked to write a proof of concept (POC) that works with IBM rule engine (ILog).

I have seen a lot of documentation in IBM site but still didn't manage to use it to progress with the POC.

Has anyone used the IBM rule engine and can give me high-level explanation about how this rule engine is working?

回答1:

To start with you should have ILOG Rule Studio. To put together POC you need to go through following steps.

Step 1: Create XOM (Execution Object Model) - Either create some POJO classes,XSD or XML which you want to use during rule invocation. If you have existing jar in your application you can use that too. This is physical model of your business domain.

Step 2: Create BOM (Business Object Model) - It has to be created from the XOM using the rule studio.This is the logical model of your business domain.

Step 3: Create Verbalization - While creating the BOM it will ask you to verbalize your variables,setters and getters. This is like english like representation of your business model.

Step 4: Create Rule Project and define ruleset parameters - Create rule project and define input and output parameters.

Step 5: Write Rules - Write business rules using the ruleset parameters and the BOM. White rule flow to include the rule written in sequence.

Step 6: Create RuleApp Project and Generate RuleApp Archive - Create ruleApp project and generate the ruleapp archive. The ruleapp archive is typically the business rules compliled into IRL (ILOG Rule Language).

The simplest way to execute the rule is to include the rule archive generated from rule studio inside your application (this is called Embedded mode of execution) and invoke the rules using ILOG api and by passing the input parameters.

When rule is invoked the input parameters are serialized and passed to the rule engine, rule engine parse the invoked rule from the archive, evaluate the rule based on the input parameters, prepare the serialized output and returned back the output to the caller.