71: and wjsi.wip_entity_id = wdj.wip_entity_id
72: and wdj.status_type in (wip_constants.released, wip_constants.hold);
73:
74: begin
75: x_returnStatus := fnd_api.g_ret_sts_success;
76: if (l_logLevel <= wip_constants.trace_logging) then
77: l_params(1).paramName := 'p_groupID';
78: l_params(1).paramValue := p_groupID;
79: l_params(2).paramName := 'p_validationLevel';
80: l_params(2).paramValue := p_validationLevel;
81: wip_logger.entryPoint(p_procName => g_pkgName || '.' || l_procName,
82: p_params => l_params,
83: x_returnStatus => x_returnStatus);
84: if(x_returnStatus <> fnd_api.g_ret_sts_success) then
85: raise fnd_api.g_exc_unexpected_error;
86: end if;
87: end if;
88:
81: wip_logger.entryPoint(p_procName => g_pkgName || '.' || l_procName,
82: p_params => l_params,
83: x_returnStatus => x_returnStatus);
84: if(x_returnStatus <> fnd_api.g_ret_sts_success) then
85: raise fnd_api.g_exc_unexpected_error;
86: end if;
87: end if;
88:
89: -- print the no.of discrete requests to log
126: wip_validateMLHeader_pvt.validateMLHeader(p_groupID => p_groupID,
127: p_validationLevel => p_validationLevel,
128: x_returnStatus => x_returnStatus,
129: x_errorMsg => x_errorMsg);
130: if ( x_returnStatus <> fnd_api.g_ret_sts_success ) then
131: raise fnd_api.g_exc_unexpected_error;
132: end if;
133:
134: -- process every row which pass validation
127: p_validationLevel => p_validationLevel,
128: x_returnStatus => x_returnStatus,
129: x_errorMsg => x_errorMsg);
130: if ( x_returnStatus <> fnd_api.g_ret_sts_success ) then
131: raise fnd_api.g_exc_unexpected_error;
132: end if;
133:
134: -- process every row which pass validation
135: for wjsi_rec in c_wjsi loop
147: end if;
148: /*8494582 End*/
149:
150: wip_massload_pvt.processWJSI(wjsi_rec.rowid, l_retStatus, x_errorMsg);
151: if ( l_retStatus <> fnd_api.g_ret_sts_success ) then
152: raise fnd_api.g_exc_unexpected_error;
153: end if;
154:
155: select count(*)
148: /*8494582 End*/
149:
150: wip_massload_pvt.processWJSI(wjsi_rec.rowid, l_retStatus, x_errorMsg);
151: if ( l_retStatus <> fnd_api.g_ret_sts_success ) then
152: raise fnd_api.g_exc_unexpected_error;
153: end if;
154:
155: select count(*)
156: into l_totalNum
175: p_std_alone => 0,
176: x_err_code => l_errorCode,
177: x_err_msg => x_errorMsg,
178: x_return_status => l_retStatus);
179: if ( l_retStatus <> fnd_api.g_ret_sts_success ) then
180: raise fnd_api.g_exc_unexpected_error;
181: end if;
182: end if;
183:
176: x_err_code => l_errorCode,
177: x_err_msg => x_errorMsg,
178: x_return_status => l_retStatus);
179: if ( l_retStatus <> fnd_api.g_ret_sts_success ) then
180: raise fnd_api.g_exc_unexpected_error;
181: end if;
182: end if;
183:
184: -- only here an we do validation for serialization_start_op because it depends on the routing
186: processSerStartOp(wjsi_rec.rowid,
187: wjsi_rec.interface_id,
188: l_retStatus,
189: x_errorMsg);
190: if ( l_retStatus <> fnd_api.g_ret_sts_success ) then
191: raise fnd_api.g_exc_unexpected_error;
192: end if;
193:
194: /* Fix 8296679: Moved this code from wip_massload_pvt.processWJSI to release the job
187: wjsi_rec.interface_id,
188: l_retStatus,
189: x_errorMsg);
190: if ( l_retStatus <> fnd_api.g_ret_sts_success ) then
191: raise fnd_api.g_exc_unexpected_error;
192: end if;
193:
194: /* Fix 8296679: Moved this code from wip_massload_pvt.processWJSI to release the job
195: after loading operation from WJDI to populate quantity in queue of the first operation
206: x_errorMsg,
207: nvl(wjsi_rec.date_released, sysdate));
208:
209: if ( l_success = 0 ) then
210: raise fnd_api.g_exc_unexpected_error;
211: end if;
212: end if;
213: /* End Fix 8296679 */
214:
248: x_errorMsg := fnd_message.get;
249: if (l_logLevel <= wip_constants.trace_logging) then
250: wip_logger.log('calling wip_osp.release_validation failed in wip_massload_pub.massLoadJobs', l_retStatus);
251: end if;
252: raise fnd_api.g_exc_unexpected_error;
253: end;
254: end if ;
255: end if ;
256: /*6641029 End*/
263: commit;
264: end if;
265:
266: exception
267: when fnd_api.g_exc_unexpected_error then
268: rollback to wip_massload_start;
269: wip_validateMLHeader_pvt.setInterfaceError(wjsi_rec.rowid,
270: wjsi_rec.interface_id,
271: x_errorMsg,
346: where group_id = p_groupID
347: and process_status = wip_constants.error;
348:
349: if(l_errRecCount > 0) then
350: x_returnStatus := fnd_api.g_ret_sts_error;
351: else
352: x_returnStatus := fnd_api.g_ret_sts_success;
353: end if;
354:
348:
349: if(l_errRecCount > 0) then
350: x_returnStatus := fnd_api.g_ret_sts_error;
351: else
352: x_returnStatus := fnd_api.g_ret_sts_success;
353: end if;
354:
355: if (l_logLevel <= wip_constants.trace_logging) then
356: wip_logger.exitPoint(p_procName => g_pkgName || '.' || l_procName,
359: x_returnStatus => l_retStatus);
360: end if;
361: exception
362: when wip_constants.records_locked then
363: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
364: if (l_logLevel <= wip_constants.trace_logging) then
365: wip_logger.exitPoint(p_procName => g_pkgName || '.' || l_procName,
366: p_procReturnStatus => x_returnStatus,
367: p_msg => 'records locked',
368: x_returnStatus => l_retStatus);
369: end if;
370: fnd_message.set_name('WIP', 'WIP_LOCKED_ROW_ALREADY_LOCKED');
371: x_errorMsg := fnd_message.get;
372: when fnd_api.g_exc_unexpected_error then
373: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
374: if (l_logLevel <= wip_constants.trace_logging) then
375: wip_logger.exitPoint(p_procName => g_pkgName || '.' || l_procName,
376: p_procReturnStatus => x_returnStatus,
369: end if;
370: fnd_message.set_name('WIP', 'WIP_LOCKED_ROW_ALREADY_LOCKED');
371: x_errorMsg := fnd_message.get;
372: when fnd_api.g_exc_unexpected_error then
373: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
374: if (l_logLevel <= wip_constants.trace_logging) then
375: wip_logger.exitPoint(p_procName => g_pkgName || '.' || l_procName,
376: p_procReturnStatus => x_returnStatus,
377: p_msg => x_errorMsg,
378: x_returnStatus => l_retStatus);
379: end if;
380: /*Bug 16529960: Add exception handler to log any unexpected exception*/
381: when others then
382: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
383: if (l_logLevel <= wip_constants.trace_logging) then
384: wip_logger.exitPoint(p_procName => g_pkgName || '.' || l_procName,
385: p_procReturnStatus => x_returnStatus,
386: p_msg => 'unexp error: ' || SQLERRM,
419: from wip_job_schedule_interface
420: where interface_id = p_interfaceID
421: for update nowait;
422: begin
423: x_returnStatus := fnd_api.g_ret_sts_success;
424: if (l_logLevel <= wip_constants.trace_logging) then
425: l_params(1).paramName := 'p_interfaceID';
426: l_params(1).paramValue := p_interfaceID;
427: l_params(2).paramName := 'p_validationLevel';
428: l_params(2).paramValue := p_validationLevel;
429: wip_logger.entryPoint(p_procName => g_pkgName || '.' || l_procName,
430: p_params => l_params,
431: x_returnStatus => x_returnStatus);
432: if(x_returnStatus <> fnd_api.g_ret_sts_success) then
433: raise fnd_api.g_exc_unexpected_error;
434: end if;
435: end if;
436:
429: wip_logger.entryPoint(p_procName => g_pkgName || '.' || l_procName,
430: p_params => l_params,
431: x_returnStatus => x_returnStatus);
432: if(x_returnStatus <> fnd_api.g_ret_sts_success) then
433: raise fnd_api.g_exc_unexpected_error;
434: end if;
435: end if;
436:
437: select rowid, group_id, header_id
449:
450: if ( l_totalNum <> 1 ) then
451: fnd_message.set_name('WIP', 'WIP_WJSI_ONE_ROW');
452: x_errorMsg := fnd_message.get;
453: raise fnd_api.g_exc_unexpected_error;
454: end if;
455:
456: select count(*)
457: into l_totalNum
460:
461: if ( l_totalNum <> 1 ) then
462: fnd_message.set_name('WIP', 'WIP_WJSI_ONE_ROW');
463: x_errorMsg := fnd_message.get;
464: raise fnd_api.g_exc_unexpected_error;
465: end if;
466:
467: -- lock all the records
468: open c_allrows;
478: wip_validateMLHeader_pvt.validateMLHeader(p_groupID => l_groupID,
479: p_validationLevel => p_validationLevel,
480: x_returnStatus => x_returnStatus,
481: x_errorMsg => x_errorMsg);
482: if ( x_returnStatus <> fnd_api.g_ret_sts_success ) then
483: raise fnd_api.g_exc_unexpected_error;
484: end if;
485:
486: select count(*)
479: p_validationLevel => p_validationLevel,
480: x_returnStatus => x_returnStatus,
481: x_errorMsg => x_errorMsg);
482: if ( x_returnStatus <> fnd_api.g_ret_sts_success ) then
483: raise fnd_api.g_exc_unexpected_error;
484: end if;
485:
486: select count(*)
487: into l_totalNum
491:
492: if ( l_totalNum <> 1 ) then
493: fnd_message.set_name('WIP', 'WIP_WJSI_VAL_FAILED');
494: x_errorMsg := fnd_message.get;
495: raise fnd_api.g_exc_unexpected_error;
496: end if;
497:
498: wip_massload_pvt.processWJSI(l_rowid, x_returnStatus, x_errorMsg);
499: if ( x_returnStatus <> fnd_api.g_ret_sts_success ) then
495: raise fnd_api.g_exc_unexpected_error;
496: end if;
497:
498: wip_massload_pvt.processWJSI(l_rowid, x_returnStatus, x_errorMsg);
499: if ( x_returnStatus <> fnd_api.g_ret_sts_success ) then
500: raise fnd_api.g_exc_unexpected_error;
501: end if;
502:
503: select count(*)
496: end if;
497:
498: wip_massload_pvt.processWJSI(l_rowid, x_returnStatus, x_errorMsg);
499: if ( x_returnStatus <> fnd_api.g_ret_sts_success ) then
500: raise fnd_api.g_exc_unexpected_error;
501: end if;
502:
503: select count(*)
504: into l_totalNum
520: p_std_alone => 0,
521: x_err_code => l_errorCode,
522: x_err_msg => x_errorMsg,
523: x_return_status => l_retStatus);
524: if ( l_retStatus <> fnd_api.g_ret_sts_success ) then
525: raise fnd_api.g_exc_unexpected_error;
526: end if;
527: end if;
528:
521: x_err_code => l_errorCode,
522: x_err_msg => x_errorMsg,
523: x_return_status => l_retStatus);
524: if ( l_retStatus <> fnd_api.g_ret_sts_success ) then
525: raise fnd_api.g_exc_unexpected_error;
526: end if;
527: end if;
528:
529: -- only here an we do validation for serialization_start_op because it depends on the routing
531: processSerStartOp(l_rowid,
532: p_interfaceID,
533: l_retStatus,
534: x_errorMsg);
535: if ( l_retStatus <> fnd_api.g_ret_sts_success ) then
536: raise fnd_api.g_exc_unexpected_error;
537: end if;
538:
539: select wip_entity_id,
532: p_interfaceID,
533: l_retStatus,
534: x_errorMsg);
535: if ( l_retStatus <> fnd_api.g_ret_sts_success ) then
536: raise fnd_api.g_exc_unexpected_error;
537: end if;
538:
539: select wip_entity_id,
540: load_type, status_type, organization_id, class_code, date_released --8936011
559: x_errorMsg,
560: nvl(l_date_released, sysdate));
561:
562: if ( l_success = 0 ) then
563: raise fnd_api.g_exc_unexpected_error;
564: end if;
565: end if;
566:
567: /* End Fix 8936011 */
577: x_returnStatus => l_retStatus);
578: end if;
579: exception
580: when wip_constants.records_locked then
581: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
582: fnd_message.set_name('WIP', 'WIP_LOCKED_ROW_ALREADY_LOCKED');
583: x_errorMsg := fnd_message.get;
584: wip_validateMLHeader_pvt.setInterfaceError(l_rowid,
585: p_interfaceID,
590: p_procReturnStatus => x_returnStatus,
591: p_msg => 'records locked',
592: x_returnStatus => l_retStatus);
593: end if;
594: when fnd_api.g_exc_unexpected_error then
595: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
596: wip_validateMLHeader_pvt.setInterfaceError(l_rowid,
597: p_interfaceID,
598: x_errorMsg,
591: p_msg => 'records locked',
592: x_returnStatus => l_retStatus);
593: end if;
594: when fnd_api.g_exc_unexpected_error then
595: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
596: wip_validateMLHeader_pvt.setInterfaceError(l_rowid,
597: p_interfaceID,
598: x_errorMsg,
599: g_wipMLError);
628: from wip_operations
629: where wip_entity_id = v_wipEntityID;
630:
631: begin
632: x_returnStatus := fnd_api.g_ret_sts_success;
633: l_msg := 'WIP_ML_SERIAL_START_OP';
634:
635: select wip_entity_id,
636: serialization_start_op,
713: close c_ops;
714:
715: --The routing exists, but an invalid op seq was provided
716: if ( l_rtgExists and not l_opFound ) then
717: raise fnd_api.g_exc_unexpected_error;
718: end if;
719:
720: --If no routing exsts, the serialization op must be 1.
721: if ( not l_rtgExists and l_wdjSerOp <> 1 ) then
718: end if;
719:
720: --If no routing exsts, the serialization op must be 1.
721: if ( not l_rtgExists and l_wdjSerOp <> 1 ) then
722: raise fnd_api.g_exc_unexpected_error;
723: end if;
724:
725: --job must be unreleased to change the serialization op on a reschedule request.
726: if ( l_loadType = wip_constants.resched_job and l_wjsiSerOp is not null ) then
736: p_wip_entity_id => l_wipEntityID,
737: p_organization_id => l_orgID,
738: x_err_msg => x_errorMsg,
739: x_return_status => x_returnStatus);
740: if ( x_returnStatus <> fnd_api.g_ret_sts_success ) then
741: raise fnd_api.g_exc_unexpected_error;
742: end if;
743: exception
744: when others then
737: p_organization_id => l_orgID,
738: x_err_msg => x_errorMsg,
739: x_return_status => x_returnStatus);
740: if ( x_returnStatus <> fnd_api.g_ret_sts_success ) then
741: raise fnd_api.g_exc_unexpected_error;
742: end if;
743: exception
744: when others then
745: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
741: raise fnd_api.g_exc_unexpected_error;
742: end if;
743: exception
744: when others then
745: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
746: fnd_message.set_name('WIP', l_msg);
747: if ( l_msg = 'WIP_ML_SER_DEF_FAILURE' ) then
748: fnd_message.set_token('MESSAGE', x_errorMsg);
749: end if;