my spring config file is:
<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:drools="http://drools.org/schema/drools-spring"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://drools.org/schema/drools-spring
http://drools.org/schema/drools-spring.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-3.0.xsd">
<drools:kbase id="kBase">
<drools:resources>
<drools:resource type="DRL"
source="classpath:META-INF/rules/myproject-rules.drl" />
</drools:resources>
</drools:kbase>
<drools:ksession id="kSession" type="stateful"
kbase="kBase"></drools:ksession>
</beans>
rule is:
import.....
global EligibilityResult eligibilityResult;
rule "Customer State Check - ACTIVATED"
when
SeHolder(seHolderState.state == "ACT")
then
eligibilityResult = new EligibilityResult();
eligibilityResult.setEligible(true);
insert(eligibilityResult);
end
java code
@Resource
StatefulKnowledgeSession kSession;
@Override
public SeHolder checkCustomerEligible(String seId) {
EligibilityResult eligibilityResult = new EligibilityResult();
SeHolder seHolder = new
SeHolder();//seHolderManagement.getSEHolder(seId);
seHolder.setId("test0002");
seHolder.setSeHolderState(SeHolderState.SUSPENDED);
kSession.insert(seHolder);
kSession.fireAllRules();
Object objs[]= kSession.getObjects().toArray();
for (int i = 0; i < objs.length; i++) {
eligibilityResult = (EligibilityResult) ((objs[i] instanceof
EligibilityResult)?objs[i]:null);
}
System.out.println("----- EligibilityResult ----- " +
eligibilityResult.isEligible());
kSession.dispose();
return seHolder;
}
NOW MY QUESTION IS THAT I AM GETTING THE EligibilityResult LIKE SHOWN IN
ABOVE CODE.. CAN ANYBODY TELL ME IS THERE ANY OTHER SUFFICIENT WAY SO THAT I
CAN GET IT BY NAME OR SOME OTHER WAY.
--
View this message in context:
http://drools.46999.n3.nabble.com/Drools-with-Spring-Need-Help-tp3115948p...
Sent from the Drools: User forum mailing list archive at
Nabble.com.