1 Package ota_tfl_api_shd as
2 /* $Header: ottfl01t.pkh 120.0 2005/05/29 07:41:52 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (
10 finance_line_id number(9),
11 finance_header_id number(9),
12 cancelled_flag varchar2(30),
13 date_raised date,
14 line_type varchar2(30),
15 object_version_number number(9),
16 sequence_number number(9),
17 transfer_status varchar2(30),
18 comments varchar2(2000),
19 currency_code varchar2(30),
20 money_amount number,
21 standard_amount number,
22 trans_information_category varchar2(30),
23 trans_information1 varchar2(150),
24 trans_information10 varchar2(150),
25 trans_information11 varchar2(150),
26 trans_information12 varchar2(150),
27 trans_information13 varchar2(150),
28 trans_information14 varchar2(150),
29 trans_information15 varchar2(150),
30 trans_information16 varchar2(150),
31 trans_information17 varchar2(150),
32 trans_information18 varchar2(150),
33 trans_information19 varchar2(150),
34 trans_information2 varchar2(150),
35 trans_information20 varchar2(150),
36 trans_information3 varchar2(150),
37 trans_information4 varchar2(150),
38 trans_information5 varchar2(150),
39 trans_information6 varchar2(150),
40 trans_information7 varchar2(150),
41 trans_information8 varchar2(150),
42 trans_information9 varchar2(150),
43 transfer_date date,
44 transfer_message varchar2(240),
45 unitary_amount number(17,2), -- Increased length
46 booking_deal_id number(9),
47 booking_id number(9),
48 resource_allocation_id number(9),
49 resource_booking_id number(9),
50 tfl_information_category varchar2(30),
51 tfl_information1 varchar2(150),
52 tfl_information2 varchar2(150),
53 tfl_information3 varchar2(150),
54 tfl_information4 varchar2(150),
55 tfl_information5 varchar2(150),
56 tfl_information6 varchar2(150),
57 tfl_information7 varchar2(150),
58 tfl_information8 varchar2(150),
59 tfl_information9 varchar2(150),
60 tfl_information10 varchar2(150),
61 tfl_information11 varchar2(150),
62 tfl_information12 varchar2(150),
63 tfl_information13 varchar2(150),
64 tfl_information14 varchar2(150),
65 tfl_information15 varchar2(150),
66 tfl_information16 varchar2(150),
67 tfl_information17 varchar2(150),
68 tfl_information18 varchar2(150),
69 tfl_information19 varchar2(150),
70 tfl_information20 varchar2(150)
71 );
72 --
73 -- ----------------------------------------------------------------------------
74 -- | Global Definitions - Internal Development Use Only |
75 -- ----------------------------------------------------------------------------
76 --
77 g_old_rec g_rec_type; -- Global record definition
78 g_api_dml boolean; -- Global api dml status
79 --
80 -- ----------------------------------------------------------------------------
81 -- |------------------------< return_api_dml_status >-------------------------|
82 -- ----------------------------------------------------------------------------
83 -- {Start Of Comments}
84 --
85 -- Description:
86 -- This function will return the current g_api_dml private global
87 -- boolean status.
88 -- The g_api_dml status determines if at the time of the function
89 -- being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
90 -- is being issued from within an api.
91 -- If the status is TRUE then a dml statement is being issued from
92 -- within this entity api.
93 -- This function is primarily to support database triggers which
94 -- need to maintain the object_version_number for non-supported
95 -- dml statements (i.e. dml statement issued outside of the api layer).
96 --
97 -- Pre Conditions:
98 -- None.
99 --
100 -- In Arguments:
101 -- None.
102 --
103 -- Post Success:
104 -- Processing continues.
105 -- If the function returns a TRUE value then, dml is being executed from
106 -- within this api.
107 --
108 -- Post Failure:
109 -- None.
110 --
111 -- Access Status:
112 -- Public.
113 --
114 -- {End Of Comments}
115 -- ----------------------------------------------------------------------------
116 Function return_api_dml_status Return Boolean;
117 --
118 -- ----------------------------------------------------------------------------
119 -- |---------------------------< constraint_error >---------------------------|
120 -- ----------------------------------------------------------------------------
121 -- {Start Of Comments}
122 --
123 -- Description:
124 -- This procedure is called when a constraint has been violated (i.e.
125 -- The exception hr_api.check_integrity_violated,
126 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
127 -- hr_api.unique_integrity_violated has been raised).
128 -- The exceptions can only be raised as follows:
129 -- 1) A check constraint can only be violated during an INSERT or UPDATE
130 -- dml operation.
131 -- 2) A parent integrity constraint can only be violated during an
132 -- INSERT or UPDATE dml operation.
133 -- 3) A child integrity constraint can only be violated during an
134 -- DELETE dml operation.
135 -- 4) A unique integrity constraint can only be violated during INSERT or
136 -- UPDATE dml operation.
137 --
138 -- Pre Conditions:
139 -- 1) Either hr_api.check_integrity_violated,
140 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
141 -- hr_api.unique_integrity_violated has been raised with the subsequent
142 -- stripping of the constraint name from the generated error message
143 -- text.
144 -- 2) Standalone validation test which correspond with a constraint error.
145 --
146 -- In Arguments:
147 -- p_constraint_name is in upper format and is just the constraint name
148 -- (e.g. not prefixed by brackets, schema owner etc).
149 --
150 -- Post Success:
151 -- Development dependant.
152 --
153 -- Post Failure:
154 -- Developement dependant.
155 --
156 -- Developer Implementation Notes:
157 -- For each constraint being checked the hr system package failure message
158 -- has been generated as a template only. These system error messages should
159 -- be modified as required (i.e. change the system failure message to a user
160 -- friendly defined error message).
161 --
162 -- Access Status:
163 -- Public.
164 --
165 -- {End Of Comments}
166 -- ----------------------------------------------------------------------------
167 Procedure constraint_error
168 (p_constraint_name in varchar2);
169 --
170 -- ----------------------------------------------------------------------------
171 -- |-----------------------------< api_updating >-----------------------------|
172 -- ----------------------------------------------------------------------------
173 -- {Start Of Comments}
174 --
175 -- Description:
176 -- This function is used to populate the g_old_rec record with the
177 -- current row from the database for the specified primary key
178 -- provided that the primary key exists and is valid and does not
179 -- already match the current g_old_rec. The function will always return
180 -- a TRUE value if the g_old_rec is populated with the current row.
181 -- A FALSE value will be returned if all of the primary key arguments
182 -- are null.
183 --
184 -- Pre Conditions:
185 -- None.
186 --
187 -- In Arguments:
188 --
189 -- Post Success:
190 -- A value of TRUE will be returned indiciating that the g_old_rec
191 -- is current.
192 -- A value of FALSE will be returned if all of the primary key arguments
193 -- have a null value (this indicates that the row has not be inserted into
194 -- the Schema), and therefore could never have a corresponding row.
195 --
196 -- Post Failure:
197 -- A failure can only occur under two circumstances:
198 -- 1) The primary key is invalid (i.e. a row does not exist for the
199 -- specified primary key values).
200 -- 2) If an object_version_number exists but is NOT the same as the current
201 -- g_old_rec value.
202 --
203 -- Developer Implementation Notes:
204 -- None.
205 --
206 -- Access Status:
207 -- Internal Development Use Only.
208 --
209 -- {End Of Comments}
210 -- ----------------------------------------------------------------------------
211 Function api_updating
212 (
213 p_finance_line_id in number,
214 p_object_version_number in number
215 ) Return Boolean;
216 --
217 -- ----------------------------------------------------------------------------
218 -- |---------------------------------< lck >----------------------------------|
219 -- ----------------------------------------------------------------------------
220 -- {Start Of Comments}
221 --
222 -- Description:
223 -- The Lck process has two main functions to perform. Firstly, the row to be
224 -- updated or deleted must be locked. The locking of the row will only be
225 -- successful if the row is not currently locked by another user.
226 -- Secondly, during the locking of the row, the row is selected into
227 -- the g_old_rec data structure which enables the current row values from the
228 -- server to be available to the api.
229 --
230 -- Pre Conditions:
231 -- When attempting to call the lock the object version number (if defined)
232 -- is mandatory.
233 --
234 -- In Arguments:
235 -- The arguments to the Lck process are the primary key(s) which uniquely
236 -- identify the row and the object version number of row.
237 --
238 -- Post Success:
239 -- On successful completion of the Lck process the row to be updated or
240 -- deleted will be locked and selected into the global data structure
241 -- g_old_rec.
242 --
243 -- Post Failure:
244 -- The Lck process can fail for three reasons:
245 -- 1) When attempting to lock the row the row could already be locked by
246 -- another user. This will raise the HR_Api.Object_Locked exception.
247 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
248 -- This error is trapped and reported using the message name
249 -- 'HR_7220_INVALID_PRIMARY_KEY'.
250 -- 3) The row although existing in the HR Schema has a different object
251 -- version number than the object version number specified.
252 -- This error is trapped and reported using the message name
253 -- 'HR_7155_OBJECT_INVALID'.
254 --
255 -- Developer Implementation Notes:
256 -- For each primary key and the object version number arguments add a
257 -- call to hr_api.mandatory_arg_error procedure to ensure that these
258 -- argument values are not null.
259 --
260 -- Access Status:
261 -- Public.
262 --
263 -- {End Of Comments}
264 -- ----------------------------------------------------------------------------
265 Procedure lck
266 (
267 p_finance_line_id in number,
268 p_object_version_number in number
269 );
270 --
271 -- ----------------------------------------------------------------------------
272 -- |-----------------------------< convert_args >-----------------------------|
273 -- ----------------------------------------------------------------------------
274 -- {Start Of Comments}
275 --
276 -- Description:
277 -- This function is used to turn attribute arguments into the record
278 -- structure g_rec_type.
279 --
280 -- Pre Conditions:
281 -- This is a private function and can only be called from the ins or upd
282 -- attribute processes.
283 --
284 -- In Arguments:
285 --
286 -- Post Success:
287 -- A returning record structure will be returned.
288 --
289 -- Post Failure:
290 -- No direct error handling is required within this function. Any possible
291 -- errors within this function will be a PL/SQL value error due to conversion
292 -- of datatypes or data lengths.
293 --
294 -- Developer Implementation Notes:
295 -- None.
296 --
297 -- Access Status:
298 -- Internal Development Use Only.
299 --
300 -- {End Of Comments}
301 -- ----------------------------------------------------------------------------
302 Function convert_args
303 (
304 p_finance_line_id in number,
305 p_finance_header_id in number,
306 p_cancelled_flag in varchar2,
307 p_date_raised in date,
308 p_line_type in varchar2,
309 p_object_version_number in number,
310 p_sequence_number in number,
311 p_transfer_status in varchar2,
312 p_comments in varchar2,
313 p_currency_code in varchar2,
314 p_money_amount in number,
315 p_standard_amount in number,
316 p_trans_information_category in varchar2,
317 p_trans_information1 in varchar2,
318 p_trans_information10 in varchar2,
319 p_trans_information11 in varchar2,
320 p_trans_information12 in varchar2,
321 p_trans_information13 in varchar2,
322 p_trans_information14 in varchar2,
323 p_trans_information15 in varchar2,
324 p_trans_information16 in varchar2,
325 p_trans_information17 in varchar2,
326 p_trans_information18 in varchar2,
327 p_trans_information19 in varchar2,
328 p_trans_information2 in varchar2,
329 p_trans_information20 in varchar2,
330 p_trans_information3 in varchar2,
331 p_trans_information4 in varchar2,
332 p_trans_information5 in varchar2,
333 p_trans_information6 in varchar2,
334 p_trans_information7 in varchar2,
335 p_trans_information8 in varchar2,
336 p_trans_information9 in varchar2,
337 p_transfer_date in date,
338 p_transfer_message in varchar2,
339 p_unitary_amount in number,
340 p_booking_deal_id in number,
341 p_booking_id in number,
342 p_resource_allocation_id in number,
343 p_resource_booking_id in number,
344 p_tfl_information_category in varchar2,
345 p_tfl_information1 in varchar2,
346 p_tfl_information2 in varchar2,
347 p_tfl_information3 in varchar2,
348 p_tfl_information4 in varchar2,
349 p_tfl_information5 in varchar2,
350 p_tfl_information6 in varchar2,
351 p_tfl_information7 in varchar2,
352 p_tfl_information8 in varchar2,
353 p_tfl_information9 in varchar2,
354 p_tfl_information10 in varchar2,
355 p_tfl_information11 in varchar2,
356 p_tfl_information12 in varchar2,
357 p_tfl_information13 in varchar2,
358 p_tfl_information14 in varchar2,
359 p_tfl_information15 in varchar2,
360 p_tfl_information16 in varchar2,
361 p_tfl_information17 in varchar2,
362 p_tfl_information18 in varchar2,
363 p_tfl_information19 in varchar2,
364 p_tfl_information20 in varchar2
365 )
366 Return g_rec_type;
367 --
368 end ota_tfl_api_shd;