49: and process_phase = wip_constants.ml_validation
50: and process_status in (wip_constants.running, wip_constants.warning)
51: and load_type <> wip_constants.create_sched;
52: begin
53: x_returnStatus := fnd_api.g_ret_sts_success;
54: if (l_logLevel <= wip_constants.trace_logging) then
55: l_params(1).paramName := 'p_groupID';
56: l_params(1).paramValue := p_groupID;
57: l_params(2).paramName := 'p_validationLevel';
58: l_params(2).paramValue := p_validationLevel;
59: wip_logger.entryPoint(p_procName => g_pkgName || '.' || l_procName,
60: p_params => l_params,
61: x_returnStatus => x_returnStatus);
62: if(x_returnStatus <> fnd_api.g_ret_sts_success) then
63: raise fnd_api.g_exc_unexpected_error;
64: end if;
65: end if;
66:
59: wip_logger.entryPoint(p_procName => g_pkgName || '.' || l_procName,
60: p_params => l_params,
61: x_returnStatus => x_returnStatus);
62: if(x_returnStatus <> fnd_api.g_ret_sts_success) then
63: raise fnd_api.g_exc_unexpected_error;
64: end if;
65: end if;
66:
67: -- print the no.of discrete requests to log
104: wip_validateMLHeader_pvt.validateMLHeader(p_groupID => p_groupID,
105: p_validationLevel => p_validationLevel,
106: x_returnStatus => x_returnStatus,
107: x_errorMsg => x_errorMsg);
108: if ( x_returnStatus <> fnd_api.g_ret_sts_success ) then
109: raise fnd_api.g_exc_unexpected_error;
110: end if;
111:
112: -- process every row which pass validation
105: p_validationLevel => p_validationLevel,
106: x_returnStatus => x_returnStatus,
107: x_errorMsg => x_errorMsg);
108: if ( x_returnStatus <> fnd_api.g_ret_sts_success ) then
109: raise fnd_api.g_exc_unexpected_error;
110: end if;
111:
112: -- process every row which pass validation
113: for wjsi_rec in c_wjsi loop
114: begin
115: savepoint wip_massload_start;
116:
117: wip_massload_pvt.processWJSI(wjsi_rec.rowid, l_retStatus, x_errorMsg);
118: if ( l_retStatus <> fnd_api.g_ret_sts_success ) then
119: raise fnd_api.g_exc_unexpected_error;
120: end if;
121:
122: select count(*)
115: savepoint wip_massload_start;
116:
117: wip_massload_pvt.processWJSI(wjsi_rec.rowid, l_retStatus, x_errorMsg);
118: if ( l_retStatus <> fnd_api.g_ret_sts_success ) then
119: raise fnd_api.g_exc_unexpected_error;
120: end if;
121:
122: select count(*)
123: into l_totalNum
142: p_std_alone => 0,
143: x_err_code => l_errorCode,
144: x_err_msg => x_errorMsg,
145: x_return_status => l_retStatus);
146: if ( l_retStatus <> fnd_api.g_ret_sts_success ) then
147: raise fnd_api.g_exc_unexpected_error;
148: end if;
149: end if;
150:
143: x_err_code => l_errorCode,
144: x_err_msg => x_errorMsg,
145: x_return_status => l_retStatus);
146: if ( l_retStatus <> fnd_api.g_ret_sts_success ) then
147: raise fnd_api.g_exc_unexpected_error;
148: end if;
149: end if;
150:
151: -- only here an we do validation for serialization_start_op because it depends on the routing
153: processSerStartOp(wjsi_rec.rowid,
154: wjsi_rec.interface_id,
155: l_retStatus,
156: x_errorMsg);
157: if ( l_retStatus <> fnd_api.g_ret_sts_success ) then
158: raise fnd_api.g_exc_unexpected_error;
159: end if;
160: /*6641029 Start- Added code to create requisition*/
161: select wdj.status_type,
154: wjsi_rec.interface_id,
155: l_retStatus,
156: x_errorMsg);
157: if ( l_retStatus <> fnd_api.g_ret_sts_success ) then
158: raise fnd_api.g_exc_unexpected_error;
159: end if;
160: /*6641029 Start- Added code to create requisition*/
161: select wdj.status_type,
162: wjsi.status_type,
189: end if ;
190: end if ;
191: /*6641029 End*/
192: exception
193: when fnd_api.g_exc_unexpected_error then
194: rollback to wip_massload_start;
195: wip_validateMLHeader_pvt.setInterfaceError(wjsi_rec.rowid,
196: wjsi_rec.interface_id,
197: x_errorMsg,
219: where group_id = p_groupID
220: and process_status = wip_constants.error;
221:
222: if(l_errRecCount > 0) then
223: x_returnStatus := fnd_api.g_ret_sts_error;
224: else
225: x_returnStatus := fnd_api.g_ret_sts_success;
226: end if;
227:
221:
222: if(l_errRecCount > 0) then
223: x_returnStatus := fnd_api.g_ret_sts_error;
224: else
225: x_returnStatus := fnd_api.g_ret_sts_success;
226: end if;
227:
228: if (l_logLevel <= wip_constants.trace_logging) then
229: wip_logger.exitPoint(p_procName => g_pkgName || '.' || l_procName,
232: x_returnStatus => l_retStatus);
233: end if;
234: exception
235: when wip_constants.records_locked then
236: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
237: if (l_logLevel <= wip_constants.trace_logging) then
238: wip_logger.exitPoint(p_procName => g_pkgName || '.' || l_procName,
239: p_procReturnStatus => x_returnStatus,
240: p_msg => 'records locked',
241: x_returnStatus => l_retStatus);
242: end if;
243: fnd_message.set_name('WIP', 'WIP_LOCKED_ROW_ALREADY_LOCKED');
244: x_errorMsg := fnd_message.get;
245: when fnd_api.g_exc_unexpected_error then
246: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
247: if (l_logLevel <= wip_constants.trace_logging) then
248: wip_logger.exitPoint(p_procName => g_pkgName || '.' || l_procName,
249: p_procReturnStatus => x_returnStatus,
242: end if;
243: fnd_message.set_name('WIP', 'WIP_LOCKED_ROW_ALREADY_LOCKED');
244: x_errorMsg := fnd_message.get;
245: when fnd_api.g_exc_unexpected_error then
246: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
247: if (l_logLevel <= wip_constants.trace_logging) then
248: wip_logger.exitPoint(p_procName => g_pkgName || '.' || l_procName,
249: p_procReturnStatus => x_returnStatus,
250: p_msg => x_errorMsg,
276: from wip_job_schedule_interface
277: where interface_id = p_interfaceID
278: for update nowait;
279: begin
280: x_returnStatus := fnd_api.g_ret_sts_success;
281: if (l_logLevel <= wip_constants.trace_logging) then
282: l_params(1).paramName := 'p_interfaceID';
283: l_params(1).paramValue := p_interfaceID;
284: l_params(2).paramName := 'p_validationLevel';
285: l_params(2).paramValue := p_validationLevel;
286: wip_logger.entryPoint(p_procName => g_pkgName || '.' || l_procName,
287: p_params => l_params,
288: x_returnStatus => x_returnStatus);
289: if(x_returnStatus <> fnd_api.g_ret_sts_success) then
290: raise fnd_api.g_exc_unexpected_error;
291: end if;
292: end if;
293:
286: wip_logger.entryPoint(p_procName => g_pkgName || '.' || l_procName,
287: p_params => l_params,
288: x_returnStatus => x_returnStatus);
289: if(x_returnStatus <> fnd_api.g_ret_sts_success) then
290: raise fnd_api.g_exc_unexpected_error;
291: end if;
292: end if;
293:
294: select rowid, group_id, header_id
306:
307: if ( l_totalNum <> 1 ) then
308: fnd_message.set_name('WIP', 'WIP_WJSI_ONE_ROW');
309: x_errorMsg := fnd_message.get;
310: raise fnd_api.g_exc_unexpected_error;
311: end if;
312:
313: select count(*)
314: into l_totalNum
317:
318: if ( l_totalNum <> 1 ) then
319: fnd_message.set_name('WIP', 'WIP_WJSI_ONE_ROW');
320: x_errorMsg := fnd_message.get;
321: raise fnd_api.g_exc_unexpected_error;
322: end if;
323:
324: -- lock all the records
325: open c_allrows;
335: wip_validateMLHeader_pvt.validateMLHeader(p_groupID => l_groupID,
336: p_validationLevel => p_validationLevel,
337: x_returnStatus => x_returnStatus,
338: x_errorMsg => x_errorMsg);
339: if ( x_returnStatus <> fnd_api.g_ret_sts_success ) then
340: raise fnd_api.g_exc_unexpected_error;
341: end if;
342:
343: select count(*)
336: p_validationLevel => p_validationLevel,
337: x_returnStatus => x_returnStatus,
338: x_errorMsg => x_errorMsg);
339: if ( x_returnStatus <> fnd_api.g_ret_sts_success ) then
340: raise fnd_api.g_exc_unexpected_error;
341: end if;
342:
343: select count(*)
344: into l_totalNum
348:
349: if ( l_totalNum <> 1 ) then
350: fnd_message.set_name('WIP', 'WIP_WJSI_VAL_FAILED');
351: x_errorMsg := fnd_message.get;
352: raise fnd_api.g_exc_unexpected_error;
353: end if;
354:
355: wip_massload_pvt.processWJSI(l_rowid, x_returnStatus, x_errorMsg);
356: if ( x_returnStatus <> fnd_api.g_ret_sts_success ) then
352: raise fnd_api.g_exc_unexpected_error;
353: end if;
354:
355: wip_massload_pvt.processWJSI(l_rowid, x_returnStatus, x_errorMsg);
356: if ( x_returnStatus <> fnd_api.g_ret_sts_success ) then
357: raise fnd_api.g_exc_unexpected_error;
358: end if;
359:
360: select count(*)
353: end if;
354:
355: wip_massload_pvt.processWJSI(l_rowid, x_returnStatus, x_errorMsg);
356: if ( x_returnStatus <> fnd_api.g_ret_sts_success ) then
357: raise fnd_api.g_exc_unexpected_error;
358: end if;
359:
360: select count(*)
361: into l_totalNum
377: p_std_alone => 0,
378: x_err_code => l_errorCode,
379: x_err_msg => x_errorMsg,
380: x_return_status => l_retStatus);
381: if ( l_retStatus <> fnd_api.g_ret_sts_success ) then
382: raise fnd_api.g_exc_unexpected_error;
383: end if;
384: end if;
385:
378: x_err_code => l_errorCode,
379: x_err_msg => x_errorMsg,
380: x_return_status => l_retStatus);
381: if ( l_retStatus <> fnd_api.g_ret_sts_success ) then
382: raise fnd_api.g_exc_unexpected_error;
383: end if;
384: end if;
385:
386: -- only here an we do validation for serialization_start_op because it depends on the routing
388: processSerStartOp(l_rowid,
389: p_interfaceID,
390: l_retStatus,
391: x_errorMsg);
392: if ( l_retStatus <> fnd_api.g_ret_sts_success ) then
393: raise fnd_api.g_exc_unexpected_error;
394: end if;
395:
396: select wip_entity_id
389: p_interfaceID,
390: l_retStatus,
391: x_errorMsg);
392: if ( l_retStatus <> fnd_api.g_ret_sts_success ) then
393: raise fnd_api.g_exc_unexpected_error;
394: end if;
395:
396: select wip_entity_id
397: into x_wipEntityID
409: x_returnStatus => l_retStatus);
410: end if;
411: exception
412: when wip_constants.records_locked then
413: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
414: fnd_message.set_name('WIP', 'WIP_LOCKED_ROW_ALREADY_LOCKED');
415: x_errorMsg := fnd_message.get;
416: wip_validateMLHeader_pvt.setInterfaceError(l_rowid,
417: p_interfaceID,
422: p_procReturnStatus => x_returnStatus,
423: p_msg => 'records locked',
424: x_returnStatus => l_retStatus);
425: end if;
426: when fnd_api.g_exc_unexpected_error then
427: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
428: wip_validateMLHeader_pvt.setInterfaceError(l_rowid,
429: p_interfaceID,
430: x_errorMsg,
423: p_msg => 'records locked',
424: x_returnStatus => l_retStatus);
425: end if;
426: when fnd_api.g_exc_unexpected_error then
427: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
428: wip_validateMLHeader_pvt.setInterfaceError(l_rowid,
429: p_interfaceID,
430: x_errorMsg,
431: g_wipMLError);
461: from wip_operations
462: where wip_entity_id = v_wipEntityID;
463:
464: begin
465: x_returnStatus := fnd_api.g_ret_sts_success;
466: l_msg := 'WIP_ML_SERIAL_START_OP';
467:
468: select wip_entity_id,
469: serialization_start_op,
527: close c_ops;
528:
529: --The routing exists, but an invalid op seq was provided
530: if ( l_rtgExists and not l_opFound ) then
531: raise fnd_api.g_exc_unexpected_error;
532: end if;
533:
534: --If no routing exsts, the serialization op must be 1.
535: if ( not l_rtgExists and l_wdjSerOp <> 1 ) then
532: end if;
533:
534: --If no routing exsts, the serialization op must be 1.
535: if ( not l_rtgExists and l_wdjSerOp <> 1 ) then
536: raise fnd_api.g_exc_unexpected_error;
537: end if;
538:
539: --job must be unreleased to change the serialization op on a reschedule request.
540: if ( l_loadType = wip_constants.resched_job and l_wjsiSerOp is not null ) then
550: p_wip_entity_id => l_wipEntityID,
551: p_organization_id => l_orgID,
552: x_err_msg => x_errorMsg,
553: x_return_status => x_returnStatus);
554: if ( x_returnStatus <> fnd_api.g_ret_sts_success ) then
555: raise fnd_api.g_exc_unexpected_error;
556: end if;
557: exception
558: when others then
551: p_organization_id => l_orgID,
552: x_err_msg => x_errorMsg,
553: x_return_status => x_returnStatus);
554: if ( x_returnStatus <> fnd_api.g_ret_sts_success ) then
555: raise fnd_api.g_exc_unexpected_error;
556: end if;
557: exception
558: when others then
559: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
555: raise fnd_api.g_exc_unexpected_error;
556: end if;
557: exception
558: when others then
559: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
560: fnd_message.set_name('WIP', l_msg);
561: if ( l_msg = 'WIP_ML_SER_DEF_FAILURE' ) then
562: fnd_message.set_token('MESSAGE', x_errorMsg);
563: end if;