[rules-users] concrete query methods

thomas kukofka thomaskukofka at web.de
Fri Jun 20 08:26:51 EDT 2008


Hello,

supposed I have rules sets for different issues and operating on different
facts. Now I want to write an interface for users who don't want to be
bothered with details of the Drools API and who wish interface methods which
returns results for concrete questions like:

ResultFact getAnswerForQuestionXY()

How can such a concrete query be implemented?
My first idea was to store the result fact with the help of globals:

rule "XY"
    when
        FactX ()
    then
        ResultFact resultFact = new ResultFact();
        service.addResultFact(resultFact);
        insert(resultFact
);
end

So my method would only return something like service.getResultFact().
I don't know if there are better solutions or if it is unusual to use
methods for concrete queries.


Kind regards
Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20080620/883eb628/attachment.html 


More information about the rules-users mailing list