DBA Data[Home] [Help]

PACKAGE BODY: APPS.HR_TIS_SHD

Source


1 Package Body hr_tis_shd as
2 /* $Header: hrtisrhi.pkb 120.3 2008/02/25 13:24:06 avarri ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  hr_tis_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_TOPIC_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   ElsIf (p_constraint_name = 'HR_KI_TOPIC_INTEGRATIONS_UK1') Then
27     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
28     fnd_message.set_token('PROCEDURE', l_proc);
29     fnd_message.set_token('STEP','10');
30     fnd_message.raise_error;
31   Else
32     fnd_message.set_name('PAY', 'HR_7877_API_INVALID_CONSTRAINT');
33     fnd_message.set_token('PROCEDURE', l_proc);
34     fnd_message.set_token('CONSTRAINT_NAME', p_constraint_name);
35     fnd_message.raise_error;
36   End If;
37   --
38 End constraint_error;
39 --
40 -- ----------------------------------------------------------------------------
41 -- |-----------------------------< api_updating >-----------------------------|
42 -- ----------------------------------------------------------------------------
43 Function api_updating
44   (p_topic_integrations_id                in     number
45   ,p_object_version_number                in     number
46   )
47   Return Boolean Is
48   --
49   --
50   -- Cursor selects the 'current' row from the HR Schema
51   --
52   Cursor C_Sel1 is
53     select topic_integrations_id
54           ,topic_id
55           ,integration_id
56           ,param_name1
57           ,param_value1
58           ,param_name2
59           ,param_value2
60           ,param_name3
61           ,param_value3
62           ,param_name4
63           ,param_value4
64           ,param_name5
65           ,param_value5
66           ,param_name6
67           ,param_value6
68           ,param_name7
69           ,param_value7
70           ,param_name8
71           ,param_value8
72           ,param_name9
73           ,param_value9
74           ,param_name10
75           ,param_value10
76           ,object_version_number
77      from  hr_ki_topic_integrations
78     where  topic_integrations_id = p_topic_integrations_id;
79   --
80   l_fct_ret     boolean;
81   --
82 Begin
83   --
84   If (p_topic_integrations_id is null and
85       p_object_version_number is null
86      ) Then
87     --
88     -- One of the primary key arguments is null therefore we must
89     -- set the returning function value to false
90     --
91     l_fct_ret := false;
92   Else
93     If (p_topic_integrations_id  = hr_tis_shd.g_old_rec.topic_integrations_id and
94         p_object_version_number  = hr_tis_shd.g_old_rec.object_version_number
95        ) Then
96       --
97       -- The g_old_rec is current therefore we must
98       -- set the returning function to true
99       --
100       l_fct_ret := true;
101     Else
102       --
103       -- Select the current row into g_old_rec
104       --
105       Open C_Sel1;
106       Fetch C_Sel1 Into hr_tis_shd.g_old_rec;
107       If C_Sel1%notfound Then
108         Close C_Sel1;
109         --
110         -- The primary key is invalid therefore we must error
111         --
112         fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
113         fnd_message.raise_error;
114       End If;
115       Close C_Sel1;
116       If (p_object_version_number <> hr_tis_shd.g_old_rec.object_version_number) Then
117         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
118         fnd_message.raise_error;
119       End If;
120       l_fct_ret := true;
121     End If;
122   End If;
123   Return (l_fct_ret);
124 --
125 End api_updating;
126 --
127 -- ----------------------------------------------------------------------------
128 -- |---------------------------------< lck >----------------------------------|
129 -- ----------------------------------------------------------------------------
130 Procedure lck
131   (p_topic_integrations_id                in     number
132   ,p_object_version_number                in     number
133   ) is
134 --
135 -- Cursor selects the 'current' row from the HR Schema
136 --
137   Cursor C_Sel1 is
138     select topic_integrations_id
139           ,topic_id
140           ,integration_id
141           ,param_name1
142           ,param_value1
143           ,param_name2
144           ,param_value2
145           ,param_name3
146           ,param_value3
147           ,param_name4
148           ,param_value4
149           ,param_name5
150           ,param_value5
151           ,param_name6
152           ,param_value6
153           ,param_name7
154           ,param_value7
155           ,param_name8
156           ,param_value8
157           ,param_name9
158           ,param_value9
159           ,param_name10
160           ,param_value10
161           ,object_version_number
162     from   hr_ki_topic_integrations
163     where  topic_integrations_id = p_topic_integrations_id
164     for update nowait;
165 --
166   l_proc        varchar2(72) := g_package||'lck';
167 --
168 Begin
169   hr_utility.set_location('Entering:'||l_proc, 5);
170   --
171   hr_api.mandatory_arg_error
172     (p_api_name           => l_proc
173     ,p_argument           => 'TOPIC_INTEGRATIONS_ID'
174     ,p_argument_value     => p_topic_integrations_id
175     );
176   hr_utility.set_location(l_proc,6);
177   hr_api.mandatory_arg_error
178     (p_api_name           => l_proc
179     ,p_argument           => 'OBJECT_VERSION_NUMBER'
180     ,p_argument_value     => p_object_version_number
181     );
182   --
183   Open  C_Sel1;
184   Fetch C_Sel1 Into hr_tis_shd.g_old_rec;
185   If C_Sel1%notfound then
186     Close C_Sel1;
187     --
188     -- The primary key is invalid therefore we must error
189     --
190     fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
191     fnd_message.raise_error;
192   End If;
193   Close C_Sel1;
194   If (p_object_version_number  <> hr_tis_shd.g_old_rec.object_version_number) Then
195         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
196         fnd_message.raise_error;
197   End If;
198   --
199   hr_utility.set_location(' Leaving:'||l_proc, 10);
200   --
201   -- We need to trap the ORA LOCK exception
202   --
203 Exception
204   When HR_Api.Object_Locked then
205     --
206     -- The object is locked therefore we need to supply a meaningful
207     -- error message.
208     --
209     fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
210     fnd_message.set_token('TABLE_NAME', 'hr_ki_topic_integrations');
211     fnd_message.raise_error;
212 End lck;
213 --
214 -- ----------------------------------------------------------------------------
215 -- |-----------------------------< convert_args >-----------------------------|
216 -- ----------------------------------------------------------------------------
217 Function convert_args
218   (p_topic_integrations_id          in number
219   ,p_topic_id                       in number
220   ,p_integration_id                 in number
221   ,p_param_name1                    in varchar2
222   ,p_param_value1                   in varchar2
223   ,p_param_name2                    in varchar2
224   ,p_param_value2                   in varchar2
225   ,p_param_name3                    in varchar2
226   ,p_param_value3                   in varchar2
227   ,p_param_name4                    in varchar2
228   ,p_param_value4                   in varchar2
229   ,p_param_name5                    in varchar2
230   ,p_param_value5                   in varchar2
231   ,p_param_name6                    in varchar2
232   ,p_param_value6                   in varchar2
233   ,p_param_name7                    in varchar2
234   ,p_param_value7                   in varchar2
235   ,p_param_name8                    in varchar2
236   ,p_param_value8                   in varchar2
237   ,p_param_name9                    in varchar2
238   ,p_param_value9                   in varchar2
239   ,p_param_name10                   in varchar2
240   ,p_param_value10                  in varchar2
241   ,p_object_version_number          in number
242   )
243   Return g_rec_type is
244 --
245   l_rec   g_rec_type;
246 --
247 Begin
248   --
249   -- Convert arguments into local l_rec structure.
250   --
251   l_rec.topic_integrations_id        := p_topic_integrations_id;
252   l_rec.topic_id                     := p_topic_id;
253   l_rec.integration_id               := p_integration_id;
254   l_rec.param_name1                  := p_param_name1;
255   l_rec.param_value1                 := p_param_value1;
256   l_rec.param_name2                  := p_param_name2;
257   l_rec.param_value2                 := p_param_value2;
258   l_rec.param_name3                  := p_param_name3;
259   l_rec.param_value3                 := p_param_value3;
260   l_rec.param_name4                  := p_param_name4;
261   l_rec.param_value4                 := p_param_value4;
262   l_rec.param_name5                  := p_param_name5;
263   l_rec.param_value5                 := p_param_value5;
264   l_rec.param_name6                  := p_param_name6;
265   l_rec.param_value6                 := p_param_value6;
266   l_rec.param_name7                  := p_param_name7;
267   l_rec.param_value7                 := p_param_value7;
268   l_rec.param_name8                  := p_param_name8;
269   l_rec.param_value8                 := p_param_value8;
270   l_rec.param_name9                  := p_param_name9;
271   l_rec.param_value9                 := p_param_value9;
272   l_rec.param_name10                 := p_param_name10;
273   l_rec.param_value10                := p_param_value10;
274   l_rec.object_version_number        := p_object_version_number;
275   --
276   -- Return the plsql record structure.
277   --
278   Return(l_rec);
279 --
280 End convert_args;
281 --
282 end hr_tis_shd;