Timestamp orderCreatedDate = (Timestamp) context.get("orderCreatedDate");
if (orderCreatedDate == null) {
orderCreatedDate = UtilDateTime.nowTimestamp();
}
try {
List productSubscriptionResourceList = delegator.findByAndCache("ProductSubscriptionResource", UtilMisc.toMap("productId", productId));
productSubscriptionResourceList = EntityUtil.filterByDate(productSubscriptionResourceList, orderCreatedDate, null, null, true);
productSubscriptionResourceList = EntityUtil.filterByDate(productSubscriptionResourceList, orderCreatedDate, "purchaseFromDate", "purchaseThruDate", true);
if (productSubscriptionResourceList.size() == 0) {
String msg = "No ProductSubscriptionResource found for productId: " + productId;