[rules-users] Support for dynamic / ad-hoc queries in Drools

Wolfgang Laun wolfgang.laun at gmail.com
Wed Jun 27 13:57:32 EDT 2012


On 27 June 2012 19:23, Davide Sottara <dsotty at gmail.com> wrote:

> This would be a special case of a dynamic knowledge artifact (queries,
> rules,
> processes, etc..) being added to a knowledge base. The "low-level", runtime
> addition of an artifact is possible, so it would just need to be exposed in
> a more convenient way in the API.
>

As for a single query, there isn't much you can offload into some
additional API method.
And I think that you have to be careful to use equivalent
KnowledgeBuilders. I haven't
checked this but I think that you can create some inconsistencies by using
a builder
with different options. As it stands now, you can do a dynamic query in
less than 30 LOC.

-W


>
> Another (interesting) option would be to expose this feature at the
> KnowledgeAgent level, allowing dynamic, in-memory "(bytearray) resources".
> The added valye here is that the KA would ALSO be tracking the "resource"
> for modification and removal.
>
> Could you please open a Feature Request JIRA? We'll then discuss it and
> implement it.
> I have similar use cases and would be happy to sponsor it :)
> Davide
>
> p.s. as for the dynamic invocation a query you can do
> drools.getWorkingMemory().getQueryResults( ... );
> in the RHS of a rule
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Support-for-dynamic-ad-hoc-queries-in-Drools-tp4018281p4018301.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20120627/94b44420/attachment.html 


More information about the rules-users mailing list