DBA Data[Home] [Help]

PACKAGE BODY: APPS.HR_CALENDAR_NODE_TYPE_SWI

Source


1 Package Body HR_CALENDAR_NODE_TYPE_SWI As
2 /* $Header: hrpgtswi.pkb 115.0 2003/04/25 13:06:43 cxsimpso noship $ */
3 --
4 -- Package variables
5 --
6 g_package  varchar2(33) := 'HR_CALENDAR_NODE_TYPE_SWI.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |---------------------------< create_node_type >---------------------------|
10 -- ----------------------------------------------------------------------------
11 PROCEDURE create_node_type
12   (p_validate                     in     number    default hr_api.g_false_num
13   ,p_effective_date               in     date
14   ,p_hierarchy_type               in     varchar2
15   ,p_child_node_name              in     varchar2
16   ,p_child_value_set              in     varchar2
17   ,p_child_node_type              in     varchar2  default null
18   ,p_parent_node_type             in     varchar2  default null
19   ,p_hier_node_type_id            in     number
20   ,p_description                  in     varchar2  default null
21   ,p_object_version_number           out nocopy  number
22   ,p_return_status                   out  nocopy varchar2
23   ) is
24   --
25   -- Variables for API Boolean parameters
26   l_validate                      boolean;
27   l_ovn                           number;
28   --
29   -- Variables for IN/OUT parameters
30   --
31   -- Other variables
32   l_hier_node_type_id            number;
33   l_proc    varchar2(80) := g_package ||'create_node_type';
34 Begin
35   hr_utility.set_location(' Entering:' || l_proc,10);
36 
37   --
38   -- Issue a savepoint
39   --
40   savepoint create_node_type_swi;
41   --
42   -- Initialise Multiple Message Detection
43   --
44   hr_multi_message.enable_message_list;
45   --
46   -- Remember IN OUT parameter IN values
47   --
48   --
49   -- Convert constant values to their corresponding boolean value
50   --
51   l_validate :=
52     hr_api.constant_to_boolean
53       (p_constant_value => p_validate);
54   --
55   -- Register Surrogate ID or user key values
56   --
57   per_pgt_ins.set_base_key_value
58     (p_hier_node_type_id => p_hier_node_type_id
59     );
60   --
61   -- Call API
62   --
63 
64   HR_CALENDAR_NODE_TYPE_API.create_node_type
65     (p_validate                     => l_validate
66     ,p_effective_date               => p_effective_date
67     ,p_hierarchy_type               => p_hierarchy_type
68     ,p_child_node_name              => p_child_node_name
69     ,p_child_node_type              => p_child_node_type
70     ,p_child_value_set              => p_child_value_set
71     ,p_parent_node_type             => p_parent_node_type
72     ,p_description                  => p_description
73     ,p_hier_node_type_id            => l_hier_node_type_id
74     ,p_object_version_number        => p_object_version_number
75     );
76 
77 
78   --
79   -- Convert API warning boolean parameter values to specific
80   -- messages and add them to Multiple Message List
81   --
82   --
83   -- Convert API non-warning boolean parameter values
84   --
85   --
86   -- Derive the API return status value based on whether
87   -- messages of any type exist in the Multiple Message List.
88   -- Also disable Multiple Message Detection.
89   --
90   p_return_status := hr_multi_message.get_return_status_disable;
91   hr_utility.set_location(' Leaving:' || l_proc,20);
92   --
93 exception
94   when hr_multi_message.error_message_exist then
95     --
96     -- Catch the Multiple Message List exception which
97     -- indicates API processing has been aborted because
98     -- at least one message exists in the list.
99     --
100     rollback to create_node_type_swi;
101     --
102     -- Reset IN OUT parameters and set OUT parameters
103     --
104     p_object_version_number        := null;
105     p_return_status := hr_multi_message.get_return_status_disable;
106     hr_utility.set_location(' Leaving:' || l_proc, 30);
107   when others then
108     --
109     -- When Multiple Message Detection is enabled catch
110     -- any Application specific or other unexpected
111     -- exceptions.  Adding appropriate details to the
112     -- Multiple Message List.  Otherwise re-raise the
113     -- error.
114     --
115     rollback to create_node_type_swi;
116     if hr_multi_message.unexpected_error_add(l_proc) then
117        hr_utility.set_location(' Leaving:' || l_proc,40);
118        raise;
119     end if;
120     --
121     -- Reset IN OUT and set OUT parameters
122     --
123     p_object_version_number        := null;
124     p_return_status := hr_multi_message.get_return_status_disable;
125     hr_utility.set_location(' Leaving:' || l_proc,50);
126 end create_node_type;
127 -- ----------------------------------------------------------------------------
128 -- |---------------------------< delete_node_type >---------------------------|
129 -- ----------------------------------------------------------------------------
130 PROCEDURE delete_node_type
131   (p_validate                     in     number    default hr_api.g_false_num
132   ,p_hier_node_type_id            in     number
133   ,p_object_version_number        in     number
134   ,p_return_status                   out nocopy  varchar2
135   ) is
136   --
137   -- Variables for API Boolean parameters
138   l_validate                      boolean;
139   --
140   -- Variables for IN/OUT parameters
141   --
142   -- Other variables
143   l_proc    varchar2(72) := g_package ||'delete_node_type';
144 Begin
145   hr_utility.set_location(' Entering:' || l_proc,10);
146   --
147   -- Issue a savepoint
148   --
149   savepoint delete_node_type_swi;
150   --
151   -- Initialise Multiple Message Detection
152   --
153   hr_multi_message.enable_message_list;
154   --
155   -- Remember IN OUT parameter IN values
156   --
157   --
158   -- Convert constant values to their corresponding boolean value
159   --
160   l_validate :=
161     hr_api.constant_to_boolean
162       (p_constant_value => p_validate);
163   --
164   -- Register Surrogate ID or user key values
165   --
166   --
167   -- Call API
168   --
169   HR_CALENDAR_NODE_TYPE_API.delete_node_type
170     (p_validate                     => l_validate
171     ,p_hier_node_type_id            => p_hier_node_type_id
172     ,p_object_version_number        => p_object_version_number
173     );
174   --
175   -- Convert API warning boolean parameter values to specific
176   -- messages and add them to Multiple Message List
177   --
178   --
179   -- Convert API non-warning boolean parameter values
180   --
181   --
182   -- Derive the API return status value based on whether
183   -- messages of any type exist in the Multiple Message List.
184   -- Also disable Multiple Message Detection.
185   --
186   p_return_status := hr_multi_message.get_return_status_disable;
187   hr_utility.set_location(' Leaving:' || l_proc,20);
188   --
189 exception
190   when hr_multi_message.error_message_exist then
191     --
192     -- Catch the Multiple Message List exception which
193     -- indicates API processing has been aborted because
194     -- at least one message exists in the list.
195     --
196     rollback to delete_node_type_swi;
197     --
198     -- Reset IN OUT parameters and set OUT parameters
199     --
200     p_return_status := hr_multi_message.get_return_status_disable;
201     hr_utility.set_location(' Leaving:' || l_proc, 30);
202   when others then
203     --
204     -- When Multiple Message Detection is enabled catch
205     -- any Application specific or other unexpected
206     -- exceptions.  Adding appropriate details to the
207     -- Multiple Message List.  Otherwise re-raise the
208     -- error.
209     --
210     rollback to delete_node_type_swi;
211     if hr_multi_message.unexpected_error_add(l_proc) then
212        hr_utility.set_location(' Leaving:' || l_proc,40);
213        raise;
214     end if;
215     --
216     -- Reset IN OUT and set OUT parameters
217     --
218     p_return_status := hr_multi_message.get_return_status_disable;
219     hr_utility.set_location(' Leaving:' || l_proc,50);
220 end delete_node_type;
221 -- ----------------------------------------------------------------------------
222 -- |---------------------------< update_node_type >---------------------------|
223 -- ----------------------------------------------------------------------------
224 PROCEDURE update_node_type
225   (p_validate                     in     number    default hr_api.g_false_num
226   ,p_effective_date               in     date
227   ,p_hier_node_type_id            in     number
228   ,p_object_version_number        in out nocopy  number
229   ,p_child_node_name              in     varchar2  default hr_api.g_varchar2
230   ,p_child_value_set              in     varchar2  default hr_api.g_varchar2
231   ,p_parent_node_type             in     varchar2  default hr_api.g_varchar2
232   ,p_description                  in     varchar2  default hr_api.g_varchar2
233   ,p_return_status                   out nocopy  varchar2
234   ) is
235   --
236   -- Variables for API Boolean parameters
237   l_validate                      boolean;
238   --
239   -- Variables for IN/OUT parameters
240   l_object_version_number         number;
241   --
242   -- Other variables
243   l_proc    varchar2(72) := g_package ||'update_node_type';
244 Begin
245   hr_utility.set_location(' Entering:' || l_proc,10);
246   --
247   -- Issue a savepoint
248   --
249   savepoint update_node_type_swi;
250   --
251   -- Initialise Multiple Message Detection
252   --
253   hr_multi_message.enable_message_list;
254   --
255   -- Remember IN OUT parameter IN values
256   --
257   l_object_version_number         := p_object_version_number;
258   --
259   -- Convert constant values to their corresponding boolean value
260   --
261   l_validate :=
262     hr_api.constant_to_boolean
263       (p_constant_value => p_validate);
264   --
265   -- Register Surrogate ID or user key values
266   --
267   --
268   -- Call API
269   --
270   HR_CALENDAR_NODE_TYPE_API.update_node_type
271     (p_validate                     => l_validate
272     ,p_effective_date               => p_effective_date
273     ,p_hier_node_type_id            => p_hier_node_type_id
274     ,p_object_version_number        => p_object_version_number
275     ,p_child_node_name              => p_child_node_name
276     ,p_child_value_set              => p_child_value_set
277     ,p_parent_node_type             => p_parent_node_type
278     ,p_description                  => p_description
279     );
280   --
281   -- Convert API warning boolean parameter values to specific
282   -- messages and add them to Multiple Message List
283   --
284   --
285   -- Convert API non-warning boolean parameter values
286   --
287   --
288   -- Derive the API return status value based on whether
289   -- messages of any type exist in the Multiple Message List.
290   -- Also disable Multiple Message Detection.
291   --
292   p_return_status := hr_multi_message.get_return_status_disable;
293   hr_utility.set_location(' Leaving:' || l_proc,20);
294   --
295 exception
296   when hr_multi_message.error_message_exist then
297     --
298     -- Catch the Multiple Message List exception which
299     -- indicates API processing has been aborted because
300     -- at least one message exists in the list.
301     --
302     rollback to update_node_type_swi;
303     --
304     -- Reset IN OUT parameters and set OUT parameters
305     --
306     p_object_version_number        := l_object_version_number;
307     p_return_status := hr_multi_message.get_return_status_disable;
308     hr_utility.set_location(' Leaving:' || l_proc, 30);
309   when others then
310     --
311     -- When Multiple Message Detection is enabled catch
312     -- any Application specific or other unexpected
313     -- exceptions.  Adding appropriate details to the
314     -- Multiple Message List.  Otherwise re-raise the
315     -- error.
316     --
317     rollback to update_node_type_swi;
318     if hr_multi_message.unexpected_error_add(l_proc) then
319        hr_utility.set_location(' Leaving:' || l_proc,40);
320        raise;
321     end if;
322     --
323     -- Reset IN OUT and set OUT parameters
324     --
325     p_object_version_number        := l_object_version_number;
326     p_return_status := hr_multi_message.get_return_status_disable;
327     hr_utility.set_location(' Leaving:' || l_proc,50);
328 end update_node_type;
329 end HR_CALENDAR_NODE_TYPE_SWI;