After you fireAllRules() you can get latest value of the global using: 
Double result = (Double) ksession.getGlobal("result");

Best Regards, 


XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Esteban Aliverti
- Blog @ http://ilesteban.wordpress.com


On Tue, Jan 15, 2013 at 10:20 AM, FrankVhh <frank.vanhoenshoven@agserv.eu> wrote:
java.lang.Double result = new java.lang.Double(0);
ksession.setGlobal("result", result);

?


penny wrote
> test.java file:
>
> KnowledgeBase kbase = readKnowledgeBase();
> StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
> ksession.setGlobal("result", new java.lang.Double(0));
>
>
> I have used the global variable “result” in the rule file,how to use it in
> the test.java file?
> I need a judgement like “if(result>0)”.





--
View this message in context: http://drools.46999.n3.nabble.com/How-to-use-Drools-s-global-object-in-a-java-file-tp4021532p4021535.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