1 Package Body pqh_de_vldjob_swi As
2 /* $Header: pqwvjswi.pkb 115.1 2002/12/05 00:32:27 rpasapul noship $ */
3 --
4 -- Package variables
5 --
6 g_package varchar2(33) := 'pqh_de_vldjob_swi.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |---------------------------< delete_vldtn_job >---------------------------|
10 -- ----------------------------------------------------------------------------
11 PROCEDURE delete_vldtn_job
12 (p_validate in number default hr_api.g_false_num
13 ,p_wrkplc_vldtn_job_id in number
14 ,p_object_version_number in number
15 ,p_return_status out nocopy varchar2
16 ) is
17 --
18 -- Variables for API Boolean parameters
19 l_validate boolean;
20 --
21 -- Variables for IN/OUT parameters
22 --
23 -- Other variables
24 l_proc varchar2(72) := g_package ||'delete_vldtn_job';
25 Begin
26 hr_utility.set_location(' Entering:' || l_proc,10);
27 --
28 -- Issue a savepoint
29 --
30 savepoint delete_vldtn_job_swi;
31 --
32 -- Initialise Multiple Message Detection
33 --
34 hr_multi_message.enable_message_list;
35 --
36 -- Remember IN OUT parameter IN values
37 --
38 --
39 -- Convert constant values to their corresponding boolean value
40 --
41 l_validate :=
42 hr_api.constant_to_boolean
43 (p_constant_value => p_validate);
44 --
45 -- Register Surrogate ID or user key values
46 --
47 --
48 -- Call API
49 --
50 pqh_de_vldjob_api.delete_vldtn_job
51 (p_validate => l_validate
52 ,p_wrkplc_vldtn_job_id => p_wrkplc_vldtn_job_id
53 ,p_object_version_number => p_object_version_number
54 );
55 --
56 -- Convert API warning boolean parameter values to specific
57 -- messages and add them to Multiple Message List
58 --
59 --
60 -- Convert API non-warning boolean parameter values
61 --
62 --
63 -- Derive the API return status value based on whether
64 -- messages of any type exist in the Multiple Message List.
65 -- Also disable Multiple Message Detection.
66 --
67 p_return_status := hr_multi_message.get_return_status_disable;
68 hr_utility.set_location(' Leaving:' || l_proc,20);
69 --
70 exception
71 when hr_multi_message.error_message_exist then
72 --
73 -- Catch the Multiple Message List exception which
74 -- indicates API processing has been aborted because
75 -- at least one message exists in the list.
76 --
77 rollback to delete_vldtn_job_swi;
78 --
79 -- Reset IN OUT parameters and set OUT parameters
80 --
81 p_return_status := hr_multi_message.get_return_status_disable;
82 hr_utility.set_location(' Leaving:' || l_proc, 30);
83 when others then
84 --
85 -- When Multiple Message Detection is enabled catch
86 -- any Application specific or other unexpected
87 -- exceptions. Adding appropriate details to the
88 -- Multiple Message List. Otherwise re-raise the
89 -- error.
90 --
91 rollback to delete_vldtn_job_swi;
92 if hr_multi_message.unexpected_error_add(l_proc) then
93 hr_utility.set_location(' Leaving:' || l_proc,40);
94 raise;
95 end if;
96 --
97 -- Reset IN OUT and set OUT parameters
98 --
99 p_return_status := hr_multi_message.get_return_status_disable;
100 hr_utility.set_location(' Leaving:' || l_proc,50);
101 end delete_vldtn_job;
102 -- ----------------------------------------------------------------------------
103 -- |---------------------------< insert_vldtn_job >---------------------------|
104 -- ----------------------------------------------------------------------------
105 PROCEDURE insert_vldtn_job
106 (p_validate in number default hr_api.g_false_num
107 ,p_effective_date in date
108 ,p_business_group_id in number
109 ,p_wrkplc_vldtn_op_id in number
110 ,p_wrkplc_job_id in number
111 ,p_description in varchar2
112 ,p_wrkplc_vldtn_job_id out nocopy number
113 ,p_object_version_number out nocopy number
114 ,p_return_status out nocopy varchar2
115 ) is
116 --
117 -- Variables for API Boolean parameters
118 l_validate boolean;
119 --
120 -- Variables for IN/OUT parameters
121 --
122 -- Other variables
123 l_proc varchar2(72) := g_package ||'insert_vldtn_job';
124 Begin
125 hr_utility.set_location(' Entering:' || l_proc,10);
126 --
127 -- Issue a savepoint
128 --
129 savepoint insert_vldtn_job_swi;
130 --
131 -- Initialise Multiple Message Detection
132 --
133 hr_multi_message.enable_message_list;
134 --
135 -- Remember IN OUT parameter IN values
136 --
137 --
138 -- Convert constant values to their corresponding boolean value
139 --
140 l_validate :=
141 hr_api.constant_to_boolean
142 (p_constant_value => p_validate);
143 --
144 -- Register Surrogate ID or user key values
145 --
146 pqh_job_ins.set_base_key_value
147 (p_wrkplc_vldtn_job_id => p_wrkplc_vldtn_job_id
148 );
149 --
150 -- Call API
151 --
152 pqh_de_vldjob_api.insert_vldtn_job
153 (p_validate => l_validate
154 ,p_effective_date => p_effective_date
155 ,p_business_group_id => p_business_group_id
156 ,p_wrkplc_vldtn_op_id => p_wrkplc_vldtn_op_id
157 ,p_wrkplc_job_id => p_wrkplc_job_id
158 ,p_description => p_description
159 ,p_wrkplc_vldtn_job_id => p_wrkplc_vldtn_job_id
160 ,p_object_version_number => p_object_version_number
161 );
162 --
163 -- Convert API warning boolean parameter values to specific
164 -- messages and add them to Multiple Message List
165 --
166 --
167 -- Convert API non-warning boolean parameter values
168 --
169 --
170 -- Derive the API return status value based on whether
171 -- messages of any type exist in the Multiple Message List.
172 -- Also disable Multiple Message Detection.
173 --
174 p_return_status := hr_multi_message.get_return_status_disable;
175 hr_utility.set_location(' Leaving:' || l_proc,20);
176 --
177 exception
178 when hr_multi_message.error_message_exist then
179 --
180 -- Catch the Multiple Message List exception which
181 -- indicates API processing has been aborted because
182 -- at least one message exists in the list.
183 --
184 rollback to insert_vldtn_job_swi;
185 --
186 -- Reset IN OUT parameters and set OUT parameters
187 --
188 p_wrkplc_vldtn_job_id := null;
189 p_object_version_number := null;
190 p_return_status := hr_multi_message.get_return_status_disable;
191 hr_utility.set_location(' Leaving:' || l_proc, 30);
192 when others then
193 --
194 -- When Multiple Message Detection is enabled catch
195 -- any Application specific or other unexpected
196 -- exceptions. Adding appropriate details to the
197 -- Multiple Message List. Otherwise re-raise the
198 -- error.
199 --
200 rollback to insert_vldtn_job_swi;
201 if hr_multi_message.unexpected_error_add(l_proc) then
202 hr_utility.set_location(' Leaving:' || l_proc,40);
203 raise;
204 end if;
205 --
206 -- Reset IN OUT and set OUT parameters
207 --
208 p_wrkplc_vldtn_job_id := null;
209 p_object_version_number := null;
210 p_return_status := hr_multi_message.get_return_status_disable;
211 hr_utility.set_location(' Leaving:' || l_proc,50);
212 end insert_vldtn_job;
213 -- ----------------------------------------------------------------------------
214 -- |---------------------------< update_vldtn_job >---------------------------|
215 -- ----------------------------------------------------------------------------
216 PROCEDURE update_vldtn_job
217 (p_validate in number default hr_api.g_false_num
218 ,p_effective_date in date
219 ,p_business_group_id in number default hr_api.g_number
220 ,p_wrkplc_vldtn_op_id in number default hr_api.g_number
221 ,p_wrkplc_job_id in number default hr_api.g_number
222 ,p_description in varchar2 default hr_api.g_varchar2
223 ,p_wrkplc_vldtn_job_id in number
224 ,p_object_version_number in out nocopy number
225 ,p_return_status out nocopy varchar2
226 ) is
227 --
228 -- Variables for API Boolean parameters
229 l_validate boolean;
230 --
231 -- Variables for IN/OUT parameters
232 l_object_version_number number;
233 --
234 -- Other variables
235 l_proc varchar2(72) := g_package ||'update_vldtn_job';
236 Begin
237 hr_utility.set_location(' Entering:' || l_proc,10);
238 --
239 -- Issue a savepoint
240 --
241 savepoint update_vldtn_job_swi;
242 --
243 -- Initialise Multiple Message Detection
244 --
245 hr_multi_message.enable_message_list;
246 --
247 -- Remember IN OUT parameter IN values
248 --
249 l_object_version_number := p_object_version_number;
250 --
251 -- Convert constant values to their corresponding boolean value
252 --
253 l_validate :=
254 hr_api.constant_to_boolean
255 (p_constant_value => p_validate);
256 --
257 -- Register Surrogate ID or user key values
258 --
259 --
260 -- Call API
261 --
262 pqh_de_vldjob_api.update_vldtn_job
263 (p_validate => l_validate
264 ,p_effective_date => p_effective_date
265 ,p_business_group_id => p_business_group_id
266 ,p_wrkplc_vldtn_op_id => p_wrkplc_vldtn_op_id
267 ,p_wrkplc_job_id => p_wrkplc_job_id
268 ,p_description => p_description
269 ,p_wrkplc_vldtn_job_id => p_wrkplc_vldtn_job_id
270 ,p_object_version_number => p_object_version_number
271 );
272 --
273 -- Convert API warning boolean parameter values to specific
274 -- messages and add them to Multiple Message List
275 --
276 --
277 -- Convert API non-warning boolean parameter values
278 --
279 --
283 --
280 -- Derive the API return status value based on whether
281 -- messages of any type exist in the Multiple Message List.
282 -- Also disable Multiple Message Detection.
284 p_return_status := hr_multi_message.get_return_status_disable;
285 hr_utility.set_location(' Leaving:' || l_proc,20);
286 --
287 exception
288 when hr_multi_message.error_message_exist then
289 --
290 -- Catch the Multiple Message List exception which
291 -- indicates API processing has been aborted because
292 -- at least one message exists in the list.
293 --
294 rollback to update_vldtn_job_swi;
295 --
296 -- Reset IN OUT parameters and set OUT parameters
297 --
298 p_object_version_number := l_object_version_number;
299 p_return_status := hr_multi_message.get_return_status_disable;
300 hr_utility.set_location(' Leaving:' || l_proc, 30);
301 when others then
302 --
303 -- When Multiple Message Detection is enabled catch
304 -- any Application specific or other unexpected
305 -- exceptions. Adding appropriate details to the
306 -- Multiple Message List. Otherwise re-raise the
307 -- error.
308 --
309 rollback to update_vldtn_job_swi;
310 if hr_multi_message.unexpected_error_add(l_proc) then
311 hr_utility.set_location(' Leaving:' || l_proc,40);
312 raise;
313 end if;
314 --
315 -- Reset IN OUT and set OUT parameters
316 --
317 p_object_version_number := l_object_version_number;
318 p_return_status := hr_multi_message.get_return_status_disable;
319 hr_utility.set_location(' Leaving:' || l_proc,50);
320 end update_vldtn_job;
321 end pqh_de_vldjob_swi;