[Home] [Help]
280: END trkpl_del_tri;
281:
282:
283: ------------------------------------------------------------------------------
284: -- 6. Delete step group limit from IGS_TR_STEP_GRP_LMT
285: -- Function added by pradhakr as part of CCR for Tracking in Applicant
286: -- Self Service Part 3.
287: ------------------------------------------------------------------------------
288: FUNCTION trkpl_del_grp_lmt(
285: -- Function added by pradhakr as part of CCR for Tracking in Applicant
286: -- Self Service Part 3.
287: ------------------------------------------------------------------------------
288: FUNCTION trkpl_del_grp_lmt(
289: lp_tracking_id igs_tr_step_grp_lmt.tracking_id%TYPE )
290: RETURN BOOLEAN AS
291: lv_param_values VARCHAR2(1080);
292: BEGIN
293:
294: DECLARE
295:
296: CURSOR c_del_grp_lmt IS
297: SELECT ROWID
298: FROM igs_tr_step_grp_lmt
299: WHERE tracking_id = lp_tracking_id
300: FOR UPDATE OF tracking_id NOWAIT;
301:
302: BEGIN
301:
302: BEGIN
303:
304: FOR rec_del_grp_lmt IN c_del_grp_lmt LOOP
305: igs_tr_step_grp_lmt_pkg.delete_row( x_rowid => rec_del_grp_lmt.rowid);
306: END LOOP;
307:
308: RETURN TRUE;
309: END;
334: IF ( -- Delete tracking_step_note
335: trkpl_del_tsn(p_tracking_id) = FALSE OR
336: -- Delete tracking_step
337: trkpl_del_ts(p_tracking_id) = FALSE OR
338: -- Deleting step group limit from IGS_TR_STEP_GRP_LMT
339: trkpl_del_grp_lmt(p_tracking_id) = FALSE OR
340: -- Delete tracking_group_member
341: trkpl_del_tgm(p_tracking_id) = FALSE OR
342: -- Delete tracking_item_note
746:
747: -- API to default the tracking steps for item based on the Tracking Type
748: -- Added by pradhakr
749: PROCEDURE trkpl_ins_ts_grp_lmt (
750: p_tracking_id IN igs_tr_step_grp_lmt.tracking_id%TYPE,
751: p_step_group_id IN igs_tr_step_grp_lmt.step_group_id%TYPE,
752: p_step_group_limit IN igs_tr_step_grp_lmt.step_group_limit%TYPE
753: ) AS
754:
747: -- API to default the tracking steps for item based on the Tracking Type
748: -- Added by pradhakr
749: PROCEDURE trkpl_ins_ts_grp_lmt (
750: p_tracking_id IN igs_tr_step_grp_lmt.tracking_id%TYPE,
751: p_step_group_id IN igs_tr_step_grp_lmt.step_group_id%TYPE,
752: p_step_group_limit IN igs_tr_step_grp_lmt.step_group_limit%TYPE
753: ) AS
754:
755: lv_param_values VARCHAR2(1080);
748: -- Added by pradhakr
749: PROCEDURE trkpl_ins_ts_grp_lmt (
750: p_tracking_id IN igs_tr_step_grp_lmt.tracking_id%TYPE,
751: p_step_group_id IN igs_tr_step_grp_lmt.step_group_id%TYPE,
752: p_step_group_limit IN igs_tr_step_grp_lmt.step_group_limit%TYPE
753: ) AS
754:
755: lv_param_values VARCHAR2(1080);
756: l_rowid VARCHAR2(25);
756: l_rowid VARCHAR2(25);
757:
758: BEGIN
759:
760: IGS_TR_STEP_GRP_LMT_PKG.INSERT_ROW (
761: X_ROWID => l_rowid,
762: X_TRACKING_ID => p_tracking_id,
763: X_STEP_GROUP_ID => p_step_group_id,
764: X_STEP_GROUP_LIMIT => p_step_group_limit
848: END LOOP;
849:
850: END LOOP;
851:
852: -- If any tracking group limit exists then insert into IGS_TR_STEP_GRP_LMT
853: FOR rec_tracking_type_step_grplmt IN c_tracking_type_step_grplmt(v_tracking_type) LOOP
854: trkpl_ins_ts_grp_lmt (p_tracking_id,
855: rec_tracking_type_step_grplmt.step_group_id,
856: rec_tracking_type_step_grplmt.step_group_limit);
1376: lv_param_values VARCHAR2(1080);
1377:
1378: -- Cursor to get all step group ids and the number of completed steps prior to the
1379: -- passed step group id (p_step_group_id) and tracking step number (p_ tracking_step_number) and
1380: -- comparing the result with the one in the table IGS_TR_STEP_GRP_LMT
1381:
1382: CURSOR c_grp_limit IS
1383: SELECT tab.step_group_id, tab.step_group_limit
1384: FROM
1392: AND trst.by_pass_ind = 'N'
1393: GROUP BY trst.step_group_id, trst.step_completion_ind
1394: MINUS
1395: SELECT step_group_id, step_group_limit
1396: FROM igs_tr_step_grp_lmt
1397: WHERE tracking_id = p_tracking_id
1398: ) tab ,
1399: igs_tr_step_grp_lmt trg
1400: WHERE tab.step_group_id = trg.step_group_id
1395: SELECT step_group_id, step_group_limit
1396: FROM igs_tr_step_grp_lmt
1397: WHERE tracking_id = p_tracking_id
1398: ) tab ,
1399: igs_tr_step_grp_lmt trg
1400: WHERE tab.step_group_id = trg.step_group_id
1401: AND trg.tracking_id = p_tracking_id
1402: AND tab.step_group_limit < trg.step_group_limit ;
1403:
1665: GROUP BY trst.step_group_id,
1666: trst.step_completion_ind
1667: ) tab,
1668: -- a step is considered complete if either its BY PASSED or its completion ind is Y
1669: igs_tr_step_grp_lmt trg
1670: WHERE tab.step_group_id = trg.step_group_id
1671: AND trg.tracking_id = p_tracking_id
1672: AND tab.count_step >= trg.step_group_limit
1673: -- subtract only if the total steps completed are less than the group limit.
2368: /***********************************************************************************************************
2369:
2370: Created By: pradhakr
2371: Date Created By: 11-Feb-2002
2372: Purpose: This procedure will synchronise the content of the table IGS_TR_STEP_GRP_LMT with the content
2373: of IGS_TR_TYPE_STEP_V.
2374: 1. If that step group being deleted in form IGSTR001 ( block tracking step) is the last one of its
2375: kind for a particular tracking id, the step group id will be deleted from IGS_TR_TSTP_GRP_LMT
2376: else Step Group Limit will be decremented by 1.
2514:
2515: Date Created By: 11-Feb-2002
2516:
2517: Purpose: This procedure would be called from the post_forms commit trigger of the Form IGSTR007 (Tracking Items ).
2518: This procedure will synchronise the content of the table IGS_TR_STEP_GRP_LMT with the content
2519: of IGS_TR_STEP_V.
2520: 1. If that step group being deleted in form IGSTR007 ( block tracking step) is the last one of its
2521: kind for a particular tracking id, the step group id will be deleted from IGS_TR_STEP_GRP_LMT
2522:
2517: Purpose: This procedure would be called from the post_forms commit trigger of the Form IGSTR007 (Tracking Items ).
2518: This procedure will synchronise the content of the table IGS_TR_STEP_GRP_LMT with the content
2519: of IGS_TR_STEP_V.
2520: 1. If that step group being deleted in form IGSTR007 ( block tracking step) is the last one of its
2521: kind for a particular tracking id, the step group id will be deleted from IGS_TR_STEP_GRP_LMT
2522:
2523: 2. Any new Step Group ID being created in the form IGSTR007 ( block tracking step) will also be created
2524: in the table IGS_TR_STEP_GRP_LMT and the Step Group Limit would be defaulted to 1.
2525:
2520: 1. If that step group being deleted in form IGSTR007 ( block tracking step) is the last one of its
2521: kind for a particular tracking id, the step group id will be deleted from IGS_TR_STEP_GRP_LMT
2522:
2523: 2. Any new Step Group ID being created in the form IGSTR007 ( block tracking step) will also be created
2524: in the table IGS_TR_STEP_GRP_LMT and the Step Group Limit would be defaulted to 1.
2525:
2526: 3. In case IGS_TR_STEP_GRP_LMT.STEP_GROUP_LIMIT is greater than the count of step_group_id's for tracking_id and step_group_id
2527: combination in IGS_TR_STEP_V view then set it equal to the lower value (i.e count of step_group_id's in the IGS_TR_STEP_V).
2528:
2522:
2523: 2. Any new Step Group ID being created in the form IGSTR007 ( block tracking step) will also be created
2524: in the table IGS_TR_STEP_GRP_LMT and the Step Group Limit would be defaulted to 1.
2525:
2526: 3. In case IGS_TR_STEP_GRP_LMT.STEP_GROUP_LIMIT is greater than the count of step_group_id's for tracking_id and step_group_id
2527: combination in IGS_TR_STEP_V view then set it equal to the lower value (i.e count of step_group_id's in the IGS_TR_STEP_V).
2528:
2529:
2530: Known limitations,enhancements,remarks:
2535: ************************************************************************************************************/
2536:
2537:
2538:
2539: -- Fetch all the distinct step group id's for the given tracking id which are there in the table IGS_TR_STEP_GRP_LMT and not in the view IGS_TR_STEP_V
2540: -- IF such records are found then delete them from the table igs_tr_step_grp_lmt
2541: -- ssawhney view reference changed to table
2542: CURSOR c_decrement_step_grp_lmt
2543: IS
2536:
2537:
2538:
2539: -- Fetch all the distinct step group id's for the given tracking id which are there in the table IGS_TR_STEP_GRP_LMT and not in the view IGS_TR_STEP_V
2540: -- IF such records are found then delete them from the table igs_tr_step_grp_lmt
2541: -- ssawhney view reference changed to table
2542: CURSOR c_decrement_step_grp_lmt
2543: IS
2544: SELECT
2543: IS
2544: SELECT
2545: step_group_id
2546: FROM
2547: igs_tr_step_grp_lmt
2548: WHERE
2549: tracking_id = p_tracking_id
2550: MINUS
2551: SELECT
2559: GROUP BY
2560: sv.step_group_id;
2561:
2562:
2563: -- Fetch all the distinct step group id's for the given tracking id which are there in IGS_TR_STEP and not in the table IGS_TR_STEP_GRP_LMT
2564: -- IF such records are found then insert them from the table igs_tr_step_grp_lmt with a default group_limit of 1.
2565: -- ssawhney view reference changed to table
2566: CURSOR c_insert_step_grp_lmt
2567: IS
2560: sv.step_group_id;
2561:
2562:
2563: -- Fetch all the distinct step group id's for the given tracking id which are there in IGS_TR_STEP and not in the table IGS_TR_STEP_GRP_LMT
2564: -- IF such records are found then insert them from the table igs_tr_step_grp_lmt with a default group_limit of 1.
2565: -- ssawhney view reference changed to table
2566: CURSOR c_insert_step_grp_lmt
2567: IS
2568: SELECT
2578: MINUS
2579: SELECT
2580: step_group_id
2581: FROM
2582: igs_tr_step_grp_lmt
2583: WHERE
2584: tracking_id = p_tracking_id;
2585:
2586:
2583: WHERE
2584: tracking_id = p_tracking_id;
2585:
2586:
2587: -- Cursor to fetch the Rowid from the igs_tr_step_grp_lmt table for a tracking_id, step_group_id combination
2588:
2589: CURSOR c_rowid ( p_tracking_id IGS_TR_STEP_GRP_LMT.TRACKING_ID%TYPE ,
2590: p_step_group_id IGS_TR_STEP_GRP_LMT.STEP_GROUP_ID%TYPE
2591: )
2585:
2586:
2587: -- Cursor to fetch the Rowid from the igs_tr_step_grp_lmt table for a tracking_id, step_group_id combination
2588:
2589: CURSOR c_rowid ( p_tracking_id IGS_TR_STEP_GRP_LMT.TRACKING_ID%TYPE ,
2590: p_step_group_id IGS_TR_STEP_GRP_LMT.STEP_GROUP_ID%TYPE
2591: )
2592: IS
2593: SELECT
2586:
2587: -- Cursor to fetch the Rowid from the igs_tr_step_grp_lmt table for a tracking_id, step_group_id combination
2588:
2589: CURSOR c_rowid ( p_tracking_id IGS_TR_STEP_GRP_LMT.TRACKING_ID%TYPE ,
2590: p_step_group_id IGS_TR_STEP_GRP_LMT.STEP_GROUP_ID%TYPE
2591: )
2592: IS
2593: SELECT
2594: ROWID
2592: IS
2593: SELECT
2594: ROWID
2595: FROM
2596: igs_tr_step_grp_lmt
2597: WHERE
2598: tracking_id = p_tracking_id
2599: AND
2600: step_group_id = p_step_group_id;
2616: GROUP BY
2617: step_group_id;
2618:
2619:
2620: -- Cursor to get the step group limit from igs_tr_step_grp_lmt table for a combination of tracking_id and step_group_id
2621:
2622: CURSOR c_grp_lmt (p_tracking_id igs_tr_step_grp_lmt.tracking_id%TYPE,
2623: p_step_group_id igs_tr_step_grp_lmt.step_group_id%TYPE)
2624: IS
2618:
2619:
2620: -- Cursor to get the step group limit from igs_tr_step_grp_lmt table for a combination of tracking_id and step_group_id
2621:
2622: CURSOR c_grp_lmt (p_tracking_id igs_tr_step_grp_lmt.tracking_id%TYPE,
2623: p_step_group_id igs_tr_step_grp_lmt.step_group_id%TYPE)
2624: IS
2625: SELECT
2626: step_group_limit
2619:
2620: -- Cursor to get the step group limit from igs_tr_step_grp_lmt table for a combination of tracking_id and step_group_id
2621:
2622: CURSOR c_grp_lmt (p_tracking_id igs_tr_step_grp_lmt.tracking_id%TYPE,
2623: p_step_group_id igs_tr_step_grp_lmt.step_group_id%TYPE)
2624: IS
2625: SELECT
2626: step_group_limit
2627: FROM
2624: IS
2625: SELECT
2626: step_group_limit
2627: FROM
2628: igs_tr_step_grp_lmt
2629: WHERE
2630: tracking_id = p_tracking_id
2631: AND
2632: step_group_id = p_step_group_id;
2632: step_group_id = p_step_group_id;
2633:
2634:
2635: lv_rowid VARCHAR2(25);
2636: ln_step_group_limit igs_tr_step_grp_lmt.step_group_limit%TYPE;
2637: ln_grp_lmt igs_tr_step_grp_lmt.step_group_limit%TYPE;
2638:
2639: BEGIN
2640:
2633:
2634:
2635: lv_rowid VARCHAR2(25);
2636: ln_step_group_limit igs_tr_step_grp_lmt.step_group_limit%TYPE;
2637: ln_grp_lmt igs_tr_step_grp_lmt.step_group_limit%TYPE;
2638:
2639: BEGIN
2640:
2641: /************************************ Validation 1 ***********************************************************/
2646: END IF;
2647:
2648:
2649: /************************************ Validation 2 ***********************************************************/
2650: -- Fetch all the distinct step group id's for the given tracking id which are there in the table IGS_TR_STEP_GRP_LMT
2651: -- and not in the view IGS_TR_STEP_V.
2652: -- IF such records are found then delete them from the table igs_tr_step_grp_lmt
2653:
2654: FOR rec_decrement_step_grp_lmt IN c_decrement_step_grp_lmt LOOP
2648:
2649: /************************************ Validation 2 ***********************************************************/
2650: -- Fetch all the distinct step group id's for the given tracking id which are there in the table IGS_TR_STEP_GRP_LMT
2651: -- and not in the view IGS_TR_STEP_V.
2652: -- IF such records are found then delete them from the table igs_tr_step_grp_lmt
2653:
2654: FOR rec_decrement_step_grp_lmt IN c_decrement_step_grp_lmt LOOP
2655: OPEN c_rowid(p_tracking_id, rec_decrement_step_grp_lmt.step_group_id );
2656: FETCH c_rowid INTO lv_rowid;
2654: FOR rec_decrement_step_grp_lmt IN c_decrement_step_grp_lmt LOOP
2655: OPEN c_rowid(p_tracking_id, rec_decrement_step_grp_lmt.step_group_id );
2656: FETCH c_rowid INTO lv_rowid;
2657: CLOSE c_rowid;
2658: igs_tr_step_grp_lmt_pkg.delete_row ( X_ROWID => lv_rowid );
2659: END LOOP;
2660:
2661:
2662:
2660:
2661:
2662:
2663: /************************************* Validation 3 ***********************************************************/
2664: -- Insert records into IGS_TR_STEP_GRP_LMT when tracking_id and step_group_id combination exists in IGS_TR_STEP_V
2665: -- but not in IGS_TR_STEP_GRP_LMT.
2666: -- Default the value of Step_group_limit to 1.
2667:
2668: FOR rec_insert_step_grp_lmt IN c_insert_step_grp_lmt LOOP
2661:
2662:
2663: /************************************* Validation 3 ***********************************************************/
2664: -- Insert records into IGS_TR_STEP_GRP_LMT when tracking_id and step_group_id combination exists in IGS_TR_STEP_V
2665: -- but not in IGS_TR_STEP_GRP_LMT.
2666: -- Default the value of Step_group_limit to 1.
2667:
2668: FOR rec_insert_step_grp_lmt IN c_insert_step_grp_lmt LOOP
2669: igs_tr_step_grp_lmt_pkg.insert_row (
2665: -- but not in IGS_TR_STEP_GRP_LMT.
2666: -- Default the value of Step_group_limit to 1.
2667:
2668: FOR rec_insert_step_grp_lmt IN c_insert_step_grp_lmt LOOP
2669: igs_tr_step_grp_lmt_pkg.insert_row (
2670: X_ROWID => lv_rowid ,
2671: X_TRACKING_ID => p_tracking_id ,
2672: X_STEP_GROUP_ID => rec_insert_step_grp_lmt.step_group_id ,
2673: X_STEP_GROUP_LIMIT => 1 ,
2676: END LOOP;
2677:
2678:
2679: /*************************************** Validation 4 ***********************************************************/
2680: -- Check the step group limit for a combination of Tracking_Id and Step_group_id in the table IGS_TR_STEP_GRP_LMT
2681: -- and the view IGS_TR_STEP_V.
2682: -- In case IGS_TR_STEP_GRP_LMT.STEP_GROUP_LIMIT is greater than the count of step_group_id's for tracking_id and step_group_id
2683: -- combination in IGS_TR_STEP_V view then set it equal to the count of step_group_id's in the IGS_TR_STEP_V.
2684:
2678:
2679: /*************************************** Validation 4 ***********************************************************/
2680: -- Check the step group limit for a combination of Tracking_Id and Step_group_id in the table IGS_TR_STEP_GRP_LMT
2681: -- and the view IGS_TR_STEP_V.
2682: -- In case IGS_TR_STEP_GRP_LMT.STEP_GROUP_LIMIT is greater than the count of step_group_id's for tracking_id and step_group_id
2683: -- combination in IGS_TR_STEP_V view then set it equal to the count of step_group_id's in the IGS_TR_STEP_V.
2684:
2685: FOR rec_item_step IN c_item_step (p_tracking_id)
2686: LOOP
2695: -- Check whether Step Group limit is greater than the count of Tracking item steps for a step group id and tracking_id combination
2696: -- then set the step group limit equal to the count of step group id's in the igs)tr)step_v view for a step group id and tracking_id combination.
2697:
2698: IF ln_grp_lmt > rec_item_step.step_group_count THEN
2699: igs_tr_step_grp_lmt_pkg.update_row (
2700: X_ROWID => lv_rowid ,
2701: X_TRACKING_ID => p_tracking_id ,
2702: X_STEP_GROUP_ID => rec_item_step.step_group_id ,
2703: X_STEP_GROUP_LIMIT => rec_item_step.step_group_count ,
2799: SELECT
2800: DISTINCT trgl.step_group_id step_group_id,
2801: step_group_limit count_step
2802: FROM
2803: igs_tr_step_grp_lmt trgl
2804: WHERE
2805: trgl.tracking_id = p_tracking_id
2806: ) tab,
2807: igs_tr_step_grp_lmt trg
2803: igs_tr_step_grp_lmt trgl
2804: WHERE
2805: trgl.tracking_id = p_tracking_id
2806: ) tab,
2807: igs_tr_step_grp_lmt trg
2808: WHERE tab.step_group_id = trg.step_group_id
2809: AND
2810: trg.tracking_id = p_tracking_id
2811: AND