[Home] [Help]
PACKAGE BODY: APPS.MST_CP_WRAPPER
Source
1 PACKAGE BODY MST_CP_WRAPPER AS
2 /*$Header: MSTCPWPB.pls 115.4 2004/04/22 01:06:59 jnhuang noship $ */
3 -- set to trigger mode to bypass the 'SAVEPOINT' and 'ROLLBACK' command.
4
5 PROCEDURE COPY_PLAN(p_plan_id IN NUMBER,
6 p_dest_plan_name IN VARCHAR2,
7 p_dest_plan_desc IN VARCHAR2,
8 p_request_id OUT NOCOPY NUMBER) IS
9 l_result boolean;
10 l_request_id number;
11 BEGIN
12 --l_result := FND_REQUEST.SET_MODE(TRUE);
13
14 l_request_id := NULL;
15 l_request_id := FND_REQUEST.SUBMIT_REQUEST(
16 'MST', -- application
17 'MSTCPPCP',-- program
18 NULL, -- description
19 NULL, -- start_time
20 FALSE, -- sub_request
21 p_plan_id, -- source plan id
22 p_dest_plan_name, -- dest plan name
23 p_dest_plan_desc); -- dest plan desc
24 p_request_id := l_request_id;
25 if l_request_id <> 0 then
26 commit;
27 end if;
28 END COPY_PLAN;
29
30 PROCEDURE LAUNCH_PLAN(p_plan_id IN NUMBER,
31 p_request_id OUT NOCOPY NUMBER) IS
32 l_result boolean;
33 l_request_id number;
34 BEGIN
35 --l_result := FND_REQUEST.SET_MODE(TRUE);
36
37 l_request_id := NULL;
38 l_request_id := FND_REQUEST.SUBMIT_REQUEST(
39 'MST', -- application
40 'MSTLPLAN',-- program
41 NULL, -- description
42 NULL, -- start_time
43 FALSE, -- sub_request
44 p_plan_id); -- source plan id
45 -- 2, -- reuse setup data
46 -- 1, -- run audit exceptions
47 -- 1); -- lanuch planner
48 p_request_id := l_request_id;
49 if l_request_id <> 0 then
50 commit;
51 end if;
52 END LAUNCH_PLAN;
53
54 PROCEDURE REOPTIMIZE_PLAN(p_plan_id IN NUMBER,
55 p_request_id OUT NOCOPY NUMBER) IS
56 l_result boolean;
57 l_request_id number;
58 BEGIN
59 --l_result := FND_REQUEST.SET_MODE(TRUE);
60
61 l_request_id := NULL;
62 l_request_id := FND_REQUEST.SUBMIT_REQUEST(
63 'MST', -- application
64 'MSTOPTCP',-- program
65 NULL, -- description
66 NULL, -- start_time
67 FALSE, -- sub_request
68 p_plan_id, -- source plan id
69 2,
70 1,
71 0,
72 0,
73 0,
74 0); -- run kpi flag
75 p_request_id := l_request_id;
76 if l_request_id <> 0 then
77 commit;
78 end if;
79 END REOPTIMIZE_PLAN;
80
81 PROCEDURE CALCULATE_KPI(p_plan_id IN NUMBER,
82 p_request_id OUT NOCOPY NUMBER) IS
83 l_result boolean;
84 l_request_id number;
85 BEGIN
86 --l_result := FND_REQUEST.SET_MODE(TRUE);
87
88 l_request_id := NULL;
89 l_request_id := FND_REQUEST.SUBMIT_REQUEST(
90 'MST', -- application
91 'MSTKPICP',-- program
92 NULL, -- description
93 NULL, -- start_time
94 FALSE, -- sub_request
95 p_plan_id, -- source plan id
96 1, -- optimized_flag: do not optimize
97 1, -- maintain user edits: none
98 1, -- allow removal from firm trips
99 2, -- run audit report
100 2, -- run exception flag
101 1); -- run kpi flag
102 p_request_id := l_request_id;
103 if l_request_id <> 0 then
104 commit;
105 end if;
106 END CALCULATE_KPI;
107
108 PROCEDURE CALCULATE_EXCEPTIONS(p_plan_id IN NUMBER,
109 p_request_id OUT NOCOPY NUMBER) IS
110 l_result boolean;
111 l_request_id number;
112 BEGIN
113 --l_result := FND_REQUEST.SET_MODE(TRUE);
114
115 l_request_id := NULL;
116 l_request_id := FND_REQUEST.SUBMIT_REQUEST(
117 'MST', -- application
118 'MSTEXPCP',-- program
119 NULL, -- description
120 NULL, -- start_time
121 FALSE, -- sub_request
122 p_plan_id, -- source plan id
123 1, -- optimized_flag: do not optimize
124 1, -- maintain user edits: none
125 1, -- allow removal from firm trips
126 2, -- run audit report
127 1, -- run exception flag
128 2); -- run kpi flag
129 p_request_id := l_request_id;
130 if l_request_id <> 0 then
131 commit;
132 end if;
133 END CALCULATE_EXCEPTIONS;
134
135 PROCEDURE CALCULATE_AUDIT_EXCEPTIONS(p_plan_id IN NUMBER,
136 p_request_id OUT NOCOPY NUMBER) IS
137 l_result boolean;
138 l_request_id number;
139 BEGIN
140
141 --FND_GLOBAL.APPS_INITIALIZE(FND_GLOBAL.user_id, FND_GLOBAL.resp_id, 390);
142 --l_result := FND_REQUEST.SET_MODE(TRUE);
143
144 l_request_id := NULL;
145 l_request_id := FND_REQUEST.SUBMIT_REQUEST( application => 'MST', --application
146 program => 'MSTEARCP',-- program
147 argument1 => p_plan_id);
148
149 /*FND_REQUEST.SUBMIT_REQUEST(
150 'MST', -- application
151 'MSTEARCP',-- program
152 NULL, -- description
153 NULL, -- start_time
154 FALSE, -- sub_request
155 p_plan_id); -- plan id*/
156 p_request_id := l_request_id;
157 if l_request_id <> 0 then
158 commit;
159 end if;
160 END CALCULATE_AUDIT_EXCEPTIONS;
161
162 PROCEDURE start_online_planner(p_plan_id IN NUMBER,
163 p_request_id OUT NOCOPY NUMBER) IS
164 l_result boolean;
165 l_request_id number;
166 BEGIN
167 l_request_id := NULL;
168 l_request_id := FND_REQUEST.SUBMIT_REQUEST(
169 'MST', -- application
170 'MSTOPNCP',-- program
171 NULL, -- description
172 NULL, -- start_time
173 FALSE, -- sub_request
174 p_plan_id, -- source plan id
175 4, -- optimized_flag: start online planner
176 1, -- maintain user edits: none
177 2, -- allow removal from firm trips: No
178 2, -- run audit report
179 1, -- run exception flag
180 1); -- run kpi flag
181 p_request_id := l_request_id;
182 if l_request_id <> 0 then
183 --update mst_plans set engine_active_flag = 1, request_id = l_request_id where plan_id = p_plan_id;
184 update mst_plans set state = 4, program = 4, request_id = l_request_id where plan_id = p_plan_id;
185 commit;
186 end if;
187 END start_online_planner;
188
189 END MST_CP_WRAPPER;
190