[Home] [Help]
PACKAGE BODY: APPS.HXC_RTC_SHD
Source
1 Package Body hxc_rtc_shd as
2 /* $Header: hxcrtcrhi.pkb 120.2 2005/09/23 08:51:07 nissharm noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' hxc_rtc_shd.'; -- Global package name
9
10 g_debug boolean := hr_utility.debug_enabled;
11 --
12 -- ----------------------------------------------------------------------------
13 -- |------------------------< return_api_dml_status >-------------------------|
14 -- ----------------------------------------------------------------------------
15 Function return_api_dml_status Return Boolean Is
16 --
17 Begin
18 --
19 Return (nvl(g_api_dml, false));
20 --
21 End return_api_dml_status;
22 --
23 -- ----------------------------------------------------------------------------
24 -- |---------------------------< constraint_error >---------------------------|
25 -- ----------------------------------------------------------------------------
26 Procedure constraint_error
27 (p_constraint_name in all_constraints.constraint_name%TYPE
28 ) Is
29 --
30 l_proc varchar2(72) := g_package||'constraint_error';
31 --
32 Begin
33 --
34 If (p_constraint_name = 'HXC_RETRIEVAL_RULES_FK2') Then
35 fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
36 fnd_message.set_token('PROCEDURE', l_proc);
37 fnd_message.set_token('STEP','5');
38 fnd_message.raise_error;
39 ElsIf (p_constraint_name = 'HXC_RETRIEVAL_RULE_COMPS_FK1') Then
40 fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
41 fnd_message.set_token('PROCEDURE', l_proc);
42 fnd_message.set_token('STEP','10');
43 fnd_message.raise_error;
44 ElsIf (p_constraint_name = 'HXC_RETRIEVAL_RULE_COMPS_PK') Then
45 fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
46 fnd_message.set_token('PROCEDURE', l_proc);
47 fnd_message.set_token('STEP','15');
48 fnd_message.raise_error;
49 Else
50 fnd_message.set_name('PAY', 'HR_7877_API_INVALID_CONSTRAINT');
51 fnd_message.set_token('PROCEDURE', l_proc);
52 fnd_message.set_token('CONSTRAINT_NAME', p_constraint_name);
53 fnd_message.raise_error;
54 End If;
55 --
56 End constraint_error;
57 --
58 -- ----------------------------------------------------------------------------
59 -- |-----------------------------< api_updating >-----------------------------|
60 -- ----------------------------------------------------------------------------
61 Function api_updating
62 (p_retrieval_rule_comp_id in number
63 ,p_object_version_number in number
64 )
65 Return Boolean Is
66 --
67 --
68 -- Cursor selects the 'current' row from the HR Schema
69 --
70 Cursor C_Sel1 is
71 select
72 retrieval_rule_comp_id
73 ,retrieval_rule_id
74 ,status
75 ,object_version_number
76 ,time_recipient_id
77 from hxc_retrieval_rule_comps
78 where retrieval_rule_comp_id = p_retrieval_rule_comp_id;
79 --
80 l_fct_ret boolean;
81 --
82 Begin
83 --
84 If (p_retrieval_rule_comp_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_retrieval_rule_comp_id
94 = hxc_rtc_shd.g_old_rec.retrieval_rule_comp_id and
95 p_object_version_number
96 = hxc_rtc_shd.g_old_rec.object_version_number
97 ) Then
98 --
99 -- The g_old_rec is current therefore we must
100 -- set the returning function to true
101 --
102 l_fct_ret := true;
103 Else
104 --
105 -- Select the current row into g_old_rec
106 --
107 Open C_Sel1;
108 Fetch C_Sel1 Into hxc_rtc_shd.g_old_rec;
109 If C_Sel1%notfound Then
110 Close C_Sel1;
111 --
112 -- The primary key is invalid therefore we must error
113 --
114 fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
115 fnd_message.raise_error;
116 End If;
117 Close C_Sel1;
118 If (p_object_version_number
119 <> hxc_rtc_shd.g_old_rec.object_version_number) Then
120 fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
121 fnd_message.raise_error;
122 End If;
123 l_fct_ret := true;
124 End If;
125 End If;
126 Return (l_fct_ret);
127 --
128 End api_updating;
129 --
130 -- ----------------------------------------------------------------------------
131 -- |---------------------------------< lck >----------------------------------|
132 -- ----------------------------------------------------------------------------
133 Procedure lck
134 (p_retrieval_rule_comp_id in number
135 ,p_object_version_number in number
136 ) is
137 --
138 -- Cursor selects the 'current' row from the HR Schema
139 --
140 Cursor C_Sel1 is
141 select
142 retrieval_rule_comp_id
143 ,retrieval_rule_id
144 ,status
145 ,object_version_number
146 ,time_recipient_id
147 from hxc_retrieval_rule_comps
148 where retrieval_rule_comp_id = p_retrieval_rule_comp_id
149 for update nowait;
150 --
151 l_proc varchar2(72);
152 --
153 Begin
154 g_debug := hr_utility.debug_enabled;
155
156 if g_debug then
157 l_proc := g_package||'lck';
158 hr_utility.set_location('Entering:'||l_proc, 5);
159 end if;
160 --
161 hr_api.mandatory_arg_error
162 (p_api_name => l_proc
163 ,p_argument => 'RETRIEVAL_RULE_COMP_ID'
164 ,p_argument_value => p_retrieval_rule_comp_id
165 );
166 --
167 Open C_Sel1;
168 Fetch C_Sel1 Into hxc_rtc_shd.g_old_rec;
169 If C_Sel1%notfound then
170 Close C_Sel1;
171 --
172 -- The primary key is invalid therefore we must error
173 --
174 fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
175 fnd_message.raise_error;
176 End If;
177 Close C_Sel1;
178 If (p_object_version_number
179 <> hxc_rtc_shd.g_old_rec.object_version_number) Then
180 fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
181 fnd_message.raise_error;
182 End If;
183 --
184 if g_debug then
185 hr_utility.set_location(' Leaving:'||l_proc, 10);
186 end if;
187 --
188 -- We need to trap the ORA LOCK exception
189 --
190 Exception
191 When HR_Api.Object_Locked then
192 --
193 -- The object is locked therefore we need to supply a meaningful
194 -- error message.
195 --
196 fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
197 fnd_message.set_token('TABLE_NAME', 'hxc_retrieval_rule_comps');
198 fnd_message.raise_error;
199 End lck;
200 --
201 -- ----------------------------------------------------------------------------
202 -- |-----------------------------< convert_args >-----------------------------|
203 -- ----------------------------------------------------------------------------
204 Function convert_args
205 (p_retrieval_rule_comp_id in number
206 ,p_retrieval_rule_id in number
207 ,p_status in varchar2
208 ,p_object_version_number in number
209 ,p_time_recipient_id in number
210 )
211 Return g_rec_type is
212 --
213 l_rec g_rec_type;
214 --
215 Begin
216 --
217 -- Convert arguments into local l_rec structure.
218 --
219 l_rec.retrieval_rule_comp_id := p_retrieval_rule_comp_id;
220 l_rec.retrieval_rule_id := p_retrieval_rule_id;
221 l_rec.status := p_status;
222 l_rec.object_version_number := p_object_version_number;
223 l_rec.time_recipient_id := p_time_recipient_id;
224 --
225 -- Return the plsql record structure.
226 --
227 Return(l_rec);
228 --
229 End convert_args;
230 --
231 end hxc_rtc_shd;