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

Wolfgang Laun wolfgang.laun at gmail.com
Fri Apr 29 04:35:18 EDT 2011


You can call
  FactHandle fh = kSession.getFactHandle( factObj );


   query "alarmExists"  (AlarmFact key)
should work in 5.1.1 and 5.2. Did you import AlarmFact in the DRL?
Otherwise, what message are you getting in which version?

-W

2011/4/29 Manuel Ortiz <manuel.ortizramos at gmail.com>

> 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.
>
>
> _______________________________________________
> 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/20110429/f6e7f633/attachment.html 


More information about the rules-users mailing list