I need some advice on how to write a rule for the following case. First, here are my facts:
SessionClock($now : new Date(getCurrentTime()))
ClickEvent( $userId : userId, $productId : productId, $event : "FAVORITE" / "REMOVE_FAVORITE" )
Product($id : id, $endDate : endDate)
Purchase ( $userId : userId, $purchasedProducts : purchasedProducts )
where purchasedProducts
is a List
of:
PurchasedProduct( $id : id, $price : price)
Now I would like to send a notification everytime at a particular hour:
- Today is the endDate of a product and
- User has favorited but hasn't unfavorited the product (from
ClickEvent
) and - User hasn't bought the product (from
Purchase
) and - Include all such products in one notification (basically I need to
collect
products)
I appreciate any help on this.
Thanks in advance!