DBA Data[Home] [Help]

PACKAGE BODY: APPS.FTP_BR_TP_PROCESS_RULE_PVT

Source


1 PACKAGE BODY ftp_br_tp_process_rule_pvt AS
2 /* $Header: ftpbtprb.pls 120.0 2005/06/06 19:21:13 appldev noship $ */
3 
4 --------------------------------------------------------------------------------
5 -- PRIVATE CONSTANTS
6 --------------------------------------------------------------------------------
7 G_PKG_NAME constant varchar2(30) := 'FTP_BR_TP_PROCESS_RULE_PVT';
8 --------------------------------------------------------------------------------
9 -- PRIVATE SPECIFICATIONS
10 --------------------------------------------------------------------------------
11 PROCEDURE DeleteTpProcessRuleRec(
12   p_obj_def_id          in          number
13 );
14 PROCEDURE DeleteTpStochAssumpRecs(
15   p_obj_def_id          in          number
16 );
17 PROCEDURE DeleteMigrationColumnRecs(
18   p_obj_def_id          in          number
19 );
20 PROCEDURE DeleteProcessTableRecs(
21   p_obj_def_id          in          number
22 );
23 PROCEDURE CopyTpProcessRuleRec(
24   p_source_obj_def_id   in          number
25   ,p_target_obj_def_id  in          number
26   ,p_created_by         in          number
27   ,p_creation_date      in          date
28 );
29 PROCEDURE CopyTpStochAssumpRecs(
30   p_source_obj_def_id   in          number
31   ,p_target_obj_def_id  in          number
32   ,p_created_by         in          number
33   ,p_creation_date      in          date
34 );
35 PROCEDURE CopyMigrationColumnRecs(
36   p_source_obj_def_id   in          number
37   ,p_target_obj_def_id  in          number
38   ,p_created_by         in          number
39   ,p_creation_date      in          date
40 );
41 PROCEDURE CopyProcessTableRecs(
42   p_source_obj_def_id   in          number
43   ,p_target_obj_def_id  in          number
44   ,p_created_by         in          number
45   ,p_creation_date      in          date
46 );
47 --------------------------------------------------------------------------------
48 -- PUBLIC BODIES
49 --------------------------------------------------------------------------------
50 --
51 -- PROCEDURE
52 --	 DeleteObjectDefinition
53 --
54 -- DESCRIPTION
55 --   Deletes all the details records of a TP Process Rule Definition.
56 --
57 -- IN
58 --   p_obj_def_id    - Object Definition ID.
59 --
60 --------------------------------------------------------------------------------
61 PROCEDURE DeleteObjectDefinition(
62   p_obj_def_id          in          number
63 )
64 --------------------------------------------------------------------------------
65 IS
66   g_api_name    constant varchar2(30)   := 'DeleteObjectDefinition';
67 BEGIN
68   DeleteProcessTableRecs(
69     p_obj_def_id     => p_obj_def_id
70   );
71   DeleteMigrationColumnRecs(
72     p_obj_def_id     => p_obj_def_id
73   );
74   DeleteTpStochAssumpRecs(
75     p_obj_def_id     => p_obj_def_id
76   );
77   DeleteTpProcessRuleRec(
78     p_obj_def_id     => p_obj_def_id
79   );
80 EXCEPTION
81   when others then
82     FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, g_api_name);
83     raise FND_API.G_EXC_UNEXPECTED_ERROR;
84 END DeleteObjectDefinition;
85 --
86 -- PROCEDURE
87 --	 CopyObjectDefinition
88 --
89 -- DESCRIPTION
90 --   Creates all the detail records of a new TP Process Rule Definition (target)
91 --   by copying the detail records of another TP Process Rule Definition (source).
92 --
93 -- IN
94 --   p_source_obj_def_id    - Source Object Definition ID.
95 --   p_target_obj_def_id    - Target Object Definition ID.
96 --   p_created_by           - FND User ID (optional).
97 --   p_creation_date        - System Date (optional).
98 --
99 --------------------------------------------------------------------------------
100 PROCEDURE CopyObjectDefinition(
101   p_source_obj_def_id   in          number
102   ,p_target_obj_def_id  in          number
103   ,p_created_by         in          number
104   ,p_creation_date      in          date
105 )
106 --------------------------------------------------------------------------------
107 IS
108   g_api_name    constant varchar2(30)   := 'CopyObjectDefinition';
109 BEGIN
110   CopyTpProcessRuleRec(
111     p_source_obj_def_id   => p_source_obj_def_id
112     ,p_target_obj_def_id  => p_target_obj_def_id
113     ,p_created_by         => p_created_by
114     ,p_creation_date      => p_creation_date
115   );
116   CopyTpStochAssumpRecs(
117     p_source_obj_def_id   => p_source_obj_def_id
118     ,p_target_obj_def_id  => p_target_obj_def_id
119     ,p_created_by         => p_created_by
120     ,p_creation_date      => p_creation_date
121   );
122   CopyMigrationColumnRecs(
123     p_source_obj_def_id   => p_source_obj_def_id
124     ,p_target_obj_def_id  => p_target_obj_def_id
125     ,p_created_by         => p_created_by
126     ,p_creation_date      => p_creation_date
127   );
128   CopyProcessTableRecs(
129     p_source_obj_def_id   => p_source_obj_def_id
130     ,p_target_obj_def_id  => p_target_obj_def_id
131     ,p_created_by         => p_created_by
132     ,p_creation_date      => p_creation_date
133   );
134 EXCEPTION
135   when others then
136     FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, g_api_name);
137     raise FND_API.G_EXC_UNEXPECTED_ERROR;
138 END CopyObjectDefinition;
139 --------------------------------------------------------------------------------
140 -- PRIVATE BODIES
141 --------------------------------------------------------------------------------
142 --
143 -- PROCEDURE
144 --	 DeleteTpProcessRuleRec
145 --
146 -- DESCRIPTION
147 --   Deletes a TP Process Rule Definition by performing deletes on records
148 --   in the FTP_TP_PROCESS_RULE table.
149 --
150 -- IN
151 --   p_obj_def_id    - Object Definition ID.
152 --
153 --------------------------------------------------------------------------------
154 PROCEDURE DeleteTpProcessRuleRec(
155   p_obj_def_id in number
156 )
157 --------------------------------------------------------------------------------
158 IS
159 BEGIN
160   delete from ftp_tp_process_rule
161   where object_definition_id = p_obj_def_id;
162 END DeleteTpProcessRuleRec;
163 --
164 -- PROCEDURE
165 --	 DeleteTpStochAssumpRecs
166 --
167 -- DESCRIPTION
168 --   Deletes Tp Process Rule by performing deletes on records
169 --   in the FTP_TP_STOCH_ASSUMP table.
170 --
171 -- IN
172 --   p_obj_def_id    - Object Definition ID.
173 --
174 --------------------------------------------------------------------------------
175 PROCEDURE DeleteTpStochAssumpRecs(
176   p_obj_def_id in number
177 )
178 --------------------------------------------------------------------------------
179 IS
180 BEGIN
181   delete from ftp_tp_stoch_assump
182   where object_definition_id = p_obj_def_id;
183 END DeleteTpStochAssumpRecs;
184 --
185 -- PROCEDURE
186 --	 DeleteMigrationColumnRecs
187 --
188 -- DESCRIPTION
189 --   Delete TP Process Rule Definition Migration Columns by performing deletes on records
190 --   in the FTP_TP_SELCTD_COLUMNS table.
191 --
192 -- IN
193 --   p_obj_def_id    - Object Definition ID.
194 --
195 --------------------------------------------------------------------------------
196 PROCEDURE DeleteMigrationColumnRecs(
197   p_obj_def_id in number
198 )
199 --------------------------------------------------------------------------------
200 IS
201 BEGIN
202   delete from ftp_tp_selctd_columns
203   where object_definition_id = p_obj_def_id;
204 END DeleteMigrationColumnRecs;
205 --
206 -- PROCEDURE
207 --	 DeleteProcessTableRecs
208 --
209 -- DESCRIPTION
210 --   Delete TP Process Rule Definition Process Tables by performing deletes on records
211 --   in the FTP_TP_PROCESS_TABLES table.
212 --
213 -- IN
214 --   p_obj_def_id    - Object Definition ID.
215 --
216 --------------------------------------------------------------------------------
217 PROCEDURE DeleteProcessTableRecs(
218   p_obj_def_id in number
219 )
220 --------------------------------------------------------------------------------
221 IS
222 BEGIN
223   delete from ftp_tp_process_tables
224   where object_definition_id = p_obj_def_id;
225 END DeleteProcessTableRecs;
226 --
227 -- PROCEDURE
228 --	 CopyTpProcessRuleRec
229 --
230 -- DESCRIPTION
231 --   Creates a new TP Process Rule Definition by copying records in the
232 --   FTP_TP_PROCESS_RULE table.
233 --
234 -- IN
235 --   p_source_obj_def_id    - Source Object Definition ID.
236 --   p_target_obj_def_id    - Target Object Definition ID.
237 --   p_created_by           - FND User ID (optional).
238 --   p_creation_date        - System Date (optional).
239 --
240 --------------------------------------------------------------------------------
241 PROCEDURE CopyTpProcessRuleRec(
242   p_source_obj_def_id   in          number
243   ,p_target_obj_def_id  in          number
244   ,p_created_by         in          number
245   ,p_creation_date      in          date
246 )
247 --------------------------------------------------------------------------------
248 IS
249 BEGIN
250   insert into ftp_tp_process_rule (
251         object_definition_id
252         ,calc_mode_code
253         ,transfer_price_object_id
254         ,prepay_object_id
255         ,filter_object_id
256         ,dtl_cashflow_flg
257         ,skip_nonzero_trans_rate_flg
258         ,skip_nonzero_opt_cost_flg
259         ,trans_rate_propagate_flg
260         ,trans_rate_calc_flg
261         ,trans_rate_migrate_flg
262         ,option_cost_propagate_flg
263         ,option_cost_calc_flg
264         ,option_cost_migrate_flg
265         ,write_forward_rate_flg
266         ,accrual_code
267         ,currency_flg
268         ,creation_date
269         ,created_by
270         ,last_updated_by
271         ,last_update_date
272         ,last_update_login
273         ,object_version_number
274   ) select
275          p_target_obj_def_id
276         ,calc_mode_code
277         ,transfer_price_object_id
278         ,prepay_object_id
279         ,filter_object_id
280         ,dtl_cashflow_flg
281         ,skip_nonzero_trans_rate_flg
282         ,skip_nonzero_opt_cost_flg
283         ,trans_rate_propagate_flg
284         ,trans_rate_calc_flg
285         ,trans_rate_migrate_flg
286         ,option_cost_propagate_flg
287         ,option_cost_calc_flg
288         ,option_cost_migrate_flg
289         ,write_forward_rate_flg
290         ,accrual_code
291         ,currency_flg
292         ,nvl(p_creation_date,creation_date)
293         ,nvl(p_created_by,created_by)
294         ,FND_GLOBAL.user_id
295         ,sysdate
296         ,FND_GLOBAL.login_id
297         ,object_version_number
298   from ftp_tp_process_rule
299   where object_definition_id = p_source_obj_def_id;
300 END CopyTpProcessRuleRec;
301 --
302 -- PROCEDURE
303 --	 CopyTpStochAssumpRecs
304 --
305 -- DESCRIPTION
306 --   Creates a new TP Process Rule Definition Tp Stochiastic Assumptions by copying records in the
307 --   FTP_TP_STOCH_ASSUMP table.
308 --
309 -- IN
310 --   p_source_obj_def_id    - Source Object Definition ID.
311 --   p_target_obj_def_id    - Target Object Definition ID.
312 --   p_created_by           - FND User ID (optional).
313 --   p_creation_date        - System Date (optional).
314 --
315 --------------------------------------------------------------------------------
316 PROCEDURE CopyTpStochAssumpRecs(
317   p_source_obj_def_id   in          number
318   ,p_target_obj_def_id  in          number
322 --------------------------------------------------------------------------------
319   ,p_created_by         in          number
320   ,p_creation_date      in          date
321 )
323 IS
324 BEGIN
325   insert into ftp_tp_stoch_assump (
326         object_definition_id
327         ,rate_index_object_id
328         ,num_of_rate_path
329         ,rand_seq_type_code
330         ,ts_model_code
331         ,smoothing_method_code
332         ,write_1mn_rate_flg
333         ,creation_date
334         ,created_by
335         ,last_updated_by
336         ,last_update_date
337         ,last_update_login
338         ,object_version_number
339         ,valuation_curve_code
340   ) select
341         p_target_obj_def_id
342         ,rate_index_object_id
343         ,num_of_rate_path
344         ,rand_seq_type_code
345         ,ts_model_code
346         ,smoothing_method_code
347         ,write_1mn_rate_flg
348         ,nvl(p_creation_date,creation_date)
349         ,nvl(p_created_by,created_by)
350         ,FND_GLOBAL.user_id
351         ,sysdate
352         ,FND_GLOBAL.login_id
353         ,object_version_number
354         ,valuation_curve_code
355   from ftp_tp_stoch_assump
356   where object_definition_id = p_source_obj_def_id;
357 END CopyTpStochAssumpRecs;
358 --
359 -- PROCEDURE
360 --	 CopyMigrationColumnRecs
361 --
362 -- DESCRIPTION
363 --   Creates new TP Process Rule Definition Migration Columns by copying records in the
364 --   FTP_TP_SELCTD_COLUMNS table.
365 --
366 -- IN
367 --   p_source_obj_def_id    - Source Object Definition ID.
368 --   p_target_obj_def_id    - Target Object Definition ID.
369 --   p_created_by           - FND User ID (optional).
370 --   p_creation_date        - System Date (optional).
371 --
372 --------------------------------------------------------------------------------
373 PROCEDURE CopyMigrationColumnRecs(
374   p_source_obj_def_id   in          number
375   ,p_target_obj_def_id  in          number
376   ,p_created_by         in          number
377   ,p_creation_date      in          date
378 )
379 --------------------------------------------------------------------------------
380 IS
381 BEGIN
382   insert into ftp_tp_selctd_columns(
383         object_definition_id
384         ,column_id
385         ,creation_date
386         ,created_by
387         ,last_updated_by
388         ,last_update_date
389         ,last_update_login
390         ,object_version_number
391   ) select
392         p_target_obj_def_id
393         ,column_id
394         ,nvl(p_creation_date,creation_date)
395         ,nvl(p_created_by,created_by)
396         ,FND_GLOBAL.user_id
397         ,sysdate
398         ,FND_GLOBAL.login_id
399         ,object_version_number
400   from ftp_tp_selctd_columns
401   where object_definition_id = p_source_obj_def_id;
402 END CopyMigrationColumnRecs;
403 --
404 -- PROCEDURE
405 --	 CopyProcessTableRecs
406 --
407 -- DESCRIPTION
408 --   Creates new TP Process Rule Definition Process Tables by copying records in the
409 --   FTP_TP_PROCESS_TABLES table.
410 --
411 -- IN
412 --   p_source_obj_def_id    - Source Object Definition ID.
413 --   p_target_obj_def_id    - Target Object Definition ID.
414 --   p_created_by           - FND User ID (optional).
415 --   p_creation_date        - System Date (optional).
416 --
417 --------------------------------------------------------------------------------
418 PROCEDURE CopyProcessTableRecs(
419   p_source_obj_def_id   in          number
420   ,p_target_obj_def_id  in          number
421   ,p_created_by         in          number
422   ,p_creation_date      in          date
423 )
424 --------------------------------------------------------------------------------
425 IS
426 BEGIN
427   insert into ftp_tp_process_tables(
428         object_definition_id
429         ,table_name
430         ,creation_date
431         ,created_by
432         ,last_updated_by
433         ,last_update_date
434         ,last_update_login
435         ,object_version_number
436   ) select
437          p_target_obj_def_id
438         ,table_name
439         ,nvl(p_creation_date,creation_date)
440         ,nvl(p_created_by,created_by)
441         ,FND_GLOBAL.user_id
442         ,sysdate
443         ,FND_GLOBAL.login_id
444         ,object_version_number
445   from ftp_tp_process_tables
446   where object_definition_id = p_source_obj_def_id;
447 END CopyProcessTableRecs;
448 END FTP_BR_TP_PROCESS_RULE_PVT;