Re: [rules-users] Drools with Spring - Need Help

2011-07-04 Thread Andre
in the spring xml you can also declare globals and you should be able to
access them in the drl via name

http://docs.jboss.org/drools/release/5.2.0.Final/droolsjbpm-integration-docs/html_single/index.htm

i think its the setGlobal Command


--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools-with-Spring-Need-Help-tp3115948p3137367.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools with Spring - Need Help

2011-07-01 Thread sv
Can you be bit elobrate? What version of drools you are using.

--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools-with-Spring-Need-Help-tp3115948p3129427.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools with Spring - Need Help

2011-06-29 Thread anilkapoor
can anybody guide me in this...

--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools-with-Spring-Need-Help-tp3115948p3120575.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Drools with Spring - Need Help

2011-06-27 Thread anilkapoor
my spring config file is:

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";> 
   
  

  

  

   
 


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-tp3115948p3115948.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users