Is there a way to timeout a KieSession

259 views
Skip to first unread message

Webster Homer

unread,
May 19, 2016, 11:29:47 AM5/19/16
to Drools Usage
Is there a way to timeout a KieSession?

If our rules aren't done in 30 seconds there is probably a problem and it would be nice to be able to terminate the session and raise an error.

We are on drools 6.4

Mario Fusco

unread,
May 20, 2016, 2:43:40 AM5/20/16
to Drools Usage
There isn't a timeout, but indeed adding it would be a good idea. I'll add this requirement for next releases.
What you can do (not sure if this can help in your case) is calling fireAllRules(int max) where max is the maximum number of rules that should be fired before the method returns.

I hope this helps,
Mario

This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, you must not copy this message or attachment or disclose the contents to any other person. If you have received this transmission in error, please notify the sender immediately and delete the message and any attachment from your system. Merck KGaA, Darmstadt, Germany and any of its subsidiaries do not accept liability for any omissions or errors in this message which may arise as a result of E-Mail-transmission or for damages resulting from any unauthorized changes of the content of this message and any attachment thereto. Merck KGaA, Darmstadt, Germany and any of its subsidiaries do not guarantee that this message is free of viruses and does not accept liability for any damages caused by any virus transmitted therewith.

Click http://www.merckgroup.com/disclaimer to access the German, French, Spanish and Portuguese versions of this disclaimer.

--
You received this message because you are subscribed to the Google Groups "Drools Usage" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drools-usage...@googlegroups.com.
To post to this group, send email to drools...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/drools-usage/4a31723c-5902-4c3b-a2c2-9d7a5f5b43d5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Webster Homer

unread,
May 20, 2016, 10:50:29 AM5/20/16
to Drools Usage
Thanks! A timeout would be much cleaner. 

I found that I could make a timer rule that when it fires would stop the rule execution by retracting one of our key facts. I'm testing this, and it looks good but each of our rule based applications would need to create its own rule to making this solution non-optimal
Reply all
Reply to author
Forward
0 new messages