[rules-users] Testing for global variable

Wolfgang Laun wolfgang.laun at gmail.com
Tue Feb 14 08:31:00 EST 2012


But you can
   try{ ks.setGlobal(...) } catch( Exception e ){ }

-W

On 14/02/2012, Chris Selwyn <chris at selwyn-family.me.uk> wrote:
> Is there a way to test for the existence of a global variable in a
> StatelessKnowledgeSession before inserting a SetGlobal command into a
> BatchExecutionCommand?
>
> I am trying to write a rules executor class that may execute some rulesets
> that need a particular global variable and some that don't.
> So I would like to be able to automatically test whether the rules that I am
> about to execute have the global variable and if they do not then not to
> insert the SetGlobal into the batch.
>
> I am using DRools 5.1
>
> Chris Selwyn
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



More information about the rules-users mailing list