1 Package hxc_ter_shd as
2 /* $Header: hxcterrhi.pkh 120.0 2005/05/29 05:59:43 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (time_entry_rule_id number(15)
10 ,name varchar2(80)
11 ,business_group_id number(15)
12 ,legislation_code varchar2(30)
13 ,rule_usage varchar2(30) -- Increased length
14 ,mapping_id number(15)
15 ,formula_id number(9)
16 ,description varchar2(2000)
17 ,start_date date
18 ,end_date date
19 ,object_version_number number(9)
20 ,attribute_category varchar2(30)
21 ,attribute1 varchar2(150)
22 ,attribute2 varchar2(150)
23 ,attribute3 varchar2(150)
24 ,attribute4 varchar2(150)
25 ,attribute5 varchar2(150)
26 ,attribute6 varchar2(150)
27 ,attribute7 varchar2(150)
28 ,attribute8 varchar2(150)
29 ,attribute9 varchar2(150)
30 ,attribute10 varchar2(150)
31 ,attribute11 varchar2(150)
32 ,attribute12 varchar2(150)
33 ,attribute13 varchar2(150)
34 ,attribute14 varchar2(150)
35 ,attribute15 varchar2(150)
36 ,attribute16 varchar2(150)
37 ,attribute17 varchar2(150)
38 ,attribute18 varchar2(150)
39 ,attribute19 varchar2(150)
40 ,attribute20 varchar2(150)
41 ,attribute21 varchar2(150)
42 ,attribute22 varchar2(150)
43 ,attribute23 varchar2(150)
44 ,attribute24 varchar2(150)
45 ,attribute25 varchar2(150)
46 ,attribute26 varchar2(150)
47 ,attribute27 varchar2(150)
48 ,attribute28 varchar2(150)
49 ,attribute29 varchar2(150)
50 ,attribute30 varchar2(150)
51 );
52 --
53 -- ----------------------------------------------------------------------------
54 -- | Global Definitions - Internal Development Use Only |
55 -- ----------------------------------------------------------------------------
56 --
57 g_old_rec g_rec_type; -- Global record definition
58 g_api_dml boolean; -- Global api dml status
59 --
60 -- ----------------------------------------------------------------------------
61 -- |------------------------< return_api_dml_status >-------------------------|
62 -- ----------------------------------------------------------------------------
63 -- {Start Of Comments}
64 --
65 -- Description:
66 -- This function will return the current g_api_dml private global
67 -- boolean status.
68 -- The g_api_dml status determines if at the time of the function
69 -- being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
70 -- is being issued from within an api.
71 -- If the status is TRUE then a dml statement is being issued from
72 -- within this entity api.
73 -- This function is primarily to support database triggers which
74 -- need to maintain the object_version_number for non-supported
75 -- dml statements (i.e. dml statement issued outside of the api layer).
76 --
77 -- Prerequisites:
78 -- None.
79 --
80 -- In Parameters:
81 -- None.
82 --
83 -- Post Success:
84 -- Processing continues.
85 -- If the function returns a TRUE value then, dml is being executed from
86 -- within this api.
87 --
88 -- Post Failure:
89 -- None.
90 --
91 -- Access Status:
92 -- Internal Row Handler Use Only.
93 --
94 -- {End Of Comments}
95 -- ----------------------------------------------------------------------------
96 Function return_api_dml_status Return Boolean;
97 --
98 -- ----------------------------------------------------------------------------
99 -- |---------------------------< constraint_error >---------------------------|
100 -- ----------------------------------------------------------------------------
101 -- {Start Of Comments}
102 --
103 -- Description:
104 -- This procedure is called when a constraint has been violated (i.e.
105 -- The exception hr_api.check_integrity_violated,
106 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
107 -- hr_api.unique_integrity_violated has been raised).
108 -- The exceptions can only be raised as follows:
109 -- 1) A check constraint can only be violated during an INSERT or UPDATE
110 -- dml operation.
111 -- 2) A parent integrity constraint can only be violated during an
112 -- INSERT or UPDATE dml operation.
113 -- 3) A child integrity constraint can only be violated during an
114 -- DELETE dml operation.
115 -- 4) A unique integrity constraint can only be violated during INSERT or
116 -- UPDATE dml operation.
117 --
118 -- Prerequisites:
119 -- 1) Either hr_api.check_integrity_violated,
120 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
121 -- hr_api.unique_integrity_violated has been raised with the subsequent
122 -- stripping of the constraint name from the generated error message
123 -- text.
124 -- 2) Standalone validation test which corresponds with a constraint error.
125 --
126 -- In Parameter:
127 -- p_constraint_name is in upper format and is just the constraint name
128 -- (e.g. not prefixed by brackets, schema owner etc).
129 --
130 -- Post Success:
131 -- Development dependant.
132 --
133 -- Post Failure:
134 -- Developement dependant.
135 --
136 -- Developer Implementation Notes:
137 -- For each constraint being checked the hr system package failure message
138 -- has been generated as a template only. These system error messages should
139 -- be modified as required (i.e. change the system failure message to a user
140 -- friendly defined error message).
141 --
142 -- Access Status:
143 -- Internal Development Use Only.
144 --
145 -- {End Of Comments}
146 -- ----------------------------------------------------------------------------
147 Procedure constraint_error
148 (p_constraint_name in all_constraints.constraint_name%TYPE);
149 --
150 -- ----------------------------------------------------------------------------
151 -- |-----------------------------< api_updating >-----------------------------|
152 -- ----------------------------------------------------------------------------
153 -- {Start Of Comments}
154 --
155 -- Description:
156 -- This function is used to populate the g_old_rec record with the
157 -- current row from the database for the specified primary key
158 -- provided that the primary key exists and is valid and does not
159 -- already match the current g_old_rec. The function will always return
160 -- a TRUE value if the g_old_rec is populated with the current row.
161 -- A FALSE value will be returned if all of the primary key arguments
162 -- are null.
163 --
164 -- Prerequisites:
165 -- None.
166 --
167 -- In Parameters:
168 --
169 -- Post Success:
170 -- A value of TRUE will be returned indiciating that the g_old_rec
171 -- is current.
172 -- A value of FALSE will be returned if all of the primary key arguments
173 -- have a null value (this indicates that the row has not be inserted into
174 -- the Schema), and therefore could never have a corresponding row.
175 --
176 -- Post Failure:
177 -- A failure can only occur under two circumstances:
178 -- 1) The primary key is invalid (i.e. a row does not exist for the
179 -- specified primary key values).
180 -- 2) If an object_version_number exists but is NOT the same as the current
181 -- g_old_rec value.
182 --
183 -- Developer Implementation Notes:
184 -- None.
185 --
186 -- Access Status:
187 -- Internal Development Use Only.
188 --
189 -- {End Of Comments}
190 -- ----------------------------------------------------------------------------
191 Function api_updating
192 (p_time_entry_rule_id in number
193 ,p_object_version_number in number
194 ) Return Boolean;
195 --
196 -- ----------------------------------------------------------------------------
197 -- |---------------------------------< lck >----------------------------------|
198 -- ----------------------------------------------------------------------------
199 -- {Start of comments}
200 --
201 -- Description:
202 -- The Lck process has two main functions to perform. Firstly, the row to be
203 -- updated or deleted must be locked. The locking of the row will only be
204 -- successful if the row is not currently locked by another user.
205 -- Secondly, during the locking of the row, the row is selected into
206 -- the g_old_rec data structure which enables the current row values from the
207 -- server to be available to the api.
208 --
209 -- Prerequisites:
210 -- When attempting to call the lock the object version number (if defined)
211 -- is mandatory.
212 --
213 -- In Parameters:
214 -- The arguments to the Lck process are the primary key(s) which uniquely
215 -- identify the row and the object version number of row.
216 --
217 -- Post Success:
218 -- On successful completion of the Lck process the row to be updated or
219 -- deleted will be locked and selected into the global data structure
220 -- g_old_rec.
221 --
222 -- Post Failure:
223 -- The Lck process can fail for three reasons:
224 -- 1) When attempting to lock the row the row could already be locked by
225 -- another user. This will raise the HR_Api.Object_Locked exception.
226 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
227 -- This error is trapped and reported using the message name
228 -- 'HR_7220_INVALID_PRIMARY_KEY'.
229 -- 3) The row although existing in the HR Schema has a different object
230 -- version number than the object version number specified.
231 -- This error is trapped and reported using the message name
232 -- 'HR_7155_OBJECT_INVALID'.
233 --
234 -- Developer Implementation Notes:
235 -- For each primary key and the object version number arguments add a
236 -- call to hr_api.mandatory_arg_error procedure to ensure that these
237 -- argument values are not null.
238 --
239 -- Access Status:
240 -- Internal Development Use Only.
241 --
242 -- {End of comments}
243 -- ----------------------------------------------------------------------------
244 Procedure lck
245 (p_time_entry_rule_id in number
246 ,p_object_version_number in number
247 );
248 --
249 -- ----------------------------------------------------------------------------
250 -- |-----------------------------< convert_args >-----------------------------|
251 -- ----------------------------------------------------------------------------
252 -- {Start Of Comments}
253 --
254 -- Description:
255 -- This function is used to turn attribute parameters into the record
256 -- structure parameter g_rec_type.
257 --
258 -- Prerequisites:
259 -- This is a private function and can only be called from the ins or upd
260 -- attribute processes.
261 --
262 -- In Parameters:
263 --
264 -- Post Success:
265 -- A returning record structure will be returned.
266 --
267 -- Post Failure:
268 -- No direct error handling is required within this function. Any possible
269 -- errors within this function will be a PL/SQL value error due to conversion
270 -- of datatypes or data lengths.
271 --
272 -- Developer Implementation Notes:
273 -- None.
274 --
275 -- Access Status:
276 -- Internal Row Handler Use Only.
277 --
278 -- {End Of Comments}
279 -- ----------------------------------------------------------------------------
280 Function convert_args
281 (p_time_entry_rule_id in number
282 ,p_name in varchar2
283 ,p_business_group_id in number
284 ,p_legislation_code in varchar2
285 ,p_rule_usage in varchar2
286 ,p_mapping_id in number
287 ,p_formula_id in number
288 ,p_description in varchar2
289 ,p_start_date in date
290 ,p_end_date in date
291 ,p_object_version_number in number
292 ,p_attribute_category in varchar2
293 ,p_attribute1 in varchar2
294 ,p_attribute2 in varchar2
295 ,p_attribute3 in varchar2
296 ,p_attribute4 in varchar2
297 ,p_attribute5 in varchar2
298 ,p_attribute6 in varchar2
299 ,p_attribute7 in varchar2
300 ,p_attribute8 in varchar2
301 ,p_attribute9 in varchar2
302 ,p_attribute10 in varchar2
303 ,p_attribute11 in varchar2
304 ,p_attribute12 in varchar2
305 ,p_attribute13 in varchar2
306 ,p_attribute14 in varchar2
307 ,p_attribute15 in varchar2
308 ,p_attribute16 in varchar2
309 ,p_attribute17 in varchar2
310 ,p_attribute18 in varchar2
311 ,p_attribute19 in varchar2
312 ,p_attribute20 in varchar2
313 ,p_attribute21 in varchar2
314 ,p_attribute22 in varchar2
315 ,p_attribute23 in varchar2
316 ,p_attribute24 in varchar2
317 ,p_attribute25 in varchar2
318 ,p_attribute26 in varchar2
319 ,p_attribute27 in varchar2
320 ,p_attribute28 in varchar2
321 ,p_attribute29 in varchar2
322 ,p_attribute30 in varchar2
323 )
324 Return g_rec_type;
325 --
326 end hxc_ter_shd;