DBA Data[Home] [Help]

PACKAGE BODY: APPS.OKC_XPRT_XRULE_VALUES_PVT_W

Source


1 package body okc_xprt_xrule_values_pvt_w as
2   /* $Header: OKCWXXRULVB.pls 120.3 2005/12/14 16:11 arsundar noship $ */
3   rosetta_g_mistake_date date := to_date('01/01/+4713', 'MM/DD/SYYYY');
4   rosetta_g_miss_date date := to_date('01/01/-4712', 'MM/DD/SYYYY');
5 
6   -- this is to workaround the JDBC bug regarding IN DATE of value GMiss
7   function rosetta_g_miss_date_in_map(d date) return date as
8   begin
9     if d = rosetta_g_mistake_date then return fnd_api.g_miss_date; end if;
10     return d;
11   end;
12 
13   function rosetta_g_miss_num_map(n number) return number as
14     a number := fnd_api.g_miss_num;
15     b number := 0-1962.0724;
16   begin
17     if n=a then return b; end if;
18     if n=b then return a; end if;
19     return n;
20   end;
21 
22   procedure rosetta_table_copy_in_p4(t out nocopy okc_xprt_xrule_values_pvt.sys_var_value_tbl_type, a0 JTF_VARCHAR2_TABLE_100
23     , a1 JTF_VARCHAR2_TABLE_2500
24     ) as
25     ddindx binary_integer; indx binary_integer;
26   begin
27   if a0 is not null and a0.count > 0 then
28       if a0.count > 0 then
29         indx := a0.first;
30         ddindx := 1;
31         while true loop
32           t(ddindx).variable_code := a0(indx);
33           t(ddindx).variable_value_id := a1(indx);
34           ddindx := ddindx+1;
35           if a0.last =indx
36             then exit;
37           end if;
38           indx := a0.next(indx);
39         end loop;
40       end if;
41    end if;
42   end rosetta_table_copy_in_p4;
43   procedure rosetta_table_copy_out_p4(t okc_xprt_xrule_values_pvt.sys_var_value_tbl_type, a0 out nocopy JTF_VARCHAR2_TABLE_100
44     , a1 out nocopy JTF_VARCHAR2_TABLE_2500
45     ) as
46     ddindx binary_integer; indx binary_integer;
47   begin
48   if t is null or t.count = 0 then
49     a0 := JTF_VARCHAR2_TABLE_100();
50     a1 := JTF_VARCHAR2_TABLE_2500();
51   else
52       a0 := JTF_VARCHAR2_TABLE_100();
53       a1 := JTF_VARCHAR2_TABLE_2500();
54       if t.count > 0 then
55         a0.extend(t.count);
56         a1.extend(t.count);
57         ddindx := t.first;
58         indx := 1;
59         while true loop
60           a0(indx) := t(ddindx).variable_code;
61           a1(indx) := t(ddindx).variable_value_id;
62           indx := indx+1;
63           if t.last =ddindx
64             then exit;
65           end if;
66           ddindx := t.next(ddindx);
67         end loop;
68       end if;
69    end if;
70   end rosetta_table_copy_out_p4;
71 
72   procedure rosetta_table_copy_in_p5(t out nocopy okc_xprt_xrule_values_pvt.category_tbl_type, a0 JTF_VARCHAR2_TABLE_2000
73     ) as
74     ddindx binary_integer; indx binary_integer;
75   begin
76   if a0 is not null and a0.count > 0 then
77       if a0.count > 0 then
78         indx := a0.first;
79         ddindx := 1;
80         while true loop
81           t(ddindx).category_name := a0(indx);
82           ddindx := ddindx+1;
83           if a0.last =indx
84             then exit;
85           end if;
86           indx := a0.next(indx);
87         end loop;
88       end if;
89    end if;
90   end rosetta_table_copy_in_p5;
91   procedure rosetta_table_copy_out_p5(t okc_xprt_xrule_values_pvt.category_tbl_type, a0 out nocopy JTF_VARCHAR2_TABLE_2000
92     ) as
93     ddindx binary_integer; indx binary_integer;
94   begin
95   if t is null or t.count = 0 then
96     a0 := JTF_VARCHAR2_TABLE_2000();
97   else
98       a0 := JTF_VARCHAR2_TABLE_2000();
99       if t.count > 0 then
100         a0.extend(t.count);
101         ddindx := t.first;
102         indx := 1;
103         while true loop
104           a0(indx) := t(ddindx).category_name;
105           indx := indx+1;
106           if t.last =ddindx
107             then exit;
108           end if;
109           ddindx := t.next(ddindx);
110         end loop;
111       end if;
112    end if;
113   end rosetta_table_copy_out_p5;
114 
115   procedure rosetta_table_copy_in_p6(t out nocopy okc_xprt_xrule_values_pvt.item_tbl_type, a0 JTF_VARCHAR2_TABLE_2000
116     ) as
117     ddindx binary_integer; indx binary_integer;
118   begin
119   if a0 is not null and a0.count > 0 then
120       if a0.count > 0 then
121         indx := a0.first;
122         ddindx := 1;
123         while true loop
124           t(ddindx).name := a0(indx);
125           ddindx := ddindx+1;
126           if a0.last =indx
127             then exit;
128           end if;
129           indx := a0.next(indx);
130         end loop;
131       end if;
132    end if;
133   end rosetta_table_copy_in_p6;
134   procedure rosetta_table_copy_out_p6(t okc_xprt_xrule_values_pvt.item_tbl_type, a0 out nocopy JTF_VARCHAR2_TABLE_2000
135     ) as
136     ddindx binary_integer; indx binary_integer;
137   begin
138   if t is null or t.count = 0 then
139     a0 := JTF_VARCHAR2_TABLE_2000();
140   else
141       a0 := JTF_VARCHAR2_TABLE_2000();
142       if t.count > 0 then
143         a0.extend(t.count);
144         ddindx := t.first;
145         indx := 1;
146         while true loop
147           a0(indx) := t(ddindx).name;
148           indx := indx+1;
149           if t.last =ddindx
150             then exit;
151           end if;
152           ddindx := t.next(ddindx);
153         end loop;
154       end if;
155    end if;
156   end rosetta_table_copy_out_p6;
157 
158   procedure rosetta_table_copy_in_p7(t out nocopy okc_xprt_xrule_values_pvt.constant_tbl_type, a0 JTF_VARCHAR2_TABLE_100
159     , a1 JTF_VARCHAR2_TABLE_100
160     ) as
161     ddindx binary_integer; indx binary_integer;
162   begin
163   if a0 is not null and a0.count > 0 then
164       if a0.count > 0 then
165         indx := a0.first;
166         ddindx := 1;
167         while true loop
168           t(ddindx).constant_id := a0(indx);
169           t(ddindx).value := a1(indx);
170           ddindx := ddindx+1;
171           if a0.last =indx
172             then exit;
173           end if;
174           indx := a0.next(indx);
175         end loop;
176       end if;
177    end if;
178   end rosetta_table_copy_in_p7;
179   procedure rosetta_table_copy_out_p7(t okc_xprt_xrule_values_pvt.constant_tbl_type, a0 out nocopy JTF_VARCHAR2_TABLE_100
180     , a1 out nocopy JTF_VARCHAR2_TABLE_100
181     ) as
182     ddindx binary_integer; indx binary_integer;
183   begin
184   if t is null or t.count = 0 then
185     a0 := JTF_VARCHAR2_TABLE_100();
186     a1 := JTF_VARCHAR2_TABLE_100();
187   else
188       a0 := JTF_VARCHAR2_TABLE_100();
189       a1 := JTF_VARCHAR2_TABLE_100();
190       if t.count > 0 then
191         a0.extend(t.count);
192         a1.extend(t.count);
193         ddindx := t.first;
194         indx := 1;
195         while true loop
196           a0(indx) := t(ddindx).constant_id;
197           a1(indx) := t(ddindx).value;
198           indx := indx+1;
199           if t.last =ddindx
200             then exit;
201           end if;
202           ddindx := t.next(ddindx);
203         end loop;
204       end if;
205    end if;
206   end rosetta_table_copy_out_p7;
207 
208   procedure rosetta_table_copy_in_p9(t out nocopy okc_xprt_xrule_values_pvt.line_sys_var_value_tbl_type, a0 JTF_VARCHAR2_TABLE_300
209     , a1 JTF_VARCHAR2_TABLE_100
210     , a2 JTF_VARCHAR2_TABLE_2500
211     , a3 JTF_NUMBER_TABLE
212     , a4 JTF_NUMBER_TABLE
213     ) as
214     ddindx binary_integer; indx binary_integer;
215   begin
216   if a0 is not null and a0.count > 0 then
217       if a0.count > 0 then
218         indx := a0.first;
219         ddindx := 1;
220         while true loop
221           t(ddindx).line_number := a0(indx);
222           t(ddindx).variable_code := a1(indx);
223           t(ddindx).variable_value := a2(indx);
224           t(ddindx).item_id := rosetta_g_miss_num_map(a3(indx));
225           t(ddindx).org_id := rosetta_g_miss_num_map(a4(indx));
226           ddindx := ddindx+1;
227           if a0.last =indx
228             then exit;
229           end if;
230           indx := a0.next(indx);
231         end loop;
232       end if;
233    end if;
234   end rosetta_table_copy_in_p9;
235   procedure rosetta_table_copy_out_p9(t okc_xprt_xrule_values_pvt.line_sys_var_value_tbl_type, a0 out nocopy JTF_VARCHAR2_TABLE_300
236     , a1 out nocopy JTF_VARCHAR2_TABLE_100
237     , a2 out nocopy JTF_VARCHAR2_TABLE_2500
238     , a3 out nocopy JTF_NUMBER_TABLE
239     , a4 out nocopy JTF_NUMBER_TABLE
240     ) as
241     ddindx binary_integer; indx binary_integer;
242   begin
243   if t is null or t.count = 0 then
244     a0 := JTF_VARCHAR2_TABLE_300();
245     a1 := JTF_VARCHAR2_TABLE_100();
246     a2 := JTF_VARCHAR2_TABLE_2500();
247     a3 := JTF_NUMBER_TABLE();
248     a4 := JTF_NUMBER_TABLE();
249   else
250       a0 := JTF_VARCHAR2_TABLE_300();
251       a1 := JTF_VARCHAR2_TABLE_100();
252       a2 := JTF_VARCHAR2_TABLE_2500();
253       a3 := JTF_NUMBER_TABLE();
254       a4 := JTF_NUMBER_TABLE();
255       if t.count > 0 then
256         a0.extend(t.count);
257         a1.extend(t.count);
258         a2.extend(t.count);
259         a3.extend(t.count);
260         a4.extend(t.count);
261         ddindx := t.first;
262         indx := 1;
263         while true loop
264           a0(indx) := t(ddindx).line_number;
265           a1(indx) := t(ddindx).variable_code;
266           a2(indx) := t(ddindx).variable_value;
267           a3(indx) := rosetta_g_miss_num_map(t(ddindx).item_id);
268           a4(indx) := rosetta_g_miss_num_map(t(ddindx).org_id);
269           indx := indx+1;
270           if t.last =ddindx
271             then exit;
272           end if;
273           ddindx := t.next(ddindx);
274         end loop;
275       end if;
276    end if;
277   end rosetta_table_copy_out_p9;
278 
279   procedure rosetta_table_copy_in_p10(t out nocopy okc_xprt_xrule_values_pvt.udf_var_value_tbl_type, a0 JTF_VARCHAR2_TABLE_100
280     , a1 JTF_VARCHAR2_TABLE_2500
281     ) as
282     ddindx binary_integer; indx binary_integer;
283   begin
284   if a0 is not null and a0.count > 0 then
285       if a0.count > 0 then
286         indx := a0.first;
287         ddindx := 1;
288         while true loop
289           t(ddindx).variable_code := a0(indx);
290           t(ddindx).variable_value_id := a1(indx);
291           ddindx := ddindx+1;
292           if a0.last =indx
293             then exit;
294           end if;
295           indx := a0.next(indx);
296         end loop;
297       end if;
298    end if;
299   end rosetta_table_copy_in_p10;
300   procedure rosetta_table_copy_out_p10(t okc_xprt_xrule_values_pvt.udf_var_value_tbl_type, a0 out nocopy JTF_VARCHAR2_TABLE_100
301     , a1 out nocopy JTF_VARCHAR2_TABLE_2500
302     ) as
303     ddindx binary_integer; indx binary_integer;
304   begin
305   if t is null or t.count = 0 then
306     a0 := JTF_VARCHAR2_TABLE_100();
307     a1 := JTF_VARCHAR2_TABLE_2500();
308   else
309       a0 := JTF_VARCHAR2_TABLE_100();
310       a1 := JTF_VARCHAR2_TABLE_2500();
311       if t.count > 0 then
312         a0.extend(t.count);
313         a1.extend(t.count);
314         ddindx := t.first;
315         indx := 1;
316         while true loop
317           a0(indx) := t(ddindx).variable_code;
318           a1(indx) := t(ddindx).variable_value_id;
319           indx := indx+1;
320           if t.last =ddindx
321             then exit;
322           end if;
323           ddindx := t.next(ddindx);
324         end loop;
325       end if;
326    end if;
327   end rosetta_table_copy_out_p10;
328 
329   procedure rosetta_table_copy_in_p11(t out nocopy okc_xprt_xrule_values_pvt.var_value_tbl_type, a0 JTF_VARCHAR2_TABLE_100
330     , a1 JTF_VARCHAR2_TABLE_2500
331     ) as
332     ddindx binary_integer; indx binary_integer;
333   begin
334   if a0 is not null and a0.count > 0 then
335       if a0.count > 0 then
336         indx := a0.first;
337         ddindx := 1;
338         while true loop
339           t(ddindx).variable_code := a0(indx);
340           t(ddindx).variable_value_id := a1(indx);
341           ddindx := ddindx+1;
342           if a0.last =indx
343             then exit;
344           end if;
345           indx := a0.next(indx);
346         end loop;
347       end if;
348    end if;
349   end rosetta_table_copy_in_p11;
350   procedure rosetta_table_copy_out_p11(t okc_xprt_xrule_values_pvt.var_value_tbl_type, a0 out nocopy JTF_VARCHAR2_TABLE_100
351     , a1 out nocopy JTF_VARCHAR2_TABLE_2500
352     ) as
353     ddindx binary_integer; indx binary_integer;
354   begin
355   if t is null or t.count = 0 then
356     a0 := JTF_VARCHAR2_TABLE_100();
357     a1 := JTF_VARCHAR2_TABLE_2500();
358   else
359       a0 := JTF_VARCHAR2_TABLE_100();
360       a1 := JTF_VARCHAR2_TABLE_2500();
361       if t.count > 0 then
362         a0.extend(t.count);
363         a1.extend(t.count);
364         ddindx := t.first;
365         indx := 1;
366         while true loop
367           a0(indx) := t(ddindx).variable_code;
368           a1(indx) := t(ddindx).variable_value_id;
369           indx := indx+1;
370           if t.last =ddindx
371             then exit;
372           end if;
373           ddindx := t.next(ddindx);
374         end loop;
375       end if;
376    end if;
377   end rosetta_table_copy_out_p11;
378 
379   procedure get_system_variables(p_api_version  NUMBER
380     , p_init_msg_list  VARCHAR2
381     , x_return_status out nocopy  VARCHAR2
382     , x_msg_data out nocopy  VARCHAR2
383     , x_msg_count out nocopy  NUMBER
384     , p_doc_type  VARCHAR2
385     , p_doc_id  NUMBER
386     , p_only_doc_variables  VARCHAR2
387     , p8_a0 out nocopy JTF_VARCHAR2_TABLE_100
388     , p8_a1 out nocopy JTF_VARCHAR2_TABLE_2500
389   )
390 
391   as
392     ddx_sys_var_value_tbl okc_xprt_xrule_values_pvt.var_value_tbl_type;
393     ddindx binary_integer; indx binary_integer;
394   begin
395 
396     -- copy data to the local IN or IN-OUT args, if any
397 
398 
399 
400 
401 
402 
403 
404 
405 
406     -- here's the delegated call to the old PL/SQL routine
407     okc_xprt_xrule_values_pvt.get_system_variables(p_api_version,
408       p_init_msg_list,
409       x_return_status,
410       x_msg_data,
411       x_msg_count,
412       p_doc_type,
413       p_doc_id,
414       p_only_doc_variables,
415       ddx_sys_var_value_tbl);
416 
417     -- copy data back from the local variables to OUT or IN-OUT args, if any
418 
419 
420 
421 
422 
423 
424 
425 
426     okc_xprt_xrule_values_pvt_w.rosetta_table_copy_out_p11(ddx_sys_var_value_tbl, p8_a0
427       , p8_a1
428       );
429   end;
430 
431   procedure get_constant_values(p_api_version  NUMBER
432     , p_init_msg_list  VARCHAR2
433     , p_intent  VARCHAR2
434     , x_return_status out nocopy  VARCHAR2
435     , x_msg_data out nocopy  VARCHAR2
436     , x_msg_count out nocopy  NUMBER
437     , p6_a0 out nocopy JTF_VARCHAR2_TABLE_100
438     , p6_a1 out nocopy JTF_VARCHAR2_TABLE_100
439   )
440 
441   as
442     ddx_constant_tbl okc_xprt_xrule_values_pvt.constant_tbl_type;
443     ddindx binary_integer; indx binary_integer;
444   begin
445 
446     -- copy data to the local IN or IN-OUT args, if any
447 
448 
449 
450 
451 
452 
453 
454     -- here's the delegated call to the old PL/SQL routine
455     okc_xprt_xrule_values_pvt.get_constant_values(p_api_version,
456       p_init_msg_list,
457       p_intent,
458       x_return_status,
459       x_msg_data,
460       x_msg_count,
461       ddx_constant_tbl);
462 
463     -- copy data back from the local variables to OUT or IN-OUT args, if any
464 
465 
466 
467 
468 
469 
470     okc_xprt_xrule_values_pvt_w.rosetta_table_copy_out_p7(ddx_constant_tbl, p6_a0
471       , p6_a1
472       );
473   end;
474 
475   procedure get_line_system_variables(p_api_version  NUMBER
476     , p_init_msg_list  VARCHAR2
477     , p_doc_type  VARCHAR2
478     , p_doc_id  NUMBER
479     , p_org_id  NUMBER
480     , x_return_status out nocopy  VARCHAR2
481     , x_msg_data out nocopy  VARCHAR2
482     , x_msg_count out nocopy  NUMBER
483     , p8_a0 out nocopy JTF_VARCHAR2_TABLE_300
484     , p8_a1 out nocopy JTF_VARCHAR2_TABLE_100
485     , p8_a2 out nocopy JTF_VARCHAR2_TABLE_2500
486     , p8_a3 out nocopy JTF_NUMBER_TABLE
487     , p8_a4 out nocopy JTF_NUMBER_TABLE
488     , x_line_count out nocopy  NUMBER
489     , x_line_variables_count out nocopy  NUMBER
490   )
491 
492   as
493     ddx_line_sys_var_value_tbl okc_xprt_xrule_values_pvt.line_sys_var_value_tbl_type;
494     ddindx binary_integer; indx binary_integer;
495   begin
496 
497     -- copy data to the local IN or IN-OUT args, if any
498 
499 
500 
501 
502 
503 
504 
505 
506 
507 
508 
509     -- here's the delegated call to the old PL/SQL routine
510     okc_xprt_xrule_values_pvt.get_line_system_variables(p_api_version,
511       p_init_msg_list,
512       p_doc_type,
513       p_doc_id,
514       p_org_id,
515       x_return_status,
516       x_msg_data,
517       x_msg_count,
518       ddx_line_sys_var_value_tbl,
519       x_line_count,
520       x_line_variables_count);
521 
522     -- copy data back from the local variables to OUT or IN-OUT args, if any
523 
524 
525 
526 
527 
528 
529 
530 
531     okc_xprt_xrule_values_pvt_w.rosetta_table_copy_out_p9(ddx_line_sys_var_value_tbl, p8_a0
532       , p8_a1
533       , p8_a2
534       , p8_a3
535       , p8_a4
536       );
537 
538 
539   end;
540 
541   procedure get_user_defined_variables(p_api_version  NUMBER
542     , p_init_msg_list  VARCHAR2
543     , p_doc_type  VARCHAR2
544     , p_doc_id  NUMBER
545     , p_org_id  NUMBER
546     , p_intent  VARCHAR2
547     , x_return_status out nocopy  VARCHAR2
548     , x_msg_data out nocopy  VARCHAR2
549     , x_msg_count out nocopy  NUMBER
550     , p9_a0 out nocopy JTF_VARCHAR2_TABLE_100
551     , p9_a1 out nocopy JTF_VARCHAR2_TABLE_2500
552   )
553 
554   as
555     ddx_udf_var_value_tbl okc_xprt_xrule_values_pvt.udf_var_value_tbl_type;
556     ddindx binary_integer; indx binary_integer;
557   begin
558 
559     -- copy data to the local IN or IN-OUT args, if any
560 
561 
562 
563 
564 
565 
566 
567 
568 
569 
570     -- here's the delegated call to the old PL/SQL routine
571     okc_xprt_xrule_values_pvt.get_user_defined_variables(p_api_version,
572       p_init_msg_list,
573       p_doc_type,
574       p_doc_id,
575       p_org_id,
576       p_intent,
577       x_return_status,
578       x_msg_data,
579       x_msg_count,
580       ddx_udf_var_value_tbl);
581 
582     -- copy data back from the local variables to OUT or IN-OUT args, if any
583 
584 
585 
586 
587 
588 
589 
590 
591 
592     okc_xprt_xrule_values_pvt_w.rosetta_table_copy_out_p10(ddx_udf_var_value_tbl, p9_a0
593       , p9_a1
594       );
595   end;
596 
597   procedure get_document_values(p_api_version  NUMBER
598     , p_init_msg_list  VARCHAR2
599     , p_doc_type  VARCHAR2
600     , p_doc_id  NUMBER
601     , x_return_status out nocopy  VARCHAR2
602     , x_msg_data out nocopy  VARCHAR2
603     , x_msg_count out nocopy  NUMBER
604     , p7_a0 out nocopy JTF_VARCHAR2_TABLE_100
605     , p7_a1 out nocopy JTF_VARCHAR2_TABLE_2500
606     , p8_a0 out nocopy JTF_VARCHAR2_TABLE_300
607     , p8_a1 out nocopy JTF_VARCHAR2_TABLE_100
608     , p8_a2 out nocopy JTF_VARCHAR2_TABLE_2500
609     , p8_a3 out nocopy JTF_NUMBER_TABLE
610     , p8_a4 out nocopy JTF_NUMBER_TABLE
611     , x_line_count out nocopy  NUMBER
612     , x_line_variables_count out nocopy  NUMBER
613     , x_intent out nocopy  VARCHAR2
614     , x_org_id out nocopy  NUMBER
615   )
616 
617   as
618     ddx_hdr_var_value_tbl okc_xprt_xrule_values_pvt.var_value_tbl_type;
619     ddx_line_sysvar_value_tbl okc_xprt_xrule_values_pvt.line_sys_var_value_tbl_type;
620     ddindx binary_integer; indx binary_integer;
621   begin
622 
623     -- copy data to the local IN or IN-OUT args, if any
624 
625 
626 
627 
628 
629 
630 
631 
632 
633 
634 
635 
636 
637     -- here's the delegated call to the old PL/SQL routine
638     okc_xprt_xrule_values_pvt.get_document_values(p_api_version,
639       p_init_msg_list,
640       p_doc_type,
641       p_doc_id,
642       x_return_status,
643       x_msg_data,
644       x_msg_count,
645       ddx_hdr_var_value_tbl,
646       ddx_line_sysvar_value_tbl,
647       x_line_count,
648       x_line_variables_count,
649       x_intent,
650       x_org_id);
651 
652     -- copy data back from the local variables to OUT or IN-OUT args, if any
653 
654 
655 
656 
657 
658 
659 
660     okc_xprt_xrule_values_pvt_w.rosetta_table_copy_out_p11(ddx_hdr_var_value_tbl, p7_a0
661       , p7_a1
662       );
663 
664     okc_xprt_xrule_values_pvt_w.rosetta_table_copy_out_p9(ddx_line_sysvar_value_tbl, p8_a0
665       , p8_a1
666       , p8_a2
667       , p8_a3
668       , p8_a4
669       );
670 
671 
672 
673 
674   end;
675 
676 end okc_xprt_xrule_values_pvt_w;