Iterator shipmentPlansIt = shipmentPlans.iterator();
while (shipmentPlansIt.hasNext()) {
GenericValue shipmentPlan = (GenericValue)shipmentPlansIt.next();
GenericValue orderItem = shipmentPlan.getRelatedOne("OrderItem");
List productionRuns = delegator.findByAndCache("WorkOrderItemFulfillment", UtilMisc.toMap("orderId", shipmentPlan.getString("orderId"), "orderItemSeqId", shipmentPlan.getString("orderItemSeqId")));
if (productionRuns != null && productionRuns.size() > 0) {
Debug.logError("Production Run for order item (" + orderItem.getString("orderId") + "/" + orderItem.getString("orderItemSeqId") + ") not created.", module);
continue;
}
Map result = dispatcher.runSync("createProductionRunsForOrder", UtilMisc.toMap("quantity", shipmentPlan.getDouble("quantity"), "orderId", shipmentPlan.getString("orderId"), "orderItemSeqId", shipmentPlan.getString("orderItemSeqId"), "shipmentId", shipmentId, "userLogin", userLogin));