[rules-users] RE: Problems with Decision Table

helidesai heli.desai at talbotuw.com
Thu Feb 22 05:58:52 EST 2007


Hi Jeff,

Thanks for your reply. I put eval(obj1.getDateField().before(new Date()) ==
$1) in CONDITION column. But Rule engine just ignore this rule and doesn't
display anything in DRL. I think may be because I have not put any value in 
data field. What value should I put in data field ? 

I think eval returns true or false? I have read in manual but couldn't
understand its use.

I just want to check that  if Obj1.getDateField().before(new Date())  == 
true  then print msg. so $1 can be true or false. But when I put "true" or
"false" in data field, it gives error.

Please let me know about this. 

Regards,
Heli.


Grimshaw, Jeffrey wrote:
> 
> Hi Heli.  I was doing something similar in a DT and it took ages to
> figure it out.  I was trying to compare dates from two different bound
> objects.  I wanted to know if one date was later than the other.  To
> compund the problem, the value in the condition cell (the user editable
> part) needed to be true or false.  I ended up putting the whole thing in
> an eval() statement like this:
> 
> eval(obj1.getDate().before(obj2.getDate()) == $1)
> 
> Using similar logic, yours might look like this:
> 
> eval(obj1.getDateField().before(new Date()) == $1)
> 
> The construct new Date() should be the current date/time.  The eval()
> statement will return either true or false, so put that in your
> condition cell.  Hope this helps.
> 
> 
> --Jeff
> 
> 
> -----Original Message-----
> From: rules-users-bounces at lists.jboss.org
> [mailto:rules-users-bounces at lists.jboss.org] On Behalf Of helidesai
> Sent: Wednesday, February 21, 2007 7:41 AM
> To: rules-users at lists.jboss.org
> Subject: [rules-users] Problems with Decision Table
> 
> 
> Hello,
> 
> I am using JBoss Rules 3.1.0M1. I am using the decision table. I don't
> know how we can check something like DateField <= currentDate? I have
> tried to put Today() in data column and in condition I have put DueDt <=
> $1. But this gives error that 'Unexpected Token' .Is there any way to
> put current date like new Date() in Dicision table.
> 
> Also I noticed that the 'Or' condition doesn't work properly. For
> example if i have to enter the condition like "Policy is Live or Policy
> is Cancelled"
> do this 'Msg'.  I have to repeat the Action (Msg) field for both the
> rows with live and cancelled. Is there any other way to implement 'Or'?
> 
> Another thing is can we use the condition without passing the data
> field?
> For example if I put DueDt <= new java.util.Date() in condition table
> and no fields in data column, will it work?
> 
> Please let me know.
> 
> Regards,
> Heli. 
> --
> View this message in context:
> http://www.nabble.com/Problems-with-Decision-Table-tf3267439.html#a90831
> 03
> Sent from the drools - user mailing list archive at Nabble.com.
> 
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
> 
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
> 
> 

-- 
View this message in context: http://www.nabble.com/Problems-with-Decision-Table-tf3267439.html#a9097620
Sent from the drools - user mailing list archive at Nabble.com.




More information about the rules-users mailing list