DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_SOLUTION_TYPE_CMPT_API

Source


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