Hi
Below is the code i use to run the rules in the decision table. I am
inserting the empty even object into the session but i still get the "Cannot
be resolved issues". I have attached my decison table as well. Am new to
DRools, so please help.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
DecisionTableConfiguration dtableconfiguration = KnowledgeBuilderFactory.*
newDecisionTableConfiguration*();
dtableconfiguration.setInputType( DecisionTableInputType.*XLS* );
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.*newKnowledgeBuilder*();
kbuilder.add( ResourceFactory.*newClassPathResource*(
"RFC36877ScenarioDT.xls",
getClass() ),
ResourceType.*DTABLE*,
dtableconfiguration );
*if* ( kbuilder.hasErrors() ) {
System.*err*.print( kbuilder.getErrors() );
*return* -1;
}
KnowledgeBase kbase = KnowledgeBaseFactory.*newKnowledgeBase*();
kbase.addKnowledgePackages( kbuilder.getKnowledgePackages() );
// typical decision tables are used *statelessly
*
StatelessKnowledgeSession ksession = kbase.newStatelessKnowledgeSession();
//now create some test data
Input input = *new* Input();
System.*out*.println("creating the event...");
BusinessEvent event = *new* BusinessEvent();
ksession.execute( Arrays.*asList*( *new* Object[]{input, event} ) );
System.*out*.println( "Business events " + event.getEvents());
*return* 0;
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks
Manikandan
Show replies by date
Do you still have the problem?
A detailed error-message would be helpful. What cannot be resolved?
Maybe your classes are not defined in the
com.rabo.bbb.rfc36877.poc.decisionTable package.
And as far as I know you have to declare all objects in the condition. So
put "event : BusinessEvent" in a condition-column and use it with
event.setEvents("$param") in the action-column.
Just take a look at the drools-examples to see how it works.
--
View this message in context:
http://drools-java-rules-engine.46999.n3.nabble.com/Problem-with-the-Deci...
Sent from the Drools - User mailing list archive at
Nabble.com.