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"So my method would only return something like service.getResultFact().
when
FactX ()
then
ResultFact resultFact = new ResultFact();
service.addResultFact(resultFact);
insert(resultFact
);
end