I am lookin for some articles in internet, googling, but so far have found nothing too explicit about my need.
I want to do a - for my perception - not so simple evaluation of a case.
rule "Send email E-mail based on rule evaluation"
/*
If
kind is equal 1 or 2 AND
code is equal 1 or 341 AND
payment is equal S
I do whatever I need to do
*/
when
$item : Item((kind == 1 || kind == 2 ),(code == 1 || code == 341),payment = S);
then
//do whatever I need to do
end
The difficulty is to add a new evaluation condition that works like a date limit (latest business day and hence it is not static) and must be supplied by my code to feed the rule (using kSession.insert ?) and then compare if a issueDate from item is smaller (is a date before my latest business day supplied) to do whatever I need to do.
Is it possible? How?