DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_SEC_PROFILE_ASG_SWI

Source


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