DBA Data[Home] [Help]

PACKAGE BODY: APPS.JTF_TASK_WORKFLOW_PKG_W

Source


1 package body jtf_task_workflow_pkg_w as
2   /* $Header: jtfrtkwb.pls 120.2 2005/07/05 10:51:29 knayyar ship $ */
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_p3(t out nocopy jtf_task_workflow_pkg.task_details_tbl, a0 JTF_VARCHAR2_TABLE_100
23     , a1 JTF_VARCHAR2_TABLE_100
24     , a2 JTF_VARCHAR2_TABLE_100
25     ) as
26     ddindx binary_integer; indx binary_integer;
27   begin
28   if a0 is not null and a0.count > 0 then
29       if a0.count > 0 then
30         indx := a0.first;
31         ddindx := 1;
32         while true loop
33           t(ddindx).task_attribute := a0(indx);
34           t(ddindx).old_value := a1(indx);
35           t(ddindx).new_value := a2(indx);
36           ddindx := ddindx+1;
37           if a0.last =indx
38             then exit;
39           end if;
40           indx := a0.next(indx);
41         end loop;
42       end if;
43    end if;
44   end rosetta_table_copy_in_p3;
45   procedure rosetta_table_copy_out_p3(t jtf_task_workflow_pkg.task_details_tbl, a0 out nocopy JTF_VARCHAR2_TABLE_100
46     , a1 out nocopy JTF_VARCHAR2_TABLE_100
47     , a2 out nocopy JTF_VARCHAR2_TABLE_100
48     ) as
49     ddindx binary_integer; indx binary_integer;
50   begin
51   if t is null or t.count = 0 then
52     a0 := JTF_VARCHAR2_TABLE_100();
53     a1 := JTF_VARCHAR2_TABLE_100();
54     a2 := JTF_VARCHAR2_TABLE_100();
55   else
56       a0 := JTF_VARCHAR2_TABLE_100();
57       a1 := JTF_VARCHAR2_TABLE_100();
58       a2 := JTF_VARCHAR2_TABLE_100();
59       if t.count > 0 then
60         a0.extend(t.count);
61         a1.extend(t.count);
62         a2.extend(t.count);
63         ddindx := t.first;
64         indx := 1;
65         while true loop
66           a0(indx) := t(ddindx).task_attribute;
67           a1(indx) := t(ddindx).old_value;
68           a2(indx) := t(ddindx).new_value;
69           indx := indx+1;
70           if t.last =ddindx
71             then exit;
72           end if;
73           ddindx := t.next(ddindx);
74         end loop;
75       end if;
76    end if;
77   end rosetta_table_copy_out_p3;
78 
79   function get_workflow_disp_name(p_item_type  VARCHAR2
80     , p_process_name  VARCHAR2
81     , p_raise_error  number
82   ) return varchar2
83 
84   as
85     ddp_raise_error boolean;
86     ddindx binary_integer; indx binary_integer;
87     ddrosetta_retval varchar2(4000);
88   begin
89 
90     -- copy data to the local IN or IN-OUT args, if any
91 
92 
93     if p_raise_error is null
94       then ddp_raise_error := null;
95     elsif p_raise_error = 0
96       then ddp_raise_error := false;
97     else ddp_raise_error := true;
98     end if;
99 
100     -- here's the delegated call to the old PL/SQL routine
101     ddrosetta_retval := jtf_task_workflow_pkg.get_workflow_disp_name(p_item_type,
102       p_process_name,
103       ddp_raise_error);
104 
105     -- copy data back from the local variables to OUT or IN-OUT args, if any
106 
107 
108 
109     return ddrosetta_retval;
110   end;
111 
112   procedure start_task_workflow(p_api_version  NUMBER
113     , p_init_msg_list  VARCHAR2
114     , p_commit  VARCHAR2
115     , p_task_id  NUMBER
116     , p_old_assignee_code  VARCHAR2
117     , p_old_assignee_id  NUMBER
118     , p_new_assignee_code  VARCHAR2
119     , p_new_assignee_id  NUMBER
120     , p_old_owner_code  VARCHAR2
121     , p_old_owner_id  NUMBER
122     , p_new_owner_code  VARCHAR2
123     , p_new_owner_id  NUMBER
124     , p12_a0 JTF_VARCHAR2_TABLE_100
125     , p12_a1 JTF_VARCHAR2_TABLE_100
126     , p12_a2 JTF_VARCHAR2_TABLE_100
127     , p_event  VARCHAR2
128     , p_wf_display_name  VARCHAR2
129     , p_wf_process  VARCHAR2
130     , p_wf_item_type  VARCHAR2
131     , x_return_status out nocopy  VARCHAR2
132     , x_msg_count out nocopy  NUMBER
133     , x_msg_data out nocopy  VARCHAR2
134   )
135 
136   as
137     ddp_task_details_tbl jtf_task_workflow_pkg.task_details_tbl;
138     ddindx binary_integer; indx binary_integer;
139   begin
140 
141     -- copy data to the local IN or IN-OUT args, if any
142 
143 
144 
145 
146 
147 
148 
149 
150 
151 
152 
153 
154     jtf_task_workflow_pkg_w.rosetta_table_copy_in_p3(ddp_task_details_tbl, p12_a0
155       , p12_a1
156       , p12_a2
157       );
158 
159 
160 
161 
162 
163 
164 
165 
166     -- here's the delegated call to the old PL/SQL routine
167     jtf_task_workflow_pkg.start_task_workflow(p_api_version,
168       p_init_msg_list,
169       p_commit,
170       p_task_id,
171       p_old_assignee_code,
172       p_old_assignee_id,
173       p_new_assignee_code,
174       p_new_assignee_id,
175       p_old_owner_code,
176       p_old_owner_id,
177       p_new_owner_code,
178       p_new_owner_id,
179       ddp_task_details_tbl,
180       p_event,
181       p_wf_display_name,
182       p_wf_process,
183       p_wf_item_type,
184       x_return_status,
185       x_msg_count,
186       x_msg_data);
187 
188     -- copy data back from the local variables to OUT or IN-OUT args, if any
189 
190 
191 
192 
193 
194 
195 
196 
197 
198 
199 
200 
201 
202 
203 
204 
205 
206 
207 
208   end;
209 
210 end jtf_task_workflow_pkg_w;