On 11 August 2011 11:25, Dibya <span dir="ltr"><<a href="mailto:dibya.tcs@gmail.com">dibya.tcs@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Just to clarify ..<br>
<br>
1. The fact ,that will be send from my appl ,will be having a list of name<br>
value pairs like<br>
<br>
Name Value<br>
---------- -------------------<br>
<br>
Drools ABC<br>
Java XYZ<br>
Pega false<br>
TimeOut 60<br>
<br>
I have already java classes in my application which returns the value (when<br>
by pass the 'named string' to it)<br>
<br>
Eg : If I pass the named value as 'TimeOut' with a java method in my appl<br>
,the method replies with value as '60' for the above object (datatype<br>
pertaining to the 'named value' will be returned..hence have different<br>
menthods to handle it).<br></blockquote><div><br>This should do it:<br><br> $proj : Project()<br> eval ($proj.getStringValue("Drools").equals ("ABC"))<br><br>Where Java permits it, you can also compare using operators: <br>
eval ($proj.getIntValue("Timeout") == 60 ))<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
2 . Second requirement is to pass the object ('projRes ') back to my<br>
application .<br>
<br>
To do this ,I tried to set the java object (referred here as 'projRes') for<br>
holding the result part of the drl and set it in WM using setGlobal().<br>
Then I declare the same object in the 'global' part of the rule and use it<br>
in RHS of the rule.<br></blockquote><div><br>If it is a global, you cannot use modify; just call the setter in the usual<br>(Java) way. modify is required for and restricted to facts in working memory.<br><br>-W<br> </div>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Could anyone clarify ,if I can achieve the second requiremnt in this way<br>
(or) is there a bteer way todo it ?<br>
<br>
BR<br>
D<br>
<font color="#888888"><br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/Drools-Queries-with-relation-to-the-LHS-and-RHS-syntax-of-the-rule-tp3244097p3245343.html" target="_blank">http://drools.46999.n3.nabble.com/Drools-Queries-with-relation-to-the-LHS-and-RHS-syntax-of-the-rule-tp3244097p3245343.html</a><br>
Sent from the Drools: User forum mailing list archive at Nabble.com.<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>
</font></blockquote></div><br>