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