DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_SOLUTION_SET_API

Source


4 -- Package Variables
1 Package Body per_solution_set_api as
2 /* $Header: peslsapi.pkb 115.2 2003/01/04 00:36:26 ndorai noship $ */
3 --
5 --
6 g_package  varchar2(33) := 'PER_SOLUTION_SET_API.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |------------------------< CREATE_SOLUTION_SET >---------------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure create_solution_set
13   (p_validate                      in     boolean  default false
14   ,p_effective_date                in     date
15   ,p_solution_set_name             in     varchar2
16   ,p_user_id                       in     number
17   ,p_description                   in     varchar2  default null
18   ,p_status                        in     varchar2  default null
19   ,p_solution_set_impl_id          in     number    default hr_api.g_number
20   ,p_object_version_number            out nocopy number
21   ) is
22   --
23   -- Declare cursors and local variables
24   --
25   l_proc                  varchar2(72) := g_package||'CREATE_SOLUTION_SET';
26   l_effective_date        date;
27   l_solution_set_name     PER_SOLUTION_SETS.SOLUTION_SET_NAME%TYPE;
28   l_user_id               PER_SOLUTION_SETS.USER_ID%TYPE;
29   l_object_version_number PER_SOLUTION_SETS.OBJECT_VERSION_NUMBER%TYPE;
30   --
31 begin
35   --
32   hr_utility.set_location('Entering:'|| l_proc, 10);
33   --
34   savepoint CREATE_SOLUTION_SET;
36   -- Register user key values
37   --
38   per_sls_ins.set_base_key_value
39     (p_solution_set_name => p_solution_set_name
40     ,p_user_id           => p_user_id
41     );
42   --
43   -- Truncate the time portion from all IN date parameters
44   --
45   l_effective_date := trunc(p_effective_date);
46   --
47   -- Call Before Process User Hook
48   --
49   begin
50     PER_SOLUTION_SET_BK1.CREATE_SOLUTION_SET_b
51     (p_effective_date            => l_effective_date
52     ,p_solution_set_name         => p_solution_set_name
53     ,p_user_id                   => p_user_id
54     ,p_description               => p_description
55     ,p_status                    => p_status
56     ,p_solution_set_impl_id      => p_solution_set_impl_id
57     );
58   exception
59     when hr_api.cannot_find_prog_unit then
60       hr_api.cannot_find_prog_unit_error
61         (p_module_name => 'CREATE_SOLUTION_SET_b'
62         ,p_hook_type   => 'BP'
63         );
64   end;
65   --
66   --
67   per_sls_ins.ins
68     (p_effective_date            => l_effective_date
69     ,p_solution_set_name         => l_solution_set_name
70     ,p_user_id                   => l_user_id
71     ,p_description               => p_description
72     ,p_status                    => p_status
73     ,p_solution_set_impl_id      => p_solution_set_impl_id
74     ,p_object_version_number     => l_object_version_number
75   );
76   --
77   -- Call After Process User Hook
78   --
79   begin
80     PER_SOLUTION_SET_BK1.CREATE_SOLUTION_SET_a
81       (p_effective_date            => l_effective_date
82       ,p_solution_set_name         => p_solution_set_name
83       ,p_user_id                   => p_user_id
84       ,p_description               => p_description
85       ,p_status                    => p_status
86       ,p_solution_set_impl_id      => p_solution_set_impl_id
87       ,p_object_version_number     => p_object_version_number
88       );
89   exception
90     when hr_api.cannot_find_prog_unit then
91       hr_api.cannot_find_prog_unit_error
92         (p_module_name => 'CREATE_SOLUTION_SET_a'
93         ,p_hook_type   => 'AP'
94         );
95   end;
96    --
97   -- When in validation only mode raise the Validate_Enabled exception
98   --
99   if p_validate then
100     raise hr_api.validate_enabled;
101   end if;
102   --
103   -- Set all output arguments
104   --
105   p_object_version_number  := l_object_version_number;
106   --
107   hr_utility.set_location(' Leaving:'||l_proc, 70);
108 exception
109   when hr_api.validate_enabled then
110     --
111     -- As the Validate_Enabled exception has been raised
112     -- we must rollback to the savepoint
113     --
114     rollback to CREATE_SOLUTION_SET;
115     --
116     -- Only set output warning arguments
117     -- (Any key or derived arguments must be set to null
118     -- when validation only mode is being used.)
119     --
120     p_object_version_number  := null;
121 --
122     hr_utility.set_location(' Leaving:'||l_proc, 80);
123   when others then
124     --
125     -- A validation or unexpected error has occured
126     --
127     rollback to CREATE_SOLUTION_SET;
128     hr_utility.set_location(' Leaving:'||l_proc, 90);
129     raise;
130 end CREATE_SOLUTION_SET;
131 --
132 
133 
134 -- ----------------------------------------------------------------------------
135 -- |-----------------------< UPDATE_SOLUTION_SET >----------------------------|
136 -- ----------------------------------------------------------------------------
137 --
138 procedure update_solution_set
139   (p_validate                      in     boolean  default false
140   ,p_effective_date                in     date
141   ,p_solution_set_name             in     varchar2
142   ,p_user_id                       in     number
143   ,p_description                   in     varchar2  default hr_api.g_varchar2
144   ,p_status                        in     varchar2  default hr_api.g_varchar2
145   ,p_solution_set_impl_id          in     number    default hr_api.g_number
146   ,p_object_version_number         in out nocopy number
147   ) is
148   --
149   -- Declare cursors and local variables
150   --
151   l_proc                  varchar2(72) := g_package||'UPDATE_SOLUTION_SET';
152   l_effective_date        date;
153   l_object_version_number PER_SOLUTION_SETS.OBJECT_VERSION_NUMBER%TYPE;
154   --
155 begin
156   hr_utility.set_location('Entering:'|| l_proc, 10);
157   --
158   savepoint UPDATE_SOLUTION_SET;
159   --
160   -- Store initial value for OVN in out parameter.
161   --
162   l_object_version_number := p_object_version_number;
163   --
164   -- Truncate the time portion from all IN date parameters
165   --
166   l_effective_date := trunc(p_effective_date);
167   --
168   -- Call Before Process User Hook
169   --
170   begin
171     PER_SOLUTION_SET_BK2.UPDATE_SOLUTION_SET_b
172       (p_effective_date            => l_effective_date
176       ,p_description               => p_description
173       ,p_object_version_number     => p_object_version_number
174       ,p_solution_set_name         => p_solution_set_name
175       ,p_user_id                   => p_user_id
177       ,p_status                    => p_status
178       ,p_solution_set_impl_id      => p_solution_set_impl_id
179     );
180   exception
181     when hr_api.cannot_find_prog_unit then
182       hr_api.cannot_find_prog_unit_error
183         (p_module_name => 'UPDATE_SOLUTION_SET_b'
184         ,p_hook_type   => 'BP'
185         );
186   end;
187   --
188   --
189   per_sls_upd.upd(
190        p_effective_date            => l_effective_date
191       ,p_object_version_number     => l_object_version_number
192       ,p_solution_set_name         => p_solution_set_name
193       ,p_user_id                   => p_user_id
194       ,p_description               => p_description
195       ,p_status                    => p_status
196       ,p_solution_set_impl_id      => p_solution_set_impl_id
197   );
198   --
199   -- Call After Process User Hook
200   --
201   begin
202     PER_SOLUTION_SET_BK2.UPDATE_SOLUTION_SET_a
203       (p_effective_date            => l_effective_date
204       ,p_object_version_number     => p_object_version_number
205       ,p_solution_set_name         => p_solution_set_name
206       ,p_user_id                   => p_user_id
207       ,p_description               => p_description
208       ,p_status                    => p_status
209       ,p_solution_set_impl_id      => p_solution_set_impl_id
210       );
211   exception
212     when hr_api.cannot_find_prog_unit then
213       hr_api.cannot_find_prog_unit_error
214         (p_module_name => 'UPDATE_SOLUTION_SET_a'
215         ,p_hook_type   => 'AP'
216         );
217   end;
218   --
219   -- When in validation only mode raise the Validate_Enabled exception
220   --
221   if p_validate then
222     raise hr_api.validate_enabled;
223   end if;
224   --
225   --
226   -- Set all output arguments
227   --
228   p_object_version_number  := l_object_version_number;
229   --
230   hr_utility.set_location(' Leaving:'||l_proc, 70);
231 exception
232   when hr_api.validate_enabled then
233     --
234     -- As the Validate_Enabled exception has been raised
235     -- we must rollback to the savepoint
236     --
237     rollback to UPDATE_SOLUTION_SET;
238     --
239     -- Only set output warning arguments
240     -- (Any key or derived arguments must be set to null
241     -- when validation only mode is being used.)
242     --
243     hr_utility.set_location(' Leaving:'||l_proc, 80);
244   when others then
245     --
246     -- A validation or unexpected error has occured
247     --
251 end UPDATE_SOLUTION_SET;
248     rollback to UPDATE_SOLUTION_SET;
249     hr_utility.set_location(' Leaving:'||l_proc, 90);
250     raise;
252 
253 
254 -- ----------------------------------------------------------------------------
255 -- |------------------------< DELETE_SOLUTION_SET >---------------------------|
256 -- ----------------------------------------------------------------------------
257 --
258 procedure delete_solution_set
259   (p_validate                      in     boolean  default false
260   ,p_solution_set_name             in     varchar2
261   ,p_user_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_SOLUTION_SET';
268   --
269 begin
270   hr_utility.set_location('Entering:'|| l_proc, 10);
271   --
272   savepoint DELETE_SOLUTION_SET;
273   --
274   -- Call Before Process User Hook
275   --
276   begin
277     PER_SOLUTION_SET_BK3.DELETE_SOLUTION_SET_b
278     (p_solution_set_name        => p_solution_set_name
279     ,p_user_id                  => p_user_id
280     ,p_object_version_number    => p_object_version_number
281     );
282   exception
283     when hr_api.cannot_find_prog_unit then
284       hr_api.cannot_find_prog_unit_error
285         (p_module_name => 'DELETE_SOLUTION_SET_b'
286         ,p_hook_type   => 'BP'
287         );
288   end;
289   --
290   per_sls_del.del
291    (p_solution_set_name        => p_solution_set_name
292    ,p_user_id                  => p_user_id
293    ,p_object_version_number    => p_object_version_number
294   );
295   --
296   begin
297     PER_SOLUTION_SET_BK3.DELETE_SOLUTION_SET_a
298       (p_solution_set_name        => p_solution_set_name
299       ,p_user_id                  => p_user_id
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_SET_a'
306           ,p_hook_type   => 'AP'
307           );
308   end;
309   --
310   -- When in validation only mode raise the Validate_Enabled exception
311   --
312   if p_validate then
313     raise hr_api.validate_enabled;
314   end if;
315   --
316   hr_utility.set_location(' Leaving:'||l_proc, 70);
317 exception
318   when hr_api.validate_enabled then
319     --
320     -- As the Validate_Enabled exception has been raised
321     -- we must rollback to the savepoint
322     --
323     rollback to DELETE_SOLUTION_SET;
324     --
325     hr_utility.set_location(' Leaving:'||l_proc, 80);
326   when others then
327     --
328    rollback to DELETE_SOLUTION_SET;
329    --
330    hr_utility.set_location(' Leaving:'||l_proc, 90);
331    --
332    raise;
333    --
334 end DELETE_SOLUTION_SET;
335 
336 --
337 end per_solution_set_api;