DBA Data[Home] [Help]

PACKAGE BODY: APPS.OTA_RESOURCE_DEFINITION_API

Source


1 PACKAGE BODY OTA_RESOURCE_DEFINITION_API as
2     /* $Header: ottsrapi.pkb 120.3 2006/02/13 02:49:59 jbharath noship $ */
3 --
4 -- Package Variables
5 --
6 g_package  varchar2(33) := '  OTA_RESOURCE_DEFINITION_API.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |-------------------------< CREATE_RESOURCE_DEFINITION >------------------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure CREATE_RESOURCE_DEFINITION
13   (  p_supplied_resource_id          out nocopy number
14   ,p_vendor_id                    in number
15   ,p_business_group_id            in number
16   ,p_resource_definition_id       in number
17   ,p_consumable_flag              in varchar2 default null
18   ,p_object_version_number        out nocopy number
19   ,p_resource_type                in varchar2 default null
20   ,p_start_date                   in date default null
21   ,p_comments                     in varchar2 default null
22   ,p_cost                         in number
23   ,p_cost_unit                    in varchar2 default null
24   ,p_currency_code                in varchar2 default null
25   ,p_end_date                     in date default null
26   ,p_internal_address_line        in varchar2 default null
27   ,p_lead_time                    in number
28   ,p_name                         in varchar2 default null
29   ,p_supplier_reference           in varchar2 default null
30   ,p_tsr_information_category     in varchar2 default null
31   ,p_tsr_information1             in varchar2 default null
32   ,p_tsr_information2             in varchar2 default null
33   ,p_tsr_information3             in varchar2 default null
34   ,p_tsr_information4             in varchar2 default null
35   ,p_tsr_information5             in varchar2 default null
36   ,p_tsr_information6             in varchar2 default null
37   ,p_tsr_information7             in varchar2 default null
38   ,p_tsr_information8             in varchar2 default null
39   ,p_tsr_information9             in varchar2 default null
40   ,p_tsr_information10            in varchar2 default null
41   ,p_tsr_information11            in varchar2 default null
42   ,p_tsr_information12            in varchar2 default null
43   ,p_tsr_information13            in varchar2 default null
44   ,p_tsr_information14            in varchar2 default null
45   ,p_tsr_information15            in varchar2 default null
46   ,p_tsr_information16            in varchar2 default null
47   ,p_tsr_information17            in varchar2 default null
48   ,p_tsr_information18            in varchar2 default null
49   ,p_tsr_information19            in varchar2 default null
50   ,p_tsr_information20            in varchar2 default null
51   ,p_training_center_id           in number
52   ,p_location_id	          in number
53   ,p_trainer_id                   in number
54   ,p_special_instruction          in varchar2 default null
55   ,p_validate                     in boolean
56   ,p_effective_date               in date
57   ,p_data_source                  in varchar2 default null
58   ) is
59   --
60   -- Declare cursors and local variables
61   --
62   l_proc                    varchar2(72) := g_package||' Create Resource Definition';
63   l_supplied_resource_id number;
64   l_object_version_number   number;
65   l_effective_date          date;
66   l_name ota_suppliable_resources_tl.name%type;
67 begin
68   hr_utility.set_location('Entering:'|| l_proc, 10);
69   --
70   -- Issue a savepoint
71   --
72   savepoint CREATE_RESOURCE_DEFINITION;
73   --
74   -- Truncate the time portion from all IN date parameters
75   --
76   l_effective_date := trunc(p_effective_date);
77 
78   l_name := rtrim(p_name);
79   --
80   -- Call Before Process User Hook
81   --
82 
83   begin
84     OTA_RESOURCE_DEFINITION_BK1.CREATE_RESOURCE_DEFINITION_B
85   (   p_vendor_id                   => p_vendor_id
86 ,p_business_group_id           => p_business_group_id
87 ,p_consumable_flag             => p_consumable_flag
88 ,p_resource_type               => p_resource_type
89 ,p_start_date                  => p_start_date
90 ,p_comments                    => p_comments
91 ,p_cost                        => p_cost
92 ,p_cost_unit                   => p_cost_unit
93 ,p_currency_code               => p_currency_code
94 ,p_end_date                    => p_end_date
95 ,p_internal_address_line       => p_internal_address_line
96 ,p_lead_time                   => p_lead_time
97 ,p_name                        => p_name
98 ,p_supplier_reference          => p_supplier_reference
99 ,p_tsr_information_category    => p_tsr_information_category
100 ,p_tsr_information1            => p_tsr_information1
101 ,p_tsr_information2            => p_tsr_information2
102 ,p_tsr_information3            => p_tsr_information3
103 ,p_tsr_information4            => p_tsr_information4
104 ,p_tsr_information5            => p_tsr_information5
105 ,p_tsr_information6            => p_tsr_information6
106 ,p_tsr_information7            => p_tsr_information7
107 ,p_tsr_information8            => p_tsr_information8
108 ,p_tsr_information9            => p_tsr_information9
109 ,p_tsr_information10           => p_tsr_information10
110 ,p_tsr_information11           => p_tsr_information11
111 ,p_tsr_information12           => p_tsr_information12
112 ,p_tsr_information13           => p_tsr_information13
113 ,p_tsr_information14           => p_tsr_information14
114 ,p_tsr_information15           => p_tsr_information15
115 ,p_tsr_information16           => p_tsr_information16
116 ,p_tsr_information17           => p_tsr_information17
117 ,p_tsr_information18           => p_tsr_information18
118 ,p_tsr_information19           => p_tsr_information19
119 ,p_tsr_information20           => p_tsr_information20
120 ,p_training_center_id          => p_training_center_id
121 ,p_location_id	               => p_location_id
122 ,p_trainer_id                  => p_trainer_id
123 ,p_special_instruction         => p_special_instruction
124 ,p_effective_date              => p_effective_date
125 ,p_data_source                 => p_data_source
126    );
127   exception
128     when hr_api.cannot_find_prog_unit then
129       hr_api.cannot_find_prog_unit_error
130         (p_module_name => 'CREATE_RESOURCE_DEFINITION'
131         ,p_hook_type   => 'BP'
132         );
133   end;
134 
135   ota_tsr_ins.ins
136   (   p_supplied_resource_id        => l_supplied_resource_id
137 ,p_vendor_id                   => p_vendor_id
138 ,p_business_group_id           => p_business_group_id
139 ,p_resource_definition_id      => p_resource_definition_id
140 ,p_consumable_flag             => p_consumable_flag
141 ,p_object_version_number       => p_object_version_number
142 ,p_resource_type               => p_resource_type
143 ,p_start_date                  => p_start_date
144 ,p_comments                    => p_comments
145 ,p_cost                        => p_cost
146 ,p_cost_unit                   => p_cost_unit
147 ,p_currency_code               => p_currency_code
148 ,p_end_date                    => p_end_date
149 ,p_internal_address_line       => p_internal_address_line
150 ,p_lead_time                   => p_lead_time
151 ,p_name                        => p_name
152 ,p_supplier_reference          => p_supplier_reference
153 ,p_tsr_information_category    => p_tsr_information_category
154 ,p_tsr_information1            => p_tsr_information1
155 ,p_tsr_information2            => p_tsr_information2
156 ,p_tsr_information3            => p_tsr_information3
157 ,p_tsr_information4            => p_tsr_information4
158 ,p_tsr_information5            => p_tsr_information5
159 ,p_tsr_information6            => p_tsr_information6
160 ,p_tsr_information7            => p_tsr_information7
161 ,p_tsr_information8            => p_tsr_information8
162 ,p_tsr_information9            => p_tsr_information9
163 ,p_tsr_information10           => p_tsr_information10
164 ,p_tsr_information11           => p_tsr_information11
165 ,p_tsr_information12           => p_tsr_information12
166 ,p_tsr_information13           => p_tsr_information13
167 ,p_tsr_information14           => p_tsr_information14
168 ,p_tsr_information15           => p_tsr_information15
169 ,p_tsr_information16           => p_tsr_information16
170 ,p_tsr_information17           => p_tsr_information17
171 ,p_tsr_information18           => p_tsr_information18
172 ,p_tsr_information19           => p_tsr_information19
173 ,p_tsr_information20           => p_tsr_information20
174 ,p_training_center_id          => p_training_center_id
175 ,p_location_id	               => p_location_id
176 ,p_trainer_id                  => p_trainer_id
177 ,p_special_instruction         => p_special_instruction
178 ,p_validate		       => p_validate
179   );
180 
181    ota_srt_ins.ins_tl
182     (p_effective_date               => l_effective_date
183   ,p_language_code                  => USERENV('LANG')
184   ,p_supplied_resource_id                    => l_supplied_resource_id
185   ,p_name                           => l_name );
186   --
187   -- Call After Process User Hook
188   --
189 
190   begin
191   OTA_RESOURCE_DEFINITION_BK1.CREATE_RESOURCE_DEFINITION_A
192   (     p_supplied_resource_id        => l_supplied_resource_id
193 ,p_vendor_id                   => p_vendor_id
194 ,p_business_group_id           => p_business_group_id
195 ,p_resource_definition_id      => p_resource_definition_id
196 ,p_consumable_flag             => p_consumable_flag
197 ,p_object_version_number       => p_object_version_number
198 ,p_resource_type               => p_resource_type
199 ,p_start_date                  => p_start_date
200 ,p_comments                    => p_comments
201 ,p_cost                        => p_cost
202 ,p_cost_unit                   => p_cost_unit
203 ,p_currency_code               => p_currency_code
204 ,p_end_date                    => p_end_date
205 ,p_internal_address_line       => p_internal_address_line
206 ,p_lead_time                   => p_lead_time
207 ,p_name                        => p_name
208 ,p_supplier_reference          => p_supplier_reference
209 ,p_tsr_information_category    => p_tsr_information_category
210 ,p_tsr_information1            => p_tsr_information1
211 ,p_tsr_information2            => p_tsr_information2
212 ,p_tsr_information3            => p_tsr_information3
213 ,p_tsr_information4            => p_tsr_information4
214 ,p_tsr_information5            => p_tsr_information5
215 ,p_tsr_information6            => p_tsr_information6
216 ,p_tsr_information7            => p_tsr_information7
217 ,p_tsr_information8            => p_tsr_information8
218 ,p_tsr_information9            => p_tsr_information9
219 ,p_tsr_information10           => p_tsr_information10
220 ,p_tsr_information11           => p_tsr_information11
221 ,p_tsr_information12           => p_tsr_information12
222 ,p_tsr_information13           => p_tsr_information13
223 ,p_tsr_information14           => p_tsr_information14
224 ,p_tsr_information15           => p_tsr_information15
225 ,p_tsr_information16           => p_tsr_information16
226 ,p_tsr_information17           => p_tsr_information17
227 ,p_tsr_information18           => p_tsr_information18
228 ,p_tsr_information19           => p_tsr_information19
229 ,p_tsr_information20           => p_tsr_information20
230 ,p_training_center_id          => p_training_center_id
231 ,p_location_id	               => p_location_id
232 ,p_trainer_id                  => p_trainer_id
233 ,p_special_instruction         => p_special_instruction
234 ,p_validate                    => p_validate
235 ,p_effective_date              => l_effective_date
236 ,p_data_source                 => p_data_source
237 
238 
239   );
240   exception
241     when hr_api.cannot_find_prog_unit then
242       hr_api.cannot_find_prog_unit_error
243         (p_module_name => 'CREATE_RESOURCE_DEFINITION'
244         ,p_hook_type   => 'AP'
245         );
246   end;
247 
248   --
249   -- When in validation only mode raise the Validate_Enabled exception
250   --
251   if p_validate then
252     raise hr_api.validate_enabled;
253   end if;
254   --
255   -- Set all output arguments
256   --
257   p_supplied_resource_id        := l_supplied_resource_id;
258   p_object_version_number   := l_object_version_number;
259 
260 
261   hr_utility.set_location(' Leaving:'||l_proc, 70);
262 exception
263   when hr_api.validate_enabled then
264     --
265     -- As the Validate_Enabled exception has been raised
266     -- we must rollback to the savepoint
267     --
268     rollback to CREATE_RESOURCE_DEFINITION;
269     --
270     -- Only set output warning arguments
271     -- (Any key or derived arguments must be set to null
272     -- when validation only mode is being used.)
273     --
274     p_supplied_resource_id := null;
275     p_object_version_number   := null;
276     hr_utility.set_location(' Leaving:'||l_proc, 80);
277   when others then
278     --
279     -- A validation or unexpected error has occured
280     --
281     rollback to CREATE_RESOURCE_DEFINITION;
282     p_supplied_resource_id        := null;
283     p_object_version_number   := null;
284     hr_utility.set_location(' Leaving:'||l_proc, 90);
285     raise;
286 end create_RESOURCE_DEFINITION;
287 -- ----------------------------------------------------------------------------
288 -- |----------------------------< UPDATE_RESOURCE_DEFINITION >---------------------------|
289 -- ----------------------------------------------------------------------------
290 --
291 procedure UPDATE_RESOURCE_DEFINITION
292   (p_supplied_resource_id          in number
293   ,p_vendor_id                    in number
294   ,p_business_group_id            in number
295   ,p_resource_definition_id       in number
296   ,p_consumable_flag              in varchar2
297   ,p_object_version_number        in out nocopy number
298   ,p_resource_type                in varchar2
299   ,p_start_date                   in date default hr_api.g_date
300   ,p_comments                     in varchar2
301   ,p_cost                         in number
302   ,p_cost_unit                    in varchar2
303   ,p_currency_code                in varchar2
304   ,p_end_date                     in date default hr_api.g_date
305   ,p_internal_address_line        in varchar2
306   ,p_lead_time                    in number
307   ,p_name                         in varchar2
308   ,p_supplier_reference           in varchar2
309   ,p_tsr_information_category     in varchar2
310   ,p_tsr_information1             in varchar2
311   ,p_tsr_information2             in varchar2
312   ,p_tsr_information3             in varchar2
313   ,p_tsr_information4             in varchar2
314   ,p_tsr_information5             in varchar2
315   ,p_tsr_information6             in varchar2
316   ,p_tsr_information7             in varchar2
317   ,p_tsr_information8             in varchar2
318   ,p_tsr_information9             in varchar2
319   ,p_tsr_information10            in varchar2
320   ,p_tsr_information11            in varchar2
321   ,p_tsr_information12            in varchar2
322   ,p_tsr_information13            in varchar2
323   ,p_tsr_information14            in varchar2
324   ,p_tsr_information15            in varchar2
325   ,p_tsr_information16            in varchar2
326   ,p_tsr_information17            in varchar2
327   ,p_tsr_information18            in varchar2
328   ,p_tsr_information19            in varchar2
329   ,p_tsr_information20            in varchar2
330   ,p_training_center_id           in number
331   ,p_location_id	          in number
332   ,p_trainer_id                   in number
333   ,p_special_instruction          in varchar2
334   ,p_validate                     in boolean
335   ,p_effective_date               in date
336   ,p_data_source                  in varchar2
337   ) is
338   --
339   -- Declare cursors and local variables
340   --
341   l_proc                    varchar2(72) := g_package||' Update Resource Definition';
342   l_effective_date          date;
343   l_object_version_number   number := p_object_version_number;
344   l_name ota_suppliable_resources_tl.name%Type;
345 begin
349   --
346   hr_utility.set_location('Entering:'|| l_proc, 10);
347   --
348   -- Issue a savepoint
350   savepoint UPDATE_RESOURCE_DEFINITION;
351   --
352   -- Truncate the time portion from all IN date parameters
353   --
354   l_effective_date := trunc(p_effective_date);
355   l_name := rtrim(p_name);
356   --
357   -- Call Before Process User Hook
358   --
359 
360   begin
361     OTA_RESOURCE_DEFINITION_BK2.UPDATE_RESOURCE_DEFINITION_B
362   ( p_supplied_resource_id        => p_supplied_resource_id
363 ,p_vendor_id                   => p_vendor_id
364 ,p_business_group_id           => p_business_group_id
365 ,p_resource_definition_id      => p_resource_definition_id
366 ,p_consumable_flag             => p_consumable_flag
367 ,p_object_version_number       => p_object_version_number
368 ,p_resource_type               => p_resource_type
369 ,p_start_date                  => p_start_date
370 ,p_comments                    => p_comments
371 ,p_cost                        => p_cost
372 ,p_cost_unit                   => p_cost_unit
373 ,p_currency_code               => p_currency_code
374 ,p_end_date                    => p_end_date
375 ,p_internal_address_line       => p_internal_address_line
376 ,p_lead_time                   => p_lead_time
377 ,p_name                        => p_name
378 ,p_supplier_reference          => p_supplier_reference
379 ,p_tsr_information_category    => p_tsr_information_category
380 ,p_tsr_information1            => p_tsr_information1
381 ,p_tsr_information2            => p_tsr_information2
382 ,p_tsr_information3            => p_tsr_information3
383 ,p_tsr_information4            => p_tsr_information4
384 ,p_tsr_information5            => p_tsr_information5
385 ,p_tsr_information6            => p_tsr_information6
386 ,p_tsr_information7            => p_tsr_information7
387 ,p_tsr_information8            => p_tsr_information8
388 ,p_tsr_information9            => p_tsr_information9
389 ,p_tsr_information10           => p_tsr_information10
390 ,p_tsr_information11           => p_tsr_information11
391 ,p_tsr_information12           => p_tsr_information12
392 ,p_tsr_information13           => p_tsr_information13
393 ,p_tsr_information14           => p_tsr_information14
394 ,p_tsr_information15           => p_tsr_information15
395 ,p_tsr_information16           => p_tsr_information16
396 ,p_tsr_information17           => p_tsr_information17
397 ,p_tsr_information18           => p_tsr_information18
398 ,p_tsr_information19           => p_tsr_information19
399 ,p_tsr_information20           => p_tsr_information20
400 ,p_training_center_id          => p_training_center_id
401 ,p_location_id	               => p_location_id
402 ,p_trainer_id                  => p_trainer_id
403 ,p_special_instruction         => p_special_instruction
404 ,p_effective_date              => l_effective_date
405 ,p_data_source                 => p_data_source
406   );
407   exception
408     when hr_api.cannot_find_prog_unit then
409       hr_api.cannot_find_prog_unit_error
410         (p_module_name => 'UPDATE_RESOURCE_DEFINITION'
411         ,p_hook_type   => 'BP'
412         );
413   end;
414   --
415   -- Validation in addition to Row Handlers
416   --
417   --
418   -- Process Logic
419   --
420 
421   ota_tsr_upd.upd
422     (p_supplied_resource_id        => p_supplied_resource_id
423 ,p_vendor_id                   => p_vendor_id
424 ,p_business_group_id           => p_business_group_id
425 ,p_resource_definition_id      => p_resource_definition_id
426 ,p_consumable_flag             => p_consumable_flag
427 ,p_object_version_number       => p_object_version_number
428 ,p_resource_type               => p_resource_type
429 ,p_start_date                  => p_start_date
430 ,p_comments                    => p_comments
431 ,p_cost                        => p_cost
432 ,p_cost_unit                   => p_cost_unit
433 ,p_currency_code               => p_currency_code
434 ,p_end_date                    => p_end_date
435 ,p_internal_address_line       => p_internal_address_line
436 ,p_lead_time                   => p_lead_time
437 ,p_name                        => p_name
438 ,p_supplier_reference          => p_supplier_reference
439 ,p_tsr_information_category    => p_tsr_information_category
440 ,p_tsr_information1            => p_tsr_information1
441 ,p_tsr_information2            => p_tsr_information2
442 ,p_tsr_information3            => p_tsr_information3
443 ,p_tsr_information4            => p_tsr_information4
444 ,p_tsr_information5            => p_tsr_information5
445 ,p_tsr_information6            => p_tsr_information6
446 ,p_tsr_information7            => p_tsr_information7
447 ,p_tsr_information8            => p_tsr_information8
448 ,p_tsr_information9            => p_tsr_information9
449 ,p_tsr_information10           => p_tsr_information10
450 ,p_tsr_information11           => p_tsr_information11
451 ,p_tsr_information12           => p_tsr_information12
452 ,p_tsr_information13           => p_tsr_information13
453 ,p_tsr_information14           => p_tsr_information14
454 ,p_tsr_information15           => p_tsr_information15
455 ,p_tsr_information16           => p_tsr_information16
456 ,p_tsr_information17           => p_tsr_information17
457 ,p_tsr_information18           => p_tsr_information18
458 ,p_tsr_information19           => p_tsr_information19
459 ,p_tsr_information20           => p_tsr_information20
460 ,p_training_center_id          => p_training_center_id
461 ,p_location_id	               => p_location_id
462 ,p_trainer_id                  => p_trainer_id
463 ,p_special_instruction         => p_special_instruction
464 ,p_validate		       => p_validate
465     );
466 
467   ota_srt_upd.upd_tl(p_effective_date   =>  p_effective_date
468     ,p_language_code     =>  USERENV('LANG')
469     ,p_supplied_resource_id => P_supplied_resource_id
473   --
470     ,p_name           =>    l_name           );
471   --
472   -- Call After Process User Hook
474   begin
475   OTA_RESOURCE_DEFINITION_BK2.UPDATE_RESOURCE_DEFINITION_A
476   ( p_supplied_resource_id        => p_supplied_resource_id
477 ,p_vendor_id                   => p_vendor_id
478 ,p_business_group_id           => p_business_group_id
479 ,p_resource_definition_id      => p_resource_definition_id
480 ,p_consumable_flag             => p_consumable_flag
481 ,p_object_version_number       => p_object_version_number
482 ,p_resource_type               => p_resource_type
483 ,p_start_date                  => p_start_date
484 ,p_comments                    => p_comments
485 ,p_cost                        => p_cost
486 ,p_cost_unit                   => p_cost_unit
487 ,p_currency_code               => p_currency_code
488 ,p_end_date                    => p_end_date
489 ,p_internal_address_line       => p_internal_address_line
490 ,p_lead_time                   => p_lead_time
491 ,p_name                        => p_name
492 ,p_supplier_reference          => p_supplier_reference
493 ,p_tsr_information_category    => p_tsr_information_category
494 ,p_tsr_information1            => p_tsr_information1
495 ,p_tsr_information2            => p_tsr_information2
496 ,p_tsr_information3            => p_tsr_information3
497 ,p_tsr_information4            => p_tsr_information4
498 ,p_tsr_information5            => p_tsr_information5
499 ,p_tsr_information6            => p_tsr_information6
500 ,p_tsr_information7            => p_tsr_information7
501 ,p_tsr_information8            => p_tsr_information8
502 ,p_tsr_information9            => p_tsr_information9
503 ,p_tsr_information10           => p_tsr_information10
504 ,p_tsr_information11           => p_tsr_information11
505 ,p_tsr_information12           => p_tsr_information12
506 ,p_tsr_information13           => p_tsr_information13
507 ,p_tsr_information14           => p_tsr_information14
508 ,p_tsr_information15           => p_tsr_information15
509 ,p_tsr_information16           => p_tsr_information16
510 ,p_tsr_information17           => p_tsr_information17
511 ,p_tsr_information18           => p_tsr_information18
512 ,p_tsr_information19           => p_tsr_information19
513 ,p_tsr_information20           => p_tsr_information20
514 ,p_training_center_id          => p_training_center_id
515 ,p_location_id	               => p_location_id
516 ,p_trainer_id                  => p_trainer_id
517 ,p_special_instruction         => p_special_instruction
518 ,p_effective_date              => l_effective_date
519 ,p_data_source                 => p_data_source
520   );
521   exception
522     when hr_api.cannot_find_prog_unit then
523       hr_api.cannot_find_prog_unit_error
524         (p_module_name => 'UPDATE_RESOURCE_DEFINITION'
525         ,p_hook_type   => 'AP'
526         );
527   end;
528 
529   --
530   -- When in validation only mode raise the Validate_Enabled exception
531   --
532   if p_validate then
533     raise hr_api.validate_enabled;
534   end if;
535   --
536   -- Set all output arguments
537   --
538   hr_utility.set_location(' Leaving:'||l_proc, 70);
539 exception
540   when hr_api.validate_enabled then
541     --
542     -- As the Validate_Enabled exception has been raised
543     -- we must rollback to the savepoint
544     --
545     rollback to UPDATE_RESOURCE_DEFINITION;
546     --
547     -- Only set output warning arguments
548     -- (Any key or derived arguments must be set to null
549     -- when validation only mode is being used.)
550     --
551     p_object_version_number  := null;
552     hr_utility.set_location(' Leaving:'||l_proc, 80);
553   when others then
554     --
555     -- A validation or unexpected error has occured
556     --
557     rollback to UPDATE_RESOURCE_DEFINITION;
558     p_object_version_number  := l_object_version_number;
559     hr_utility.set_location(' Leaving:'||l_proc, 90);
560     raise;
561 end update_RESOURCE_DEFINITION;
562 --
563 -- ----------------------------------------------------------------------------
564 -- |-------------------------< DELETE_RESOURCE_DEFINITION >------------------------------|
565 -- ----------------------------------------------------------------------------
566 --
567 procedure delete_RESOURCE_DEFINITION
568   (p_validate                      in     boolean  default false
569   ,p_supplied_resource_id                   in     number
570   ,p_object_version_number         in     number
571   ) is
572   --
573   -- Declare cursors and local variables
574   --
575   l_proc                    varchar2(72) := g_package||' Delete Training Plan';
576   l_object_version_id       number;
577   --
578   --
579 begin
580   hr_utility.set_location('Entering:'|| l_proc, 10);
581   --
582   -- Issue a savepoint
583   --
584   savepoint DELETE_RESOURCE_DEFINITION;
585   --
586   -- Truncate the time portion from all IN date parameters
587   --
588   --
589 
590   -- Call Before Process User Hook
591   --
592   begin
593     OTA_RESOURCE_DEFINITION_BK3.DELETE_RESOURCE_DEFINITION_B
594   (p_supplied_resource_id            => p_supplied_resource_id
595   ,p_object_version_number       => p_object_version_number
596   );
597   exception
598     when hr_api.cannot_find_prog_unit then
599       hr_api.cannot_find_prog_unit_error
600         (p_module_name => 'DELETE_RESOURCE_DEFINITION'
601         ,p_hook_type   => 'BP'
602         );
603   end;
604   --
605   -- Validation in addition to Row Handlers
606   --
607   --
608   -- Process Logic
609   --
610   ota_tsr_del.del
611   (p_supplied_resource_id        => p_supplied_resource_id
612   ,p_object_version_number   => p_object_version_number
616   (p_supplied_resource_id        => p_supplied_resource_id
613   );
614 
615   ota_srt_del.del_tl
617    --,p_language =>  USERENV('LANG')
618   );
619   --
620   -- Call After Process User Hook
621   --
622   begin
623   OTA_RESOURCE_DEFINITION_BK3.DELETE_RESOURCE_DEFINITION_A
624   (p_supplied_resource_id            => p_supplied_resource_id
625   ,p_object_version_number       => p_object_version_number
626   );
627   exception
628     when hr_api.cannot_find_prog_unit then
629       hr_api.cannot_find_prog_unit_error
630         (p_module_name => 'DELETE_RESOURCE_DEFINITION'
631         ,p_hook_type   => 'AP'
632         );
633   end;
634 
635   --
636   -- When in validation only mode raise the Validate_Enabled exception
637   --
638   if p_validate then
639     raise hr_api.validate_enabled;
640   end if;
641   --
642   -- Set all output arguments
643   --
644   --
645   hr_utility.set_location(' Leaving:'||l_proc, 170);
646 exception
647   when hr_api.validate_enabled then
648     --
649     -- As the Validate_Enabled exception has been raised
650     -- we must rollback to the savepoint
651     --
652     rollback to DELETE_RESOURCE_DEFINITION;
653     --
654     -- Only set output warning arguments
655     -- (Any key or derived arguments must be set to null
656     -- when validation only mode is being used.)
657     --
658     hr_utility.set_location(' Leaving:'||l_proc, 180);
659   when others then
660     --
661     -- A validation or unexpected error has occured
662     --
663     rollback to DELETE_RESOURCE_DEFINITION;
664     hr_utility.set_location(' Leaving:'||l_proc, 190);
665     raise;
666 end delete_RESOURCE_DEFINITION;
667 --
668 
669 
670 END OTA_RESOURCE_DEFINITION_API;