On 11 August 2011 11:25, Dibya <dibya.tcs@gmail.com> wrote:
Just to clarify ..

1. The fact ,that will be send from my appl ,will be having a list of name
value pairs like

Name                  Value
----------            -------------------

Drools                  ABC
Java                     XYZ
Pega                     false
TimeOut                60

I have already java classes in my application which returns the value (when
by pass the 'named string' to it)

Eg : If I pass the named value as 'TimeOut' with a java method in my appl
,the method replies with value as '60' for the above object  (datatype
pertaining to the 'named value' will be returned..hence have different
menthods to handle it).

This should do it:

   $proj : Project()
   eval ($proj.getStringValue("Drools").equals ("ABC"))

Where Java permits it, you can also compare using operators:
   eval ($proj.getIntValue("Timeout") == 60 ))


2 . Second requirement is to pass the object ('projRes ') back to my
application .

To do this ,I tried to set the java object (referred here as 'projRes') for
holding the result part of the drl and set it in WM using setGlobal().
Then I declare the same object in the 'global' part of the rule and use it
in RHS of the rule.

If it is a global, you cannot use modify; just call the setter in the usual
(Java) way. modify is required for and restricted to facts in working memory.

-W
 

Could anyone clarify ,if I can achieve the second requiremnt in this way
(or) is there a bteer way todo it ?

BR
D

--
View this message in context: http://drools.46999.n3.nabble.com/Drools-Queries-with-relation-to-the-LHS-and-RHS-syntax-of-the-rule-tp3244097p3245343.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users