serviceContext.put("facilityId", facilityId);
serviceContext.put("userLogin", userLogin);
resultService = null;
try {
resultService = dispatcher.runSync("createProductionRunsForProductBom", serviceContext);
GenericValue workEffortPreDecessor = delegator.makeValue("WorkEffortAssoc", UtilMisc.toMap(
"workEffortIdTo", productionRunId, "workEffortIdFrom", resultService.get("productionRunId"),
"workEffortAssocTypeId", "WORK_EFF_PRECEDENCY", "fromDate", UtilDateTime.nowTimestamp()));
workEffortPreDecessor.create();
} catch (GenericServiceException e) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ManufacturingProductionRunNotCreated", locale));