[Home] [Help]
PACKAGE BODY: APPS.JTF_TASK_WF_UTIL_W
Source
1 package body jtf_task_wf_util_w as
2 /* $Header: jtfvtkwb.pls 120.2 2006/04/26 04:42 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 rosetta_g_mistake_date_high date := to_date('01/01/+4710', 'MM/DD/SYYYY');
6 rosetta_g_mistake_date_low date := to_date('01/01/-4710', 'MM/DD/SYYYY');
7
8 -- this is to workaround the JDBC bug regarding IN DATE of value GMiss
9 function rosetta_g_miss_date_in_map(d date) return date as
10 begin
11 if d > rosetta_g_mistake_date_high then return fnd_api.g_miss_date; end if;
12 if d < rosetta_g_mistake_date_low then return fnd_api.g_miss_date; end if;
13 return d;
14 end;
15
16 procedure rosetta_table_copy_in_p4(t out nocopy jtf_task_wf_util.nlist_tbl_type, a0 JTF_VARCHAR2_TABLE_400
17 , a1 JTF_VARCHAR2_TABLE_400
18 , a2 JTF_VARCHAR2_TABLE_400
19 ) as
20 ddindx binary_integer; indx binary_integer;
21 begin
22 if a0 is not null and a0.count > 0 then
23 if a0.count > 0 then
24 indx := a0.first;
25 ddindx := 1;
26 while true loop
27 t(ddindx).name := a0(indx);
28 t(ddindx).display_name := a1(indx);
29 t(ddindx).email_address := a2(indx);
30 ddindx := ddindx+1;
31 if a0.last =indx
32 then exit;
33 end if;
34 indx := a0.next(indx);
35 end loop;
36 end if;
37 end if;
38 end rosetta_table_copy_in_p4;
39 procedure rosetta_table_copy_out_p4(t jtf_task_wf_util.nlist_tbl_type, a0 out nocopy JTF_VARCHAR2_TABLE_400
40 , a1 out nocopy JTF_VARCHAR2_TABLE_400
41 , a2 out nocopy JTF_VARCHAR2_TABLE_400
42 ) as
43 ddindx binary_integer; indx binary_integer;
44 begin
45 if t is null or t.count = 0 then
46 a0 := JTF_VARCHAR2_TABLE_400();
47 a1 := JTF_VARCHAR2_TABLE_400();
48 a2 := JTF_VARCHAR2_TABLE_400();
49 else
50 a0 := JTF_VARCHAR2_TABLE_400();
51 a1 := JTF_VARCHAR2_TABLE_400();
52 a2 := JTF_VARCHAR2_TABLE_400();
53 if t.count > 0 then
54 a0.extend(t.count);
55 a1.extend(t.count);
56 a2.extend(t.count);
57 ddindx := t.first;
58 indx := 1;
59 while true loop
60 a0(indx) := t(ddindx).name;
61 a1(indx) := t(ddindx).display_name;
62 a2(indx) := t(ddindx).email_address;
63 indx := indx+1;
64 if t.last =ddindx
65 then exit;
66 end if;
67 ddindx := t.next(ddindx);
68 end loop;
69 end if;
70 end if;
71 end rosetta_table_copy_out_p4;
72
73 procedure do_notification(p_task_id NUMBER
74 , ddrosetta_retval_bool OUT NOCOPY NUMBER
75 )
76
77 as
78 ddindx binary_integer; indx binary_integer;
79 ddrosetta_retval boolean;
80 begin
81
82 -- copy data to the local IN or IN-OUT args, if any
83
84 -- here's the delegated call to the old PL/SQL routine
85 ddrosetta_retval := jtf_task_wf_util.do_notification(p_task_id);
86
87 -- copy data back from the local variables to OUT or IN-OUT args, if any
88 if ddrosetta_retval is null
89 then ddrosetta_retval_bool := null;
90 elsif ddrosetta_retval
91 then ddrosetta_retval_bool := 1;
92 else ddrosetta_retval_bool := 0;
93 end if;
94 end;
95
96 procedure create_notification(p_event VARCHAR2
97 , p_task_id NUMBER
98 , p_old_owner_id NUMBER
99 , p_old_owner_code VARCHAR2
100 , p_old_assignee_id NUMBER
101 , p_old_assignee_code VARCHAR2
102 , p_new_assignee_id NUMBER
103 , p_new_assignee_code VARCHAR2
104 , p_old_type NUMBER
105 , p_old_priority NUMBER
106 , p_old_status NUMBER
107 , p_old_planned_start_date date
108 , p_old_planned_end_date date
109 , p_old_scheduled_start_date date
110 , p_old_scheduled_end_date date
111 , p_old_actual_start_date date
112 , p_old_actual_end_date date
113 , p_old_description VARCHAR2
114 , p_abort_workflow VARCHAR2
115 , x_return_status out nocopy VARCHAR2
116 , x_msg_count out nocopy NUMBER
117 , x_msg_data out nocopy VARCHAR2
118 )
119
120 as
121 ddp_old_planned_start_date date;
122 ddp_old_planned_end_date date;
123 ddp_old_scheduled_start_date date;
124 ddp_old_scheduled_end_date date;
125 ddp_old_actual_start_date date;
126 ddp_old_actual_end_date date;
127 ddindx binary_integer; indx binary_integer;
128 begin
129
130 -- copy data to the local IN or IN-OUT args, if any
131
132
133
134
135
136
137
138
139
140
141
142 ddp_old_planned_start_date := rosetta_g_miss_date_in_map(p_old_planned_start_date);
143
144 ddp_old_planned_end_date := rosetta_g_miss_date_in_map(p_old_planned_end_date);
145
146 ddp_old_scheduled_start_date := rosetta_g_miss_date_in_map(p_old_scheduled_start_date);
147
148 ddp_old_scheduled_end_date := rosetta_g_miss_date_in_map(p_old_scheduled_end_date);
149
150 ddp_old_actual_start_date := rosetta_g_miss_date_in_map(p_old_actual_start_date);
151
152 ddp_old_actual_end_date := rosetta_g_miss_date_in_map(p_old_actual_end_date);
153
154
155
156
157
158
159 -- here's the delegated call to the old PL/SQL routine
160 jtf_task_wf_util.create_notification(p_event,
161 p_task_id,
162 p_old_owner_id,
163 p_old_owner_code,
164 p_old_assignee_id,
165 p_old_assignee_code,
166 p_new_assignee_id,
167 p_new_assignee_code,
168 p_old_type,
169 p_old_priority,
170 p_old_status,
171 ddp_old_planned_start_date,
172 ddp_old_planned_end_date,
173 ddp_old_scheduled_start_date,
174 ddp_old_scheduled_end_date,
175 ddp_old_actual_start_date,
176 ddp_old_actual_end_date,
177 p_old_description,
178 p_abort_workflow,
179 x_return_status,
180 x_msg_count,
181 x_msg_data);
182
183 -- copy data back from the local variables to OUT or IN-OUT args, if any
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205 end;
206
207 end jtf_task_wf_util_w;