15: SELECT count(*)
16: INTO x_count
17: FROM WIP_JOB_DTLS_INTERFACE
18: WHERE group_id = p_group_id
19: AND process_status = WIP_CONSTANTS.ERROR
20: AND wip_entity_id = p_wip_entity_id
21: AND organization_id = p_organization_id
22: AND load_type = WIP_JOB_DETAILS.WIP_RES_INSTANCE
23: AND substitution_type= p_substitution_type
44: cursor c_invalid_rows is
45: select interface_id
46: from wip_job_dtls_interface wjdi
47: where wjdi.group_id = p_group_id
48: and wjdi.process_phase = wip_constants.ml_validation
49: and wjdi.process_status in (wip_constants.running,
50: wip_constants.warning)
51: and wjdi.wip_entity_id = p_wip_entity_id
52: and wjdi.organization_id = p_organization_id
45: select interface_id
46: from wip_job_dtls_interface wjdi
47: where wjdi.group_id = p_group_id
48: and wjdi.process_phase = wip_constants.ml_validation
49: and wjdi.process_status in (wip_constants.running,
50: wip_constants.warning)
51: and wjdi.wip_entity_id = p_wip_entity_id
52: and wjdi.organization_id = p_organization_id
53: and wjdi.load_type = wip_job_details.wip_res_instance
46: from wip_job_dtls_interface wjdi
47: where wjdi.group_id = p_group_id
48: and wjdi.process_phase = wip_constants.ml_validation
49: and wjdi.process_status in (wip_constants.running,
50: wip_constants.warning)
51: and wjdi.wip_entity_id = p_wip_entity_id
52: and wjdi.organization_id = p_organization_id
53: and wjdi.load_type = wip_job_details.wip_res_instance
54: and wjdi.substitution_type = p_substitution_type
93: end loop;
94:
95: if(l_error_exists) then
96: update wip_job_dtls_interface wjdi
97: set process_status = wip_constants.error
98: where wjdi.group_id = p_group_id
99: and wjdi.process_phase = wip_constants.ml_validation
100: and wjdi.process_status in (wip_constants.running,
101: wip_constants.warning)
95: if(l_error_exists) then
96: update wip_job_dtls_interface wjdi
97: set process_status = wip_constants.error
98: where wjdi.group_id = p_group_id
99: and wjdi.process_phase = wip_constants.ml_validation
100: and wjdi.process_status in (wip_constants.running,
101: wip_constants.warning)
102: and wjdi.wip_entity_id = p_wip_entity_id
103: and wjdi.organization_id = p_organization_id
96: update wip_job_dtls_interface wjdi
97: set process_status = wip_constants.error
98: where wjdi.group_id = p_group_id
99: and wjdi.process_phase = wip_constants.ml_validation
100: and wjdi.process_status in (wip_constants.running,
101: wip_constants.warning)
102: and wjdi.wip_entity_id = p_wip_entity_id
103: and wjdi.organization_id = p_organization_id
104: and wjdi.load_type = wip_job_details.wip_res_instance
97: set process_status = wip_constants.error
98: where wjdi.group_id = p_group_id
99: and wjdi.process_phase = wip_constants.ml_validation
100: and wjdi.process_status in (wip_constants.running,
101: wip_constants.warning)
102: and wjdi.wip_entity_id = p_wip_entity_id
103: and wjdi.organization_id = p_organization_id
104: and wjdi.load_type = wip_job_details.wip_res_instance
105: and wjdi.substitution_type = p_substitution_type
142: cursor c_invalid_rows is
143: select interface_id
144: from wip_job_dtls_interface wjdi
145: where wjdi.group_id = p_group_id
146: and wjdi.process_phase = wip_constants.ml_validation
147: and wjdi.process_status in (wip_constants.running,
148: wip_constants.warning)
149: and wjdi.wip_entity_id = p_wip_entity_id
150: and wjdi.organization_id = p_organization_id
143: select interface_id
144: from wip_job_dtls_interface wjdi
145: where wjdi.group_id = p_group_id
146: and wjdi.process_phase = wip_constants.ml_validation
147: and wjdi.process_status in (wip_constants.running,
148: wip_constants.warning)
149: and wjdi.wip_entity_id = p_wip_entity_id
150: and wjdi.organization_id = p_organization_id
151: and wjdi.load_type = wip_job_details.wip_res_instance
144: from wip_job_dtls_interface wjdi
145: where wjdi.group_id = p_group_id
146: and wjdi.process_phase = wip_constants.ml_validation
147: and wjdi.process_status in (wip_constants.running,
148: wip_constants.warning)
149: and wjdi.wip_entity_id = p_wip_entity_id
150: and wjdi.organization_id = p_organization_id
151: and wjdi.load_type = wip_job_details.wip_res_instance
152: and wjdi.substitution_type = p_substitution_type
179: end loop;
180:
181: if(l_error_exists) then
182: update wip_job_dtls_interface wjdi
183: set process_status = wip_constants.error
184: where wjdi.group_id = p_group_id
185: and wjdi.process_phase = wip_constants.ml_validation
186: and wjdi.process_status in (wip_constants.running,
187: wip_constants.warning)
181: if(l_error_exists) then
182: update wip_job_dtls_interface wjdi
183: set process_status = wip_constants.error
184: where wjdi.group_id = p_group_id
185: and wjdi.process_phase = wip_constants.ml_validation
186: and wjdi.process_status in (wip_constants.running,
187: wip_constants.warning)
188: and wjdi.wip_entity_id = p_wip_entity_id
189: and wjdi.organization_id = p_organization_id
182: update wip_job_dtls_interface wjdi
183: set process_status = wip_constants.error
184: where wjdi.group_id = p_group_id
185: and wjdi.process_phase = wip_constants.ml_validation
186: and wjdi.process_status in (wip_constants.running,
187: wip_constants.warning)
188: and wjdi.wip_entity_id = p_wip_entity_id
189: and wjdi.organization_id = p_organization_id
190: and wjdi.load_type = wip_job_details.wip_res_instance
183: set process_status = wip_constants.error
184: where wjdi.group_id = p_group_id
185: and wjdi.process_phase = wip_constants.ml_validation
186: and wjdi.process_status in (wip_constants.running,
187: wip_constants.warning)
188: and wjdi.wip_entity_id = p_wip_entity_id
189: and wjdi.organization_id = p_organization_id
190: and wjdi.load_type = wip_job_details.wip_res_instance
191: and wjdi.substitution_type = p_substitution_type
211: cursor c_invalid_rows(p_dept_id number, p_resource_id number) is
212: select interface_id
213: from wip_job_dtls_interface wjdi
214: where wjdi.group_id = p_group_id
215: and wjdi.process_phase = wip_constants.ml_validation
216: and wjdi.process_status in (wip_constants.running,
217: wip_constants.warning)
218: and wjdi.wip_entity_id = p_wip_entity_id
219: and wjdi.organization_id = p_organization_id
212: select interface_id
213: from wip_job_dtls_interface wjdi
214: where wjdi.group_id = p_group_id
215: and wjdi.process_phase = wip_constants.ml_validation
216: and wjdi.process_status in (wip_constants.running,
217: wip_constants.warning)
218: and wjdi.wip_entity_id = p_wip_entity_id
219: and wjdi.organization_id = p_organization_id
220: and wjdi.load_type = wip_job_details.wip_res_instance
213: from wip_job_dtls_interface wjdi
214: where wjdi.group_id = p_group_id
215: and wjdi.process_phase = wip_constants.ml_validation
216: and wjdi.process_status in (wip_constants.running,
217: wip_constants.warning)
218: and wjdi.wip_entity_id = p_wip_entity_id
219: and wjdi.organization_id = p_organization_id
220: and wjdi.load_type = wip_job_details.wip_res_instance
221: and wjdi.substitution_type = p_substitution_type
263: end if;
264: end loop;
265: if(l_error_exists) then
266: update wip_job_dtls_interface wjdi
267: set process_status = wip_constants.error
268: where wjdi.group_id = p_group_id
269: and wjdi.process_phase = wip_constants.ml_validation
270: and wjdi.process_status in (wip_constants.running,
271: wip_constants.warning)
265: if(l_error_exists) then
266: update wip_job_dtls_interface wjdi
267: set process_status = wip_constants.error
268: where wjdi.group_id = p_group_id
269: and wjdi.process_phase = wip_constants.ml_validation
270: and wjdi.process_status in (wip_constants.running,
271: wip_constants.warning)
272: and wjdi.wip_entity_id = p_wip_entity_id
273: and wjdi.organization_id = p_organization_id
266: update wip_job_dtls_interface wjdi
267: set process_status = wip_constants.error
268: where wjdi.group_id = p_group_id
269: and wjdi.process_phase = wip_constants.ml_validation
270: and wjdi.process_status in (wip_constants.running,
271: wip_constants.warning)
272: and wjdi.wip_entity_id = p_wip_entity_id
273: and wjdi.organization_id = p_organization_id
274: and wjdi.load_type in (wip_job_details.wip_res_instance, wjdi.load_type)
267: set process_status = wip_constants.error
268: where wjdi.group_id = p_group_id
269: and wjdi.process_phase = wip_constants.ml_validation
270: and wjdi.process_status in (wip_constants.running,
271: wip_constants.warning)
272: and wjdi.wip_entity_id = p_wip_entity_id
273: and wjdi.organization_id = p_organization_id
274: and wjdi.load_type in (wip_job_details.wip_res_instance, wjdi.load_type)
275: and wjdi.substitution_type = p_substitution_type
298: cursor c_invalid_rows(p_dept_id number, p_resource_id number) is
299: select interface_id
300: from wip_job_dtls_interface wjdi
301: where wjdi.group_id = p_group_id
302: and wjdi.process_phase = wip_constants.ml_validation
303: and wjdi.process_status in (wip_constants.running,
304: wip_constants.warning)
305: and wjdi.wip_entity_id = p_wip_entity_id
306: and wjdi.organization_id = p_organization_id
299: select interface_id
300: from wip_job_dtls_interface wjdi
301: where wjdi.group_id = p_group_id
302: and wjdi.process_phase = wip_constants.ml_validation
303: and wjdi.process_status in (wip_constants.running,
304: wip_constants.warning)
305: and wjdi.wip_entity_id = p_wip_entity_id
306: and wjdi.organization_id = p_organization_id
307: and wjdi.load_type = wip_job_details.wip_res_instance
300: from wip_job_dtls_interface wjdi
301: where wjdi.group_id = p_group_id
302: and wjdi.process_phase = wip_constants.ml_validation
303: and wjdi.process_status in (wip_constants.running,
304: wip_constants.warning)
305: and wjdi.wip_entity_id = p_wip_entity_id
306: and wjdi.organization_id = p_organization_id
307: and wjdi.load_type = wip_job_details.wip_res_instance
308: and wjdi.substitution_type = p_substitution_type
364: end loop;
365: if(l_error_exists) then
366:
367: update wip_job_dtls_interface wjdi
368: set process_status = wip_constants.error
369: where wjdi.group_id = p_group_id
370: and wjdi.process_phase = wip_constants.ml_validation
371: and wjdi.process_status in (wip_constants.running,
372: wip_constants.warning)
366:
367: update wip_job_dtls_interface wjdi
368: set process_status = wip_constants.error
369: where wjdi.group_id = p_group_id
370: and wjdi.process_phase = wip_constants.ml_validation
371: and wjdi.process_status in (wip_constants.running,
372: wip_constants.warning)
373: and wjdi.wip_entity_id = p_wip_entity_id
374: and wjdi.organization_id = p_organization_id
367: update wip_job_dtls_interface wjdi
368: set process_status = wip_constants.error
369: where wjdi.group_id = p_group_id
370: and wjdi.process_phase = wip_constants.ml_validation
371: and wjdi.process_status in (wip_constants.running,
372: wip_constants.warning)
373: and wjdi.wip_entity_id = p_wip_entity_id
374: and wjdi.organization_id = p_organization_id
375: and wjdi.load_type in (wip_job_details.wip_res_instance, wjdi.load_type)
368: set process_status = wip_constants.error
369: where wjdi.group_id = p_group_id
370: and wjdi.process_phase = wip_constants.ml_validation
371: and wjdi.process_status in (wip_constants.running,
372: wip_constants.warning)
373: and wjdi.wip_entity_id = p_wip_entity_id
374: and wjdi.organization_id = p_organization_id
375: and wjdi.load_type in (wip_job_details.wip_res_instance, wjdi.load_type)
376: and wjdi.substitution_type = p_substitution_type
416: cursor c_invalid_rows(p_count number, p_assigned_units number) is
417: select interface_id
418: from wip_job_dtls_interface wjdi
419: where wjdi.group_id = p_group_id
420: and wjdi.process_phase = wip_constants.ml_validation
421: and wjdi.process_status in (wip_constants.running,
422: wip_constants.warning)
423: and wjdi.wip_entity_id = p_wip_entity_id
424: and wjdi.organization_id = p_organization_id
417: select interface_id
418: from wip_job_dtls_interface wjdi
419: where wjdi.group_id = p_group_id
420: and wjdi.process_phase = wip_constants.ml_validation
421: and wjdi.process_status in (wip_constants.running,
422: wip_constants.warning)
423: and wjdi.wip_entity_id = p_wip_entity_id
424: and wjdi.organization_id = p_organization_id
425: and wjdi.load_type = wip_job_details.wip_res_instance
418: from wip_job_dtls_interface wjdi
419: where wjdi.group_id = p_group_id
420: and wjdi.process_phase = wip_constants.ml_validation
421: and wjdi.process_status in (wip_constants.running,
422: wip_constants.warning)
423: and wjdi.wip_entity_id = p_wip_entity_id
424: and wjdi.organization_id = p_organization_id
425: and wjdi.load_type = wip_job_details.wip_res_instance
426: and wjdi.substitution_type = wip_job_details.wip_add
529: l_del_count := 0;
530: End;
531:
532:
533: if ( l_logLevel <= wip_constants.full_logging ) then
534: wip_logger.log('Number of current units = ' ||to_char(l_count), l_retStatus);
535: wip_logger.log('Number of units to be added = ' ||to_char(l_add_count), l_retStatus);
536: wip_logger.log('Number of units to be deleted = ' ||to_char(l_del_count), l_retStatus);
537: end if;
555: end if;
556: end loop;
557: if(l_error_exists) then
558: update wip_job_dtls_interface wjdi
559: set process_status = wip_constants.error
560: where wjdi.group_id = p_group_id
561: and wjdi.process_phase = wip_constants.ml_validation
562: and wjdi.process_status in (wip_constants.running,
563: wip_constants.warning)
557: if(l_error_exists) then
558: update wip_job_dtls_interface wjdi
559: set process_status = wip_constants.error
560: where wjdi.group_id = p_group_id
561: and wjdi.process_phase = wip_constants.ml_validation
562: and wjdi.process_status in (wip_constants.running,
563: wip_constants.warning)
564: and wjdi.wip_entity_id = p_wip_entity_id
565: and wjdi.organization_id = p_organization_id
558: update wip_job_dtls_interface wjdi
559: set process_status = wip_constants.error
560: where wjdi.group_id = p_group_id
561: and wjdi.process_phase = wip_constants.ml_validation
562: and wjdi.process_status in (wip_constants.running,
563: wip_constants.warning)
564: and wjdi.wip_entity_id = p_wip_entity_id
565: and wjdi.organization_id = p_organization_id
566: and wjdi.load_type = wip_job_details.wip_res_instance
559: set process_status = wip_constants.error
560: where wjdi.group_id = p_group_id
561: and wjdi.process_phase = wip_constants.ml_validation
562: and wjdi.process_status in (wip_constants.running,
563: wip_constants.warning)
564: and wjdi.wip_entity_id = p_wip_entity_id
565: and wjdi.organization_id = p_organization_id
566: and wjdi.load_type = wip_job_details.wip_res_instance
567: and wjdi.substitution_type = wip_job_details.wip_add
600: attribute13,attribute14,attribute15, schedule_seq_num,
601: substitute_group_num, replacement_group_num, parent_seq_num, rowid
602: FROM WIP_JOB_DTLS_INTERFACE
603: WHERE group_id = p_group_id
604: AND process_phase = WIP_CONSTANTS.ML_VALIDATION
605: AND process_status in (WIP_CONSTANTS.RUNNING,WIP_CONSTANTS.WARNING)
606: AND wip_entity_id = p_wip_entity_id
607: AND organization_id = p_organization_id
608: AND load_type = WIP_JOB_DETAILS.WIP_RES_INSTANCE
601: substitute_group_num, replacement_group_num, parent_seq_num, rowid
602: FROM WIP_JOB_DTLS_INTERFACE
603: WHERE group_id = p_group_id
604: AND process_phase = WIP_CONSTANTS.ML_VALIDATION
605: AND process_status in (WIP_CONSTANTS.RUNNING,WIP_CONSTANTS.WARNING)
606: AND wip_entity_id = p_wip_entity_id
607: AND organization_id = p_organization_id
608: AND load_type = WIP_JOB_DETAILS.WIP_RES_INSTANCE
609: AND substitution_type = p_substitution_type;
753: cursor c_invalid_rows is
754: select interface_id
755: from wip_job_dtls_interface wjdi
756: where wjdi.group_id = p_group_id
757: and wjdi.process_phase = wip_constants.ml_validation
758: and wjdi.process_status in (wip_constants.running,
759: wip_constants.warning)
760: and wjdi.wip_entity_id = p_wip_entity_id
761: and wjdi.organization_id = p_organization_id
754: select interface_id
755: from wip_job_dtls_interface wjdi
756: where wjdi.group_id = p_group_id
757: and wjdi.process_phase = wip_constants.ml_validation
758: and wjdi.process_status in (wip_constants.running,
759: wip_constants.warning)
760: and wjdi.wip_entity_id = p_wip_entity_id
761: and wjdi.organization_id = p_organization_id
762: and wjdi.load_type = wip_job_details.wip_res_instance
755: from wip_job_dtls_interface wjdi
756: where wjdi.group_id = p_group_id
757: and wjdi.process_phase = wip_constants.ml_validation
758: and wjdi.process_status in (wip_constants.running,
759: wip_constants.warning)
760: and wjdi.wip_entity_id = p_wip_entity_id
761: and wjdi.organization_id = p_organization_id
762: and wjdi.load_type = wip_job_details.wip_res_instance
763: and wjdi.substitution_type = p_substitution_type
792: end loop;
793:
794: if(l_error_exists) then
795: update wip_job_dtls_interface wjdi
796: set process_status = wip_constants.error
797: where group_id = p_group_id
798: and process_phase = wip_constants.ml_validation
799: and process_status in (wip_constants.running,
800: wip_constants.warning)
794: if(l_error_exists) then
795: update wip_job_dtls_interface wjdi
796: set process_status = wip_constants.error
797: where group_id = p_group_id
798: and process_phase = wip_constants.ml_validation
799: and process_status in (wip_constants.running,
800: wip_constants.warning)
801: and wip_entity_id = p_wip_entity_id
802: and organization_id = p_organization_id
795: update wip_job_dtls_interface wjdi
796: set process_status = wip_constants.error
797: where group_id = p_group_id
798: and process_phase = wip_constants.ml_validation
799: and process_status in (wip_constants.running,
800: wip_constants.warning)
801: and wip_entity_id = p_wip_entity_id
802: and organization_id = p_organization_id
803: and wjdi.load_type in (wip_job_details.wip_res_instance)
796: set process_status = wip_constants.error
797: where group_id = p_group_id
798: and process_phase = wip_constants.ml_validation
799: and process_status in (wip_constants.running,
800: wip_constants.warning)
801: and wip_entity_id = p_wip_entity_id
802: and organization_id = p_organization_id
803: and wjdi.load_type in (wip_job_details.wip_res_instance)
804: and wjdi.substitution_type = p_substitution_type
846: attribute13,attribute14,attribute15, schedule_seq_num,
847: substitute_group_num, replacement_group_num
848: FROM WIP_JOB_DTLS_INTERFACE
849: WHERE group_id = p_group_id
850: AND process_phase = WIP_CONSTANTS.ML_VALIDATION
851: AND process_status in (WIP_CONSTANTS.RUNNING,WIP_CONSTANTS.WARNING)
852: AND wip_entity_id = p_wip_entity_id
853: AND organization_id = p_organization_id
854: AND load_type = WIP_JOB_DETAILS.WIP_RES_INSTANCE
847: substitute_group_num, replacement_group_num
848: FROM WIP_JOB_DTLS_INTERFACE
849: WHERE group_id = p_group_id
850: AND process_phase = WIP_CONSTANTS.ML_VALIDATION
851: AND process_status in (WIP_CONSTANTS.RUNNING,WIP_CONSTANTS.WARNING)
852: AND wip_entity_id = p_wip_entity_id
853: AND organization_id = p_organization_id
854: AND load_type = WIP_JOB_DETAILS.WIP_RES_INSTANCE
855: AND substitution_type = p_substitution_type;
977: attribute13,attribute14,attribute15, schedule_seq_num,
978: substitute_group_num, replacement_group_num
979: FROM WIP_JOB_DTLS_INTERFACE
980: WHERE group_id = p_group_id
981: AND process_phase = WIP_CONSTANTS.ML_VALIDATION
982: AND process_status in (WIP_CONSTANTS.RUNNING,WIP_CONSTANTS.WARNING)
983: AND wip_entity_id = p_wip_entity_id
984: AND organization_id = p_organization_id
985: AND load_type = WIP_JOB_DETAILS.WIP_RES_INSTANCE
978: substitute_group_num, replacement_group_num
979: FROM WIP_JOB_DTLS_INTERFACE
980: WHERE group_id = p_group_id
981: AND process_phase = WIP_CONSTANTS.ML_VALIDATION
982: AND process_status in (WIP_CONSTANTS.RUNNING,WIP_CONSTANTS.WARNING)
983: AND wip_entity_id = p_wip_entity_id
984: AND organization_id = p_organization_id
985: AND load_type = WIP_JOB_DETAILS.WIP_RES_INSTANCE
986: AND substitution_type = p_substitution_type;