[rules-users] Drools Queries with relation to the LHS and RHS syntax of the rule

Dibya dibya.tcs at gmail.com
Thu Aug 11 05:25:30 EDT 2011


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).

I want to use the 'named value' (for example 'Drools')  to compareit with
some value in drl(frame the LHS of the rule) ,then how best I can achieve
it. It is not possible to define the POJO classes having get and set methods
for the object.

I tried to achieve the above functionality with the one mentioned by me
below. I see a corrections that was suggested in the 'then' part ..but I was
bit more worried on the 'when'part to accomplish my requirement. Could
someone help here ?

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.

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.



More information about the rules-users mailing list