ok I've done some work on this now. The WorkingMemory is transient, so
querries will work, until you serialise - also added the ability to use
parameterised querries. I've also updated it so you can do
StatelessSessionResult.getGlobal(String identifier). The twist is
globals must be exported as part of the results - to achieve some level
of statelessness. Take a look at the jira and give me feedback, asap, as
this will be in 4.0.2 next week.
Mark Proctor wrote:
> Is anyone using StatelessSession.getQueryResults(). Realised that it
> was a mistake adding that. the idea of StatelessSessionResult is you
> have something that is potentially serialisable. To execute that
> method then you have to have a refernce to the entire WorkingMemory
> and that must reference the RuleBase, so it suddenly makes that a
> little heavy. I'm thinking of removing that method and also combining
> it with the ability to specify only which inserted objects and set
> globals are exported as part of a StatelessSessionResult, if not
> specified all inserted objects will be made available and no globals.
> I'm not sure that querries make any sense on a stateless session
> anyway, only stateful.
> This is an API change (removing getQueryResult), and if people are
> using it I will leave as is, but I'm not sure if anyone will be using
> that anyway. What do people think?
> rules-dev mailing list
Actually there may be a compromise. getQueryResults() can be left, but
only works if you don't serialise, once we seriaise that method
becomes Disabled as the ruleBase and WorkingMemory are lost. I think
that will work and allow me to achieve the best of both worlds,
without breaking the API.
rules-dev mailing list