What about ksession.getGlobals().get("obj")?
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
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users