if (UtilValidate.isNotEmpty(shipGroupSeqId)) {
existingProductionRuns = delegator.findByAndCache("WorkOrderItemFulfillment",
UtilMisc.toMap("orderId", orderItemOrShipGroupAssoc.getString("orderId"),
"orderItemSeqId", orderItemOrShipGroupAssoc.getString("orderItemSeqId"), "shipGroupSeqId", shipGroupSeqId));
} else {
existingProductionRuns = delegator.findByAndCache("WorkOrderItemFulfillment",
UtilMisc.toMap("orderId", orderItemOrShipGroupAssoc.getString("orderId"),
"orderItemSeqId", orderItemOrShipGroupAssoc.getString("orderItemSeqId")));
}
if (UtilValidate.isNotEmpty(existingProductionRuns)) {
Debug.logWarning("Production Run for order item [" + orderItemOrShipGroupAssoc.getString("orderId") + "/" + orderItemOrShipGroupAssoc.getString("orderItemSeqId") + "] and ship group [" + shipGroupSeqId + "] already exists.", module);