Hi all,
I am about to start a new project here using Drools and in order to
better understand it I am reading the developer's guide book written
by Michal Bali.
During my readings, one thing caught my attention, on page 26 of the
book the author mentions:
"Use the global variable in a rule condition or a consequence. If used
in a condition, they must return a time-constant value while the rule
session is active."
And that's exactly one of the things our application will need to do
since we'll be checking events against facts stored in a database. One
interesting thing is that it turns out that the architecture we had in
mind is exactly what is described on the page 192 of the book,
services that would be registered as globals would be responsible for
accessing database and augmenting the facts on knowledge sessions when
necessary.
But... if we take the restriction mentioned on page 26 into
consideration we would have to open a new session for each event
received (and close it after). I am pretty sure this isnt much smart
not to mention that it kills any chance of using capabilities
introduced by Fusion.
Is there any other approach we could take to achieve this ?
best regards,
Rafael Ribeiro