[rules-users] New in Drools: Updating facts retrieved in queries

Manuel Ortiz manuel.ortizramos at gmail.com
Fri Apr 29 03:34:52 EDT 2011


Hello everybody:

I have two question related to queries:

First one, the one in the subject, I have a query which retrieves facts
which have to be modified and updated in working memory. I've seen that
the StatefulKnowledgeSession.update() method has the fact handle as input.
Is it possible to set the fact handle to null? If it isn't, how can I get
the fact handle using the fact retrieved with the query?

Second one, related to writing, I though of parameterizing the query using
the fact pattern, something like this,

query "alarmExists"  (AlarmFact key)
    $alarm : AlarmFact(key1 == key.key1,
                   key2 == key.key2,
                   key3 == key.key3
                   )

end



but the rule compiler doesn't accept this sintax. Is it a requirement that
query parameters are basic java types or is there a way to write this query
using more complex Object parameters?

Thank you for your time.

Best Regards,

Manuel Ortiz.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20110429/3fc754b6/attachment.html 


More information about the rules-users mailing list