DBA Data[Home] [Help]

PACKAGE BODY: APPS.HR_PER_DEPLYMT_EIT_SWI

Source


1 Package Body hr_per_deplymt_eit_swi As
2 /* $Header: hrpdeswi.pkb 120.1 2012/01/20 13:48:54 vepravee ship $ */
3 --
4 -- Package variables
5 --
6 g_package  varchar2(33) := 'hr_per_deplymt_eit_swi.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |------------------------< create_per_deplymt_eit >------------------------|
10 -- ----------------------------------------------------------------------------
11 PROCEDURE create_per_deplymt_eit
12   (p_validate                     in     number    default hr_api.g_false_num
13   ,p_person_deployment_id         in     number
14   ,p_person_extra_info_id         in     number
15   ,p_per_deplymt_eit_id           in     number
16   ,p_object_version_number           out nocopy number
17   ,p_return_status                   out nocopy varchar2
18   ) is
19   --
20   -- Variables for API Boolean parameters
21   l_validate                      boolean;
22   --
23   -- Variables for IN/OUT parameters
24   --
25   -- Other variables
26     l_per_deplymt_eit_id         number;
27   l_proc    varchar2(72) := g_package ||'create_per_deplymt_eit';
28 Begin
29   hr_utility.set_location(' Entering:' || l_proc,10);
30   --
31   -- Issue a savepoint
32   --
33   savepoint create_per_deplymt_eit_swi;
34   --
35   -- Initialise Multiple Message Detection
36   --
37   hr_multi_message.enable_message_list;
38   --
39   -- Remember IN OUT parameter IN values
40   --
41   --
42   -- Convert constant values to their corresponding boolean value
43   --
44   l_validate :=
45     hr_api.constant_to_boolean
46       (p_constant_value => p_validate);
47   --
48   -- Register Surrogate ID or user key values
49   --
50   hr_pde_ins.set_base_key_value
51     (p_person_deplymt_eit_id => p_per_deplymt_eit_id
52     );
53   --
54   -- Call API
55   --
56   hr_per_deplymt_eit_api.create_per_deplymt_eit
57     (p_validate                     => l_validate
58     ,p_person_deployment_id         => p_person_deployment_id
59     ,p_person_extra_info_id         => p_person_extra_info_id
60     ,p_per_deplymt_eit_id           => l_per_deplymt_eit_id
61     ,p_object_version_number        => p_object_version_number
62     );
63   --
64   -- Convert API warning boolean parameter values to specific
65   -- messages and add them to Multiple Message List
66   --
67   --
68   -- Convert API non-warning boolean parameter values
69   --
70   --
71   -- Derive the API return status value based on whether
72   -- messages of any type exist in the Multiple Message List.
73   -- Also disable Multiple Message Detection.
74   --
75   p_return_status := hr_multi_message.get_return_status_disable;
76   hr_utility.set_location(' Leaving:' || l_proc,20);
77   --
78 exception
79   when hr_multi_message.error_message_exist then
80     --
81     -- Catch the Multiple Message List exception which
82     -- indicates API processing has been aborted because
83     -- at least one message exists in the list.
84     --
85     rollback to create_per_deplymt_eit_swi;
86     --
87     -- Reset IN OUT parameters and set OUT parameters
88     --
89     p_object_version_number        := null;
90     p_return_status := hr_multi_message.get_return_status_disable;
91     hr_utility.set_location(' Leaving:' || l_proc, 30);
92   when others then
93     --
94     -- When Multiple Message Detection is enabled catch
95     -- any Application specific or other unexpected
96     -- exceptions.  Adding appropriate details to the
97     -- Multiple Message List.  Otherwise re-raise the
98     -- error.
99     --
100     rollback to create_per_deplymt_eit_swi;
101     if hr_multi_message.unexpected_error_add(l_proc) then
102        hr_utility.set_location(' Leaving:' || l_proc,40);
103        raise;
104     end if;
105     --
106     -- Reset IN OUT and set OUT parameters
107     --
108     p_object_version_number        := null;
109     p_return_status := hr_multi_message.get_return_status_disable;
110     hr_utility.set_location(' Leaving:' || l_proc,50);
111 end create_per_deplymt_eit;
112 -- ----------------------------------------------------------------------------
113 -- |------------------------< delete_per_deplymt_eit >------------------------|
114 -- ----------------------------------------------------------------------------
115 PROCEDURE delete_per_deplymt_eit
116   (p_validate                     in     number    default hr_api.g_false_num
117   ,p_per_deplymt_eit_id           in     number
118   ,p_object_version_number        in     number
119   ,p_return_status                   out nocopy varchar2
120   ) is
121   --
122   -- Variables for API Boolean parameters
123   l_validate                      boolean;
124   --
125   -- Variables for IN/OUT parameters
126   --
127   -- Other variables
128   l_proc    varchar2(72) := g_package ||'delete_per_deplymt_eit';
129 Begin
130   hr_utility.set_location(' Entering:' || l_proc,10);
131   --
132   -- Issue a savepoint
133   --
134   savepoint delete_per_deplymt_eit_swi;
135   --
136   -- Initialise Multiple Message Detection
137   --
138   hr_multi_message.enable_message_list;
139   --
140   -- Remember IN OUT parameter IN values
141   --
142   --
143   -- Convert constant values to their corresponding boolean value
144   --
145   l_validate :=
146     hr_api.constant_to_boolean
147       (p_constant_value => p_validate);
148   --
149   -- Register Surrogate ID or user key values
150   --
151   --
152   -- Call API
153   --
154   hr_per_deplymt_eit_api.delete_per_deplymt_eit
155     (p_validate                     => l_validate
156     ,p_per_deplymt_eit_id           => p_per_deplymt_eit_id
157     ,p_object_version_number        => p_object_version_number
158     );
159   --
160   -- Convert API warning boolean parameter values to specific
161   -- messages and add them to Multiple Message List
162   --
163   --
164   -- Convert API non-warning boolean parameter values
165   --
166   --
167   -- Derive the API return status value based on whether
168   -- messages of any type exist in the Multiple Message List.
169   -- Also disable Multiple Message Detection.
170   --
171   p_return_status := hr_multi_message.get_return_status_disable;
172   hr_utility.set_location(' Leaving:' || l_proc,20);
173   --
174 exception
175   when hr_multi_message.error_message_exist then
176     --
177     -- Catch the Multiple Message List exception which
178     -- indicates API processing has been aborted because
179     -- at least one message exists in the list.
180     --
181     rollback to delete_per_deplymt_eit_swi;
182     --
183     -- Reset IN OUT parameters and set OUT parameters
184     --
185     p_return_status := hr_multi_message.get_return_status_disable;
186     hr_utility.set_location(' Leaving:' || l_proc, 30);
187   when others then
188     --
189     -- When Multiple Message Detection is enabled catch
190     -- any Application specific or other unexpected
191     -- exceptions.  Adding appropriate details to the
192     -- Multiple Message List.  Otherwise re-raise the
193     -- error.
194     --
195     rollback to delete_per_deplymt_eit_swi;
196     if hr_multi_message.unexpected_error_add(l_proc) then
197        hr_utility.set_location(' Leaving:' || l_proc,40);
198        raise;
199     end if;
200     --
201     -- Reset IN OUT and set OUT parameters
202     --
203     p_return_status := hr_multi_message.get_return_status_disable;
204     hr_utility.set_location(' Leaving:' || l_proc,50);
205 end delete_per_deplymt_eit;
206 
207 -- ----------------------------------------------------------------------------
208 -- |------------------------< process_api >-----------------------------------|
209 -- ----------------------------------------------------------------------------
210 Procedure process_api
211 ( p_document            in         CLOB
212  ,p_return_status       out nocopy VARCHAR2
213  ,p_validate            in         number    default hr_api.g_false_num
214  ,p_effective_date      in         date      default null
215 )
216 IS
217    l_postState VARCHAR2(2);
218    l_return_status VARCHAR2(1);
219    l_commitElement xmldom.DOMElement;
220    l_object_version_number number;
221    l_parser xmlparser.Parser;
222    l_CommitNode xmldom.DOMNode;
223    l_proc    varchar2(72) := g_package || 'process_api';
224 
225     l_occurrence number;
226     lv_action varchar2(30);
227 
228 BEGIN
229    --hr_utility.trace_on(null,'ORCLE');
230    hr_utility.set_location(' Entering:' || l_proc,10);
231    hr_utility.set_location(' CLOB --> xmldom.DOMNode:' || l_proc,15);
232  savepoint deployment_process_api;
233    l_parser      := xmlparser.newParser;
234    xmlparser.ParseCLOB(l_parser,p_document);
235    l_CommitNode  := xmldom.makeNode(xmldom.getDocumentElement(xmlparser.getDocument(l_parser)));
236 
237    hr_utility.set_location('Extracting the PostState:' || l_proc,20);
238 
239    l_commitElement := xmldom.makeElement(l_CommitNode);
240    l_postState := xmldom.getAttribute(l_commitElement, 'PS');
241 
242 
243 
244    create_per_deplymt_eit
245 (p_validate                     => p_validate
246   ,p_person_deployment_id         => hr_transaction_swi.getvarchar2value(l_commitnode,'PersonDeploymentId',null)
247   ,p_person_extra_info_id         => hr_transaction_swi.getvarchar2value(l_commitnode,'PersonExtraInfoId',null)
248   ,p_per_deplymt_eit_id         => hr_transaction_swi.getvarchar2value(l_commitnode,'PersonDeplymtEitId',null)
249     ,p_object_version_number        => l_object_version_number
250     ,p_return_status                => l_return_status);
251 
252 
253   p_return_status := l_return_status;
254 	hr_utility.set_location( l_proc||'p_return_status = '||p_return_status,38);
255    hr_utility.set_location('Exiting:' || l_proc,40);
256 EXCEPTION
257   WHEN OTHERS THEN
258     rollback to deployment_process_api;
259     hr_utility.trace('Exception in .process_api:' || SQLERRM );
260     hr_utility.set_location(' Leaving:' || l_proc,50);
261 
262     raise;
263 
264 END process_api;
265 
266 end hr_per_deplymt_eit_swi;