On 11 August 2011 11:25, Dibya <span dir="ltr">&lt;<a href="mailto:dibya.tcs@gmail.com">dibya.tcs@gmail.com</a>&gt;</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 &#39;named string&#39; to it)<br>
<br>
Eg : If I pass the named value as &#39;TimeOut&#39; with a java method in my appl<br>
,the method replies with value as &#39;60&#39; for the above object  (datatype<br>
pertaining to the &#39;named value&#39; 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(&quot;Drools&quot;).equals (&quot;ABC&quot;))<br><br>Where Java permits it, you can also compare using operators: <br>
   eval ($proj.getIntValue(&quot;Timeout&quot;) == 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 (&#39;projRes &#39;) back to my<br>
application .<br>
<br>
To do this ,I tried to set the java object (referred here as &#39;projRes&#39;) 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 &#39;global&#39; 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>