[rules-users] How to add java logics in the LHS of a rule ?

carnelk carmelk at il.ibm.com
Sun Apr 24 00:45:35 EDT 2011


Hi,


I have to rule below.
This rule finds the minimal date of a 'B object' that is still AFTER the
startDate of $aObject.
I would like it to find the minimal date of B that is at least 7 days after
the startDate of $aObject
(and perhaps no more then 14 days after).
For that I would need to add some java logics instead of  line <9> to
manipulate the date with java,
wouldn't I?

Does anyone have any creative solution for that ???


1 rule "first measurement < 7 days> after the treatment"
2 salience 9
3 when
4	$aObject :  A ( )
5	$minDate : Number()
6		from accumulate ( B ( 
7                      # I would like to change the following line to
manipulate $aObject.startDate
8                        # to be '$aObject.startDate + 7 days'
9			date > $aObject.startDate,
10			$bpDate : date),
11			min($bpDate.getTime()) ) 
12			
13 then
14    # do something ....
15 end


Much thanks,
Carmel.

--
View this message in context: http://drools.46999.n3.nabble.com/How-to-add-java-logics-in-the-LHS-of-a-rule-tp2857022p2857022.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list