DBA Data[Home] [Help]

PACKAGE BODY: APPS.HR_INT_SHD

Source


1 Package Body hr_int_shd as
2 /* $Header: hrintrhi.pkb 115.0 2004/01/09 01:40:47 vkarandi noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  hr_int_shd.';  -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |---------------------------< constraint_error >---------------------------|
12 -- ----------------------------------------------------------------------------
13 Procedure constraint_error
14   (p_constraint_name in all_constraints.constraint_name%TYPE
15   ) Is
16 --
17   l_proc        varchar2(72) := g_package||'constraint_error';
18 --
19 Begin
20   --
21   If (p_constraint_name = 'HR_KI_INTEGRATIONS_PK') Then
22     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
23     fnd_message.set_token('PROCEDURE', l_proc);
24     fnd_message.set_token('STEP','5');
25     fnd_message.raise_error;
26   Else
27     fnd_message.set_name('PAY', 'HR_7877_API_INVALID_CONSTRAINT');
28     fnd_message.set_token('PROCEDURE', l_proc);
29     fnd_message.set_token('CONSTRAINT_NAME', p_constraint_name);
30     fnd_message.raise_error;
31   End If;
32   --
33 End constraint_error;
34 --
35 -- ----------------------------------------------------------------------------
36 -- |-----------------------------< api_updating >-----------------------------|
37 -- ----------------------------------------------------------------------------
38 Function api_updating
39   (p_integration_id                       in     number
40   ,p_object_version_number                in     number
41   )
42   Return Boolean Is
43   --
44   --
45   -- Cursor selects the 'current' row from the HR Schema
46   --
47   Cursor C_Sel1 is
48     select
49        integration_id
50       ,integration_key
51       ,party_type
52       ,party_name
53       ,party_site_name
54       ,transaction_type
55       ,transaction_subtype
56       ,standard_code
57       ,ext_trans_type
58       ,ext_trans_subtype
59       ,trans_direction
60       ,url
61       ,synched
62       ,ext_application_id
63       ,application_name
64       ,application_type
65       ,application_url
66       ,logout_url
67       ,user_field
68       ,password_field
69       ,authentication_needed
70       ,field_name1
71       ,field_value1
72       ,field_name2
73       ,field_value2
74       ,field_name3
75       ,field_value3
76       ,field_name4
77       ,field_value4
78       ,field_name5
79       ,field_value5
80       ,field_name6
81       ,field_value6
82       ,field_name7
83       ,field_value7
84       ,field_name8
85       ,field_value8
86       ,field_name9
87       ,field_value9
88       ,object_version_number
89     from        hr_ki_integrations
90     where       integration_id = p_integration_id;
91   --
92   l_fct_ret     boolean;
93   --
94 Begin
95   --
96   If (p_integration_id is null and
97       p_object_version_number is null
98      ) Then
99     --
100     -- One of the primary key arguments is null therefore we must
101     -- set the returning function value to false
102     --
103     l_fct_ret := false;
104   Else
105     If (p_integration_id
106         = hr_int_shd.g_old_rec.integration_id and
107         p_object_version_number
108         = hr_int_shd.g_old_rec.object_version_number
109        ) Then
110       --
111       -- The g_old_rec is current therefore we must
112       -- set the returning function to true
113       --
114       l_fct_ret := true;
115     Else
116       --
117       -- Select the current row into g_old_rec
118       --
119       Open C_Sel1;
120       Fetch C_Sel1 Into hr_int_shd.g_old_rec;
121       If C_Sel1%notfound Then
122         Close C_Sel1;
123         --
124         -- The primary key is invalid therefore we must error
125         --
126         fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
127         fnd_message.raise_error;
128       End If;
129       Close C_Sel1;
130       If (p_object_version_number
131           <> hr_int_shd.g_old_rec.object_version_number) Then
132         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
133         fnd_message.raise_error;
134       End If;
135       l_fct_ret := true;
136     End If;
137   End If;
138   Return (l_fct_ret);
139 --
140 End api_updating;
141 --
142 -- ----------------------------------------------------------------------------
143 -- |---------------------------------< lck >----------------------------------|
144 -- ----------------------------------------------------------------------------
145 Procedure lck
146   (p_integration_id                       in     number
147   ,p_object_version_number                in     number
148   ) is
149 --
150 -- Cursor selects the 'current' row from the HR Schema
151 --
152   Cursor C_Sel1 is
153     select
154        integration_id
155       ,integration_key
156       ,party_type
157       ,party_name
158       ,party_site_name
159       ,transaction_type
160       ,transaction_subtype
161       ,standard_code
162       ,ext_trans_type
163       ,ext_trans_subtype
164       ,trans_direction
165       ,url
166       ,synched
167       ,ext_application_id
168       ,application_name
169       ,application_type
170       ,application_url
171       ,logout_url
172       ,user_field
173       ,password_field
174       ,authentication_needed
175       ,field_name1
176       ,field_value1
177       ,field_name2
178       ,field_value2
179       ,field_name3
180       ,field_value3
181       ,field_name4
182       ,field_value4
183       ,field_name5
184       ,field_value5
185       ,field_name6
186       ,field_value6
187       ,field_name7
188       ,field_value7
189       ,field_name8
190       ,field_value8
191       ,field_name9
192       ,field_value9
193       ,object_version_number
194     from        hr_ki_integrations
195     where       integration_id = p_integration_id
196     for update nowait;
197 --
198   l_proc        varchar2(72) := g_package||'lck';
199 --
200 Begin
201   hr_utility.set_location('Entering:'||l_proc, 5);
202   --
203   hr_api.mandatory_arg_error
204     (p_api_name           => l_proc
205     ,p_argument           => 'INTEGRATION_ID'
206     ,p_argument_value     => p_integration_id
207     );
208   hr_utility.set_location(l_proc,6);
209   hr_api.mandatory_arg_error
210     (p_api_name           => l_proc
211     ,p_argument           => 'OBJECT_VERSION_NUMBER'
212     ,p_argument_value     => p_object_version_number
213     );
214   --
215   Open  C_Sel1;
216   Fetch C_Sel1 Into hr_int_shd.g_old_rec;
217   If C_Sel1%notfound then
218     Close C_Sel1;
219     --
220     -- The primary key is invalid therefore we must error
221     --
222     fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
223     fnd_message.raise_error;
224   End If;
225   Close C_Sel1;
226   If (p_object_version_number
227       <> hr_int_shd.g_old_rec.object_version_number) Then
228         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
229         fnd_message.raise_error;
230   End If;
231   --
232   hr_utility.set_location(' Leaving:'||l_proc, 10);
233   --
234   -- We need to trap the ORA LOCK exception
235   --
236 Exception
237   When HR_Api.Object_Locked then
238     --
239     -- The object is locked therefore we need to supply a meaningful
240     -- error message.
241     --
242     fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
243     fnd_message.set_token('TABLE_NAME', 'hr_ki_integrations');
244     fnd_message.raise_error;
245 End lck;
246 --
247 -- ----------------------------------------------------------------------------
248 -- |-----------------------------< convert_args >-----------------------------|
249 -- ----------------------------------------------------------------------------
250 Function convert_args
251   (p_integration_id                 in number
252   ,p_integration_key                in varchar2
253   ,p_party_type                     in varchar2
254   ,p_party_name                     in varchar2
255   ,p_party_site_name                in varchar2
256   ,p_transaction_type               in varchar2
257   ,p_transaction_subtype            in varchar2
258   ,p_standard_code                  in varchar2
259   ,p_ext_trans_type                 in varchar2
260   ,p_ext_trans_subtype              in varchar2
261   ,p_trans_direction                in varchar2
262   ,p_url                            in varchar2
263   ,p_synched                        in varchar2
264   ,p_ext_application_id             in number
265   ,p_application_name               in varchar2
266   ,p_application_type               in varchar2
267   ,p_application_url                in varchar2
268   ,p_logout_url                     in varchar2
269   ,p_user_field                     in varchar2
270   ,p_password_field                 in varchar2
271   ,p_authentication_needed          in varchar2
272   ,p_field_name1                    in varchar2
273   ,p_field_value1                   in varchar2
274   ,p_field_name2                    in varchar2
275   ,p_field_value2                   in varchar2
276   ,p_field_name3                    in varchar2
277   ,p_field_value3                   in varchar2
278   ,p_field_name4                    in varchar2
279   ,p_field_value4                   in varchar2
280   ,p_field_name5                    in varchar2
281   ,p_field_value5                   in varchar2
282   ,p_field_name6                    in varchar2
283   ,p_field_value6                   in varchar2
284   ,p_field_name7                    in varchar2
285   ,p_field_value7                   in varchar2
286   ,p_field_name8                    in varchar2
287   ,p_field_value8                   in varchar2
288   ,p_field_name9                    in varchar2
289   ,p_field_value9                   in varchar2
290   ,p_object_version_number          in number
291   )
292   Return g_rec_type is
293 --
294   l_rec   g_rec_type;
295 --
296 Begin
297   --
298   -- Convert arguments into local l_rec structure.
299   --
300   l_rec.integration_id                   := p_integration_id;
301   l_rec.integration_key                  := p_integration_key;
302   l_rec.party_type                       := p_party_type;
303   l_rec.party_name                       := p_party_name;
304   l_rec.party_site_name                  := p_party_site_name;
305   l_rec.transaction_type                 := p_transaction_type;
306   l_rec.transaction_subtype              := p_transaction_subtype;
307   l_rec.standard_code                    := p_standard_code;
308   l_rec.ext_trans_type                   := p_ext_trans_type;
309   l_rec.ext_trans_subtype                := p_ext_trans_subtype;
310   l_rec.trans_direction                  := p_trans_direction;
311   l_rec.url                              := p_url;
312   l_rec.synched                          := p_synched;
313   l_rec.ext_application_id               := p_ext_application_id;
314   l_rec.application_name                 := p_application_name;
315   l_rec.application_type                 := p_application_type;
316   l_rec.application_url                  := p_application_url;
317   l_rec.logout_url                       := p_logout_url;
318   l_rec.user_field                       := p_user_field;
319   l_rec.password_field                   := p_password_field;
320   l_rec.authentication_needed            := p_authentication_needed;
321   l_rec.field_name1                      := p_field_name1;
322   l_rec.field_value1                     := p_field_value1;
323   l_rec.field_name2                      := p_field_name2;
324   l_rec.field_value2                     := p_field_value2;
325   l_rec.field_name3                      := p_field_name3;
326   l_rec.field_value3                     := p_field_value3;
327   l_rec.field_name4                      := p_field_name4;
328   l_rec.field_value4                     := p_field_value4;
329   l_rec.field_name5                      := p_field_name5;
330   l_rec.field_value5                     := p_field_value5;
331   l_rec.field_name6                      := p_field_name6;
332   l_rec.field_value6                     := p_field_value6;
333   l_rec.field_name7                      := p_field_name7;
334   l_rec.field_value7                     := p_field_value7;
335   l_rec.field_name8                      := p_field_name8;
336   l_rec.field_value8                     := p_field_value8;
337   l_rec.field_name9                      := p_field_name9;
338   l_rec.field_value9                     := p_field_value9;
339   l_rec.object_version_number            := p_object_version_number;
340   --
341   -- Return the plsql record structure.
342   --
343   Return(l_rec);
344 --
345 End convert_args;
346 --
347 end hr_int_shd;