1 PACKAGE BODY PJI_LAUNCH_EXT AS
2 /* $Header: PJILN02B.pls 120.1 2009/08/28 07:18:23 dlella noship $ */
3 /** Called from : PJI_LAUNCH_UPP_MAIN.CREATE_UPP_BATCHES
4 This function will override the project pickup logic of the Launch
5 process ONLY for projects that are NOT linked to any program. For all
6 projects linked to a program, the project pickup logic of Launch process
7 CANNOT be overridden. This function has to return a PLSQL table of
8 project_id's only. **/
9
10 PROCEDURE PROJ_LIST (p_prg_proj_tbl OUT NOCOPY prg_proj_tbl,
11 p_context OUT NOCOPY varchar2,
12 p_budget_lines_count OUT NOCOPY number) IS
13
14 l_prg_proj_tbl prg_proj_tbl;
15
16 BEGIN
17
18 /* The following variable can have only 2 values, INCREMENTAL and UPGRADE.
19 For daily processing, this value will be INCREMENTAL. Only in an upgrade
20 scenario, change this value to UPGRADE */
21 p_context := 'INCREMENTAL';
22
23 /*
24 p_context := 'UPGRADE';
25 Uncomment this and comment the above if running in upgrade scenario */
26
27 /** Sample code :
28 This query will return a PLSQL table contaning project_id's of all such
29 projects which have greater than 10,000 budget lines. Similar logic may
30 be used to derive project_id's based on different conditions to override
31 the project pick up logic of Launch process.
32
33 SELECT proj_id BULK COLLECT
34 INTO l_prg_proj_tbl
35 FROM
36 (SELECT proj_id, cnt
37 FROM
38 (SELECT pa.project_id proj_id,
39 COUNT(bl.budget_version_id) cnt
40 FROM pa_projects_all pa,
41 pa_budget_versions bv,
42 pa_budget_lines bl
43 WHERE pa.project_id = bv.project_id
44 AND bv.budget_version_id = bl.budget_version_id
45 GROUP BY pa.project_id)
46 WHERE cnt > 1000);
47 **/
48
49 p_prg_proj_tbl := l_prg_proj_tbl;
50
51 /* The following variable stores the number of budget lines that will be used
52 as a reference while determining the batch size in Launch process.
53 This division by budget lines is done for proper load balancing among
54 batches created in Launch process and ensures that similar volumes of
55 data is processed in each batch.
56 An example would be to limit batch size to 200000 budget lines as below
57 p_budget_lines_count := 200000;
58 */
59
60 p_budget_lines_count := 0;
61 /* Change the value of the above variable to divide batches by number of
62 budget lines to process in each batch.
63 Note that passing a value for this variable will ONLY be honoured
64 when p_context = UPGRADE */
65
66 /* The following combination of extension parameters will be considered valid
67 and will be used for creating batches :
68 1. p_context = UPGRADE, p_budget_lines_count > 0, p_prg_proj_tbl.count > 0
69 2. p_context = UPGRADE, p_budget_lines_count > 0, p_prg_proj_tbl.count = 0
70 3. p_context = INCREMENTAL/UPGRADE(p_budget_lines_count=0), p_prg_proj_tbl.count > 0
71 4. p_context = INCREMENTAL(p_budget_lines_count=0), p_prg_proj_tbl.count = 0
72 */
73
74 END PROJ_LIST;
75
76 END PJI_LAUNCH_EXT;