I am trying to call Drools Json api and one of my facts is of type Date. I am not sure how to construct the json string for that. !!!!????????? :(
here is what I have:
my drl file: package com.beachmint.common
declare Order orderId: Integer customerId: Integer total: java.math.BigDecimal cartId: Integer createdAt: java.util.Date productIds: java.util.ArrayList end
declare Customer customerId: Integer referrerId: Integer customerStatus: Integer createdAt: java.util.Date end
declare Points status: String count: Integer customerId: Integer reason: String ruleId: String end
declare Event name: String storeId: Integer end
rule 'Purchase Promo' dialect "mvel" when e : Event( name matches "Purchase" ) o : Order( total > 0 , createdAt > "08-Oct-2012" , createdAt <= "01-Jan-2013" )
then p.setCount( p.getCount() + 2000 );
I tried sending the date as UTC and string ('y-M-d) format.
createdAt":{"date":"2012-Jan-01"} createdAt": 1351637683 createdAt": "2012-Jan-01"
none of these work :(