I have the rule set up as follows, but the rule does not fire.
rule file:
package test
import test.Field;
rule "test date literal"
when
field : Field(dateValue >= "06-Nov-2005")
then
System.out.println("**Rule fired**");
end
java class:
package test;
import java.util.Date;
public Field
{
protected Date dateValue;
public Date getDateValue()
{
return dateValue;
}
public void setDateValue(Date dateValue)
{
this.dateValue = dateValue;
}
}
Before firing the rule, I assert the Field object as follows:
.....
Field field = new Field();
SimpleDateFormat sf = new SimpleDateFormat("dd-MMM-yyyy");
field.setDateValue(sf.parse("06-Nov-2005));
workingMemory.assertObject(field);
workingMemory.fireAllRules();
.....
I am using 4.0 MR2. Can anyone please let me know how to resolve this?
Thank you.
Show replies by date