What about ksession.getGlobals().get("obj")?

Best Regards,

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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


On Wed, Feb 9, 2011 at 12:24 PM, gs76pl <[email protected]> wrote:

>
> hi,
>
> is it possible to check if a rule has been defined with a global as below?
>
> global MyObject obj;
>
> rule
> when
> then
>
> Basically, i'm running below code:
> ksession = kbase.newStatefulKnowledgeSession();
> ksession.setGlobal("obj", new MyObject());
>
> but if a rule doesn't have global definition my code throws an exception.
> What i'd like to do is something like
> ksession.getGlobal('"obj") or ksession.checkGlobalExist('"obj").
> Unfortunately the first method doesn't work as it doesn't check if a global
> has been declared in a rule
> --
> View this message in context:
> http://drools-java-rules-engine.46999.n3.nabble.com/how-to-check-if-a-global-has-been-declared-in-a-rule-tp2459143p2459143.html
> Sent from the Drools - User mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> [email protected]
> https://lists.jboss.org/mailman/listinfo/rules-users
>
_______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to