[rules-users] How to pass global variables to a function called in a condition

2011-08-24 Thread Matthew Erler
In Drools 5 I'm passing in two global Date objects and need to find the difference in days between them.  I've discovered that the function parameters (fromDate and toDate in my case) are null in the condition when the function is called, but when the function is called in the consequence they

[rules-users] Are if/then rules possible?

2011-08-22 Thread Matthew Erler
In Drools 5 is it possible for a rule to call one of two specific rules depending on whether the condition in the first rule evaluates to true or false?  For example lets say that there are three rules: A, B, and C.  A is evaluated and if its condition is True then execute rule B, otherwise

[rules-users] How to rethrow Exceptions from Drools 5 functions

2011-08-09 Thread Matthew Erler
I would like to write a utility function that works with java.text.SimpleDateFormat and several more date-related Java classes.  The classes can throw Exceptions that the function caller should know about.  Is it possible for a function to be declared such that it can throw any Exception back

Re: [rules-users] How to remove Drools 5 facts from a web service

2011-08-02 Thread Matthew Erler
, 2011, 1:35 AM 2011/8/1 Matthew Erler wir...@yahoo.com The first thing that the service method needs to do is clear out all the facts inserted during the last service method invocation.  I use StatefulKnowledgeSession.insert(Object fact) to add facts and StatefulKnowledgeSession.getAgenda().clear

[rules-users] How to remove Drools 5 facts from a web service

2011-08-01 Thread Matthew Erler
I have a web service in which I'm using a Drools 5 StatefulKnowledgeSession object.  The object lives between web service method invocations.  The first thing that the service method needs to do is clear out all the facts inserted during the last service method invocation.  I use

Re: [rules-users] How to add application data via StatefulKnowledgeSession

2011-07-29 Thread Matthew Erler
://www.plugtree.com - Blog @ http://ilesteban.wordpress.com 2011/7/28 Matthew Erler wir...@yahoo.com Can someone please show me an example where application data is added to workingMemory as described here: http://docs.codehaus.org/display/DROOLS/Application+Data using StatefulKnowledgeSession? I

[rules-users] How to add application data via StatefulKnowledgeSession

2011-07-28 Thread Matthew Erler
Can someone please show me an example where application data is added to workingMemory as described here: http://docs.codehaus.org/display/DROOLS/Application+Data using StatefulKnowledgeSession? I have a need to populate an object from a rules file and I don't want that object itself to be treated