[rules-users] Request for help to execute rule using drools5.0 from excel file

Sanjib Karmakar sanjibk at skytechsolutions.co.in
Wed Jun 30 08:51:37 EDT 2010


Hi 

I am new in drools and in my project I would like to access rules in excel
file using drools 5.0 
Please provide me the source code for how to access the rules in excel file. 

I have done the following code 

KnowledgeBuilder kBuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(); 
DecisionTableConfiguration dtconf =
KnowledgeBuilderFactory.newDecisionTableConfiguration(); 
dtconf.setInputType( DecisionTableInputType.XLS ); 
dtconf.setWorksheetName("Tables"); 
kBuilder.add(ResourceFactory.newFileResource("TeamAllocationExample.xls"),
ResourceType.DTABLE, dtconf); 
                
KnowledgeBuilderErrors errors = kBuilder.getErrors(); 
 if (errors.size() > 0) 
  { 
    for (KnowledgeBuilderError error: errors) { 
    System.out.println(error); 
  } 
  throw new IllegalArgumentException("Could not parse knowledge."); 
} 

KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase(); 
kbase.addKnowledgePackages(kBuilder.getKnowledgePackages()); 
return kbase; 

I am using the 'TeamAllocationExample.xls' - which is the default example I
found searching in net.
Here LHS and RHS portions are given - I would like to know how could I
execute the rule and get the result what is given under 'ACTION' column? 

Please help me. 

Thanks in advance 
Sanjib 
-- 
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Request-for-help-to-execute-rule-using-drools5-0-from-excel-file-tp933111p933111.html
Sent from the Drools - User mailing list archive at Nabble.com.



More information about the rules-users mailing list