[rules-users] Problems with Decision Table

Grimshaw, Jeffrey Jeffrey.Grimshaw at greenpoint.com
Wed Feb 21 12:57:24 EST 2007


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




More information about the rules-users mailing list