[Home] [Help]
PACKAGE BODY: APPS.PER_REC_ACTIVITY_FOR_API
Source
1 Package Body PER_REC_ACTIVITY_FOR_API as
2 /* $Header: percfapi.pkb 115.5 2002/12/10 16:15:30 eumenyio ship $ */
3 --
4 -- Package Variables
5 --
6 g_package varchar2(33) := ' PER_REC_ACTIVITY_FOR_API.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |--------------------------< CREATE_REC_ACTIVITY_FOR >---------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure create_rec_activity_for
13 (
14 p_validate in boolean default false
15 ,p_rec_activity_for_id out nocopy number
16 ,p_business_group_id in number
17 ,p_vacancy_id in number
18 ,p_rec_activity_id in number
19 ,p_object_version_number out nocopy number
20 ) is
21 --
22 -- Declare cursors and local variables
23 --
24
25 l_proc varchar2(72) := g_package||'create_rec_activity_for';
26 l_rec_activity_for_id number;
27 l_object_version_number number;
28
29 begin
30 hr_utility.set_location('Entering:'|| l_proc, 10);
31 --
32 -- Issue a savepoint
33 --
34 savepoint create_rec_activity_for;
35
36 --
37 -- Call Before Process User Hook
38 --
39 begin
40 PER_REC_ACTIVITY_FOR_BK1.CREATE_REC_ACTIVITY_FOR_B
41 (
42 p_rec_activity_for_id => l_rec_activity_for_id
43 ,p_business_group_id => p_business_group_id
44 ,p_vacancy_id => p_vacancy_id
45 ,p_rec_activity_id => p_rec_activity_id
46 );
47 exception
48 when hr_api.cannot_find_prog_unit then
49 hr_api.cannot_find_prog_unit_error
50 (p_module_name => 'CREATE_REC_ACTIVITY_FOR'
51 ,p_hook_type => 'BP'
52 );
53 end;
54 --
55 -- Process Logic
56 --
57 per_rcf_ins.ins
58 (
59 p_rec_activity_for_id => l_rec_activity_for_id
60 ,p_object_version_number => l_object_version_number
61 ,p_business_group_id => p_business_group_id
62 ,p_vacancy_id => p_vacancy_id
63 ,p_rec_activity_id => p_rec_activity_id
64 );
65
66 --
67 -- Call After Process User Hook
68 --
69 begin
70 PER_REC_ACTIVITY_FOR_BK1.CREATE_REC_ACTIVITY_FOR_A
71 (
72 p_rec_activity_for_id => l_rec_activity_for_id
73 ,p_business_group_id => p_business_group_id
74 ,p_vacancy_id => p_vacancy_id
75 ,p_rec_activity_id => p_rec_activity_id
76 ,p_object_version_number => l_object_version_number
77 );
78 exception
79 when hr_api.cannot_find_prog_unit then
80 hr_api.cannot_find_prog_unit_error
81 (p_module_name => 'CREATE_REC_ACTIVITY_FOR'
82 ,p_hook_type => 'AP'
83 );
84 end;
85 --
86 -- When in validation only mode raise the Validate_Enabled exception
87 --
88 if p_validate then
89 raise hr_api.validate_enabled;
90 end if;
91 --
92 -- Set all output arguments
93 --
94 p_rec_activity_for_id := l_rec_activity_for_id;
95 p_object_version_number := l_object_version_number;
96 --
97 hr_utility.set_location(' Leaving:'||l_proc, 70);
98 exception
99 when hr_api.validate_enabled then
100 --
101 -- As the Validate_Enabled exception has been raised
102 -- we must rollback to the savepoint
103 --
104 rollback to CREATE_REC_ACTIVITY_FOR;
105 --
106 -- Only set output warning arguments
107 -- (Any key or derived arguments must be set to null
108 -- when validation only mode is being used.)
109 --
110 p_rec_activity_for_id := null;
111 p_object_version_number := null;
112 hr_utility.set_location(' Leaving:'||l_proc, 80);
113 when others then
114 --
115 -- A validation or unexpected error has occured
116 --
117 p_rec_activity_for_id := null;
118 p_object_version_number := null;
119 rollback to CREATE_REC_ACTIVITY_FOR;
120 hr_utility.set_location(' Leaving:'||l_proc, 90);
121 raise;
122 end CREATE_REC_ACTIVITY_FOR;
123 --
124 -- ----------------------------------------------------------------------------
125 -- |--------------------------< UPDATE_REC_ACTIVITY_FOR >---------------------|
126 -- ----------------------------------------------------------------------------
127 --
128 procedure update_REC_ACTIVITY_FOR
129 (p_validate in boolean default false
130 ,p_rec_activity_for_id in number
131 ,p_vacancy_id in number default hr_api.g_number
132 ,p_rec_activity_id in number default hr_api.g_number
133 ,p_object_version_number in out nocopy number
134 ) is
135 --
136 -- Declare cursors and local variables
137 --
138
139 l_proc varchar2(72) := g_package||'update_REC_ACTIVITY_FOR';
140 l_object_version_number number := p_object_version_number;
141 l_temp_ovn number := p_object_version_number;
142 begin
143 hr_utility.set_location('Entering:'|| l_proc, 10);
144 --
145 -- Issue a savepoint
146 --
147 savepoint UPDATE_REC_ACTIVITY_FOR;
148
149 --
150 -- Call Before Process User Hook
151 --
152 begin
153 PER_REC_ACTIVITY_FOR_BK2.UPDATE_REC_ACTIVITY_FOR_B
154 (
155 p_rec_activity_for_id => p_rec_activity_for_id
156 ,p_vacancy_id => p_vacancy_id
157 ,p_rec_activity_id => p_rec_activity_id
158 ,p_object_version_number => l_object_version_number
159 );
160 exception
161 when hr_api.cannot_find_prog_unit then
162 hr_api.cannot_find_prog_unit_error
163 (p_module_name => 'UPDATE_REC_ACTIVITY_FOR'
164 ,p_hook_type => 'BP'
165 );
166 end;
167 --
168 -- Process Logic
169 --
170 per_rcf_upd.upd
171 (
172 p_rec_activity_for_id => p_rec_activity_for_id
173 ,p_vacancy_id => p_vacancy_id
174 ,p_rec_activity_id => p_rec_activity_id
175 ,p_object_version_number => l_object_version_number
176 );
177 --
178 --
179 -- Call After Process User Hook
180 --
181 begin
182 PER_REC_ACTIVITY_FOR_BK2.UPDATE_REC_ACTIVITY_FOR_A
183 (
184 p_rec_activity_for_id => p_rec_activity_for_id
185 ,p_vacancy_id => p_vacancy_id
186 ,p_rec_activity_id => p_rec_activity_id
187 ,p_object_version_number => l_object_version_number
188 );
189
190 exception
191 when hr_api.cannot_find_prog_unit then
192 hr_api.cannot_find_prog_unit_error
193 (p_module_name => 'UPDATE_REC_ACTIVITY_FOR'
194 ,p_hook_type => 'AP'
195 );
196 end;
197 --
198 -- When in validation only mode raise the Validate_Enabled exception
199 --
200 if p_validate then
201 raise hr_api.validate_enabled;
202 end if;
203 --
204 -- Set all output arguments
205 --
206 p_object_version_number := l_object_version_number;
207 --
208 hr_utility.set_location(' Leaving:'||l_proc, 70);
209 exception
210 when hr_api.validate_enabled then
211 --
212 -- As the Validate_Enabled exception has been raised
213 -- we must rollback to the savepoint
214 --
215 rollback to UPDATE_REC_ACTIVITY_FOR;
216 --
217 -- Only set output warning arguments
218 -- (Any key or derived arguments must be set to null
219 -- when validation only mode is being used.)
220 --
221 hr_utility.set_location(' Leaving:'||l_proc, 80);
222 when others then
223 --
224 -- A validation or unexpected error has occured
225 --
226 p_object_version_number := l_temp_ovn;
227 rollback to UPDATE_REC_ACTIVITY_FOR;
228 hr_utility.set_location(' Leaving:'||l_proc, 90);
229 raise;
230 end UPDATE_REC_ACTIVITY_FOR;
231 --
232 -- ----------------------------------------------------------------------------
233 -- |--------------------------< DELETE_REC_ACTIVITY_FOR >---------------------|
234 -- ----------------------------------------------------------------------------
235 --
236 procedure delete_rec_activity_for
237 (p_validate in boolean default false
238 ,p_rec_activity_for_id in number
239 ,p_object_version_number in number
240 ) is
241 --
242 -- Declare cursors and local variables
243 --
244
245 l_proc varchar2(72) := g_package||'delete_REC_ACTIVITY_FOR';
246 begin
247 hr_utility.set_location('Entering:'|| l_proc, 10);
248 --
249 -- Issue a savepoint
250 --
251 savepoint DELETE_REC_ACTIVITY_FOR;
252
253 --
254 -- Call Before Process User Hook
255 --
256 begin
257 PER_REC_ACTIVITY_FOR_BK3.DELETE_REC_ACTIVITY_FOR_B
258 (
259 p_rec_activity_for_id => p_rec_activity_for_id
260 ,p_object_version_number => p_object_version_number
261 );
262 exception
263 when hr_api.cannot_find_prog_unit then
264 hr_api.cannot_find_prog_unit_error
265 (p_module_name => 'DELETE_REC_ACTIVITY_FOR'
266 ,p_hook_type => 'BP'
267 );
268 end;
269
270 --
271 -- Process Logic
272 --
273
274 per_rcf_del.del
275 (
276 p_rec_activity_for_id => p_rec_activity_for_id
277 ,p_object_version_number => p_object_version_number
278 );
279
280
281 --
282 -- Call After Process User Hook
283 --
284 begin
285 PER_REC_ACTIVITY_FOR_BK3.DELETE_REC_ACTIVITY_FOR_A
286 (
287 p_rec_activity_for_id => p_rec_activity_for_id
288 ,p_object_version_number => p_object_version_number
289 );
290 exception
291 when hr_api.cannot_find_prog_unit then
292 hr_api.cannot_find_prog_unit_error
293 (p_module_name => 'DELETE_REC_ACTIVITY_FOR'
294 ,p_hook_type => 'AP'
295 );
296 end;
297 --
298 -- When in validation only mode raise the Validate_Enabled exception
299 --
300 if p_validate then
301 raise hr_api.validate_enabled;
302 end if;
303 --
304 -- Set all output arguments
305 --
306 --
307 hr_utility.set_location(' Leaving:'||l_proc, 70);
308 exception
309 when hr_api.validate_enabled then
310 --
311 -- As the Validate_Enabled exception has been raised
312 -- we must rollback to the savepoint
313 --
314 rollback to DELETE_REC_ACTIVITY_FOR;
315 --
316 -- Only set output warning arguments
317 -- (Any key or derived arguments must be set to null
318 -- when validation only mode is being used.)
319 --
320 hr_utility.set_location(' Leaving:'||l_proc, 80);
321 when others then
322 --
323 -- A validation or unexpected error has occured
324 --
325 rollback to DELETE_REC_ACTIVITY_FOR;
326 hr_utility.set_location(' Leaving:'||l_proc, 90);
327 raise;
328 end DELETE_REC_ACTIVITY_FOR;
329 --
330 end PER_REC_ACTIVITY_FOR_API;