You can call<br> FactHandle fh = kSession.getFactHandle( factObj );<br><br><br> query "alarmExists" (AlarmFact key)<br>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?<br>
<br>-W<br><br><div class="gmail_quote">2011/4/29 Manuel Ortiz <span dir="ltr"><<a href="mailto:manuel.ortizramos@gmail.com">manuel.ortizramos@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello everybody:<div><br></div><div>I have two question related to queries:</div><div><br></div><div>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?</div>
<div><br></div><div>Second one, related to writing, I though of parameterizing the query using the fact pattern, something like this, </div><div><br></div><div><div>query "alarmExists" (AlarmFact key)</div><div>
$alarm : AlarmFact(key1 == key.key1,</div><div> key2 == key.key2,</div><div> key3 == key.key3</div><div> )</div><div><br></div><div>end</div></div><div><br></div>
<div>
<br></div><div><br></div><div>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?</div>
<div><br></div><div>Thank you for your time.</div><div><br></div><div>Best Regards,</div><div><br></div><font color="#888888"><div>Manuel Ortiz.</div><div><br></div>
</font><br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br>