This example shows how to use an Excel decision table rules inside a jBPM6 process using the example (JBPM5 - RuleTask Example Using an Excel Decision Table). As this example uses Eclispe plugin, install Drools/JBPM 6 plugin (Drools 6 - Eclipse Plugin Installation and Hello World Example).

 

Here are rules represented in Excel decision table.

 

There are three rules in the following decision table. For example, Rule1 (Row 11) means that if the 'userlocation' is set to ‘NewYorkUser’ and the initial count is less 4, then the ‘loopcondition’ is set to 6.

 

spreadsheet.png

Following is the main process flow diagram. This example has a loop condition which is determined using the rules shown in the above decision table in the RuleTask 'LoopConditionRules'.

process.png

'LoopConditionRules' is a 'Rule Task' component and it needs to have a valid RuleFlowGroup name (e.g.,  EvalLoopcondistion as shown below) and it should match with the 'RULEFLOW-GROUP' name (Column C) of the decision table.

ruleflowgroupprop.png

 

kmodule.xml file provides the name of the package and the ksession's name.

kmodule.png

 

processcode.png

 

This example has a bpmn file (processRuleslooptest777.bpmn), model file (HelloProcessModel.java), rules file (LoopConditionRules.xls) and a test file (ProcessRuleTest.java).

directory.png

 

After running ProcessRuleTest successfully, following results can be seen.

results.png