1 Package hr_trn_shd as
2 /* $Header: hrtrnrhi.pkh 120.1 2005/06/24 16:35:50 svittal noship $ */
3
4 --
5 -- ----------------------------------------------------------------------------
6 -- | Global Record Type Specification |
7 -- ----------------------------------------------------------------------------
8 --
9 -- Extended the global structure to accomodate extra columns
10
11 Type g_rec_type Is Record
12 (
13 transaction_id number(15),
14 creator_person_id number(15),
15 transaction_privilege varchar2(30),
16 product_code varchar2(15),
17 url varchar2(4000),
18 status varchar2(10),
19 transaction_state varchar2(10), --ns
20 section_display_name varchar2(500),
21 function_id number,
22 transaction_ref_table varchar2(100),
23 transaction_ref_id number,
24 transaction_type varchar2(10),
25 assignment_id number,
26 api_addtnl_info varchar2(1000),
27 selected_person_id number,
28 item_type varchar2(10),
29 item_key varchar2(240),
30 transaction_effective_date date,
31 process_name varchar2(30),
32 plan_id number,
33 rptg_grp_id number,
34 effective_date_option varchar2(10),
35 creator_role varchar2(320),
36 last_update_role varchar2(320),
37 parent_transaction_id number(15),
38 relaunch_function varchar2(30),
39 transaction_group varchar2(60),
40 transaction_identifier varchar2(60),
41 transaction_document CLOB
42 );
43 -- plan_id, rptg_grp_id, effective_date_option added by sanej
44 --
45 -- ----------------------------------------------------------------------------
46 -- | Global Definitions - Internal Development Use Only |
47 -- ----------------------------------------------------------------------------
48 --
49 g_old_rec g_rec_type; -- Global record definition
50 g_api_dml boolean; -- Global api dml status
51 --
52 -- ----------------------------------------------------------------------------
53 -- |------------------------< return_api_dml_status >-------------------------|
54 -- ----------------------------------------------------------------------------
55 -- {Start Of Comments}
56 --
57 -- Description:
58 -- This function will return the current g_api_dml private global
59 -- boolean status.
60 -- The g_api_dml status determines if at the time of the function
61 -- being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
62 -- is being issued from within an api.
63 -- If the status is TRUE then a dml statement is being issued from
64 -- within this entity api.
65 -- This function is primarily to support database triggers which
66 -- need to maintain the object_version_number for non-supported
67 -- dml statements (i.e. dml statement issued outside of the api layer).
68 --
69 -- Pre Conditions:
70 -- None.
71 --
72 -- In Parameters:
73 -- None.
74 --
75 -- Post Success:
76 -- Processing continues.
77 -- If the function returns a TRUE value then, dml is being executed from
78 -- within this api.
79 --
80 -- Post Failure:
81 -- None.
82 --
83 -- Access Status:
84 -- Internal Table Handler Use Only.
85 --
86 -- {End Of Comments}
87 -- ----------------------------------------------------------------------------
88 Function return_api_dml_status Return Boolean;
89 --
90 -- ----------------------------------------------------------------------------
91 -- |---------------------------< constraint_error >---------------------------|
92 -- ----------------------------------------------------------------------------
93 -- {Start Of Comments}
94 --
95 -- Description:
96 -- This procedure is called when a constraint has been violated (i.e.
97 -- The exception hr_api.check_integrity_violated,
98 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
99 -- hr_api.unique_integrity_violated has been raised).
100 -- The exceptions can only be raised as follows:
101 -- 1) A check constraint can only be violated during an INSERT or UPDATE
102 -- dml operation.
103 -- 2) A parent integrity constraint can only be violated during an
104 -- INSERT or UPDATE dml operation.
105 -- 3) A child integrity constraint can only be violated during an
106 -- DELETE dml operation.
107 -- 4) A unique integrity constraint can only be violated during INSERT or
108 -- UPDATE dml operation.
109 --
110 -- Pre Conditions:
111 -- 1) Either hr_api.check_integrity_violated,
112 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
113 -- hr_api.unique_integrity_violated has been raised with the subsequent
114 -- stripping of the constraint name from the generated error message
115 -- text.
116 -- 2) Standalone validation test which corresponds with a constraint error.
117 --
118 -- In Parameter:
119 -- p_constraint_name is in upper format and is just the constraint name
120 -- (e.g. not prefixed by brackets, schema owner etc).
121 --
122 -- Post Success:
123 -- Development dependant.
124 --
125 -- Post Failure:
126 -- Developement dependant.
127 --
128 -- Developer Implementation Notes:
129 -- For each constraint being checked the hr system package failure message
130 -- has been generated as a template only. These system error messages should
131 -- be modified as required (i.e. change the system failure message to a user
132 -- friendly defined error message).
133 --
134 -- Access Status:
135 -- Internal Development Use Only.
136 --
137 -- {End Of Comments}
138 -- ----------------------------------------------------------------------------
139 Procedure constraint_error
140 (p_constraint_name in all_constraints.constraint_name%TYPE);
141 --
142 -- ----------------------------------------------------------------------------
143 -- |-----------------------------< api_updating >-----------------------------|
144 -- ----------------------------------------------------------------------------
145 -- {Start Of Comments}
146 --
147 -- Description:
148 -- This function is used to populate the g_old_rec record with the
149 -- current row from the database for the specified primary key
150 -- provided that the primary key exists and is valid and does not
151 -- already match the current g_old_rec. The function will always return
152 -- a TRUE value if the g_old_rec is populated with the current row.
153 -- A FALSE value will be returned if all of the primary key arguments
154 -- are null.
155 --
156 -- Pre Conditions:
157 -- None.
158 --
159 -- In Parameters:
160 --
161 -- Post Success:
162 -- A value of TRUE will be returned indiciating that the g_old_rec
163 -- is current.
164 -- A value of FALSE will be returned if all of the primary key arguments
165 -- have a null value (this indicates that the row has not be inserted into
166 -- the Schema), and therefore could never have a corresponding row.
167 --
168 -- Post Failure:
169 -- A failure can only occur under two circumstances:
170 -- 1) The primary key is invalid (i.e. a row does not exist for the
171 -- specified primary key values).
172 -- 2) If an object_version_number exists but is NOT the same as the current
173 -- g_old_rec value.
174 --
175 -- Developer Implementation Notes:
176 -- None.
177 --
178 -- Access Status:
179 -- Internal Development Use Only.
180 --
181 -- {End Of Comments}
182 -- ----------------------------------------------------------------------------
183 Function api_updating
184 (
185 p_transaction_id in number
186 ) Return Boolean;
187 --
188 -- ----------------------------------------------------------------------------
189 -- |---------------------------------< lck >----------------------------------|
190 -- ----------------------------------------------------------------------------
191 -- {Start Of Comments}
192 --
193 -- Description:
194 -- The Lck process has two main functions to perform. Firstly, the row to be
195 -- updated or deleted must be locked. The locking of the row will only be
196 -- successful if the row is not currently locked by another user.
197 -- Secondly, during the locking of the row, the row is selected into
198 -- the g_old_rec data structure which enables the current row values from the
199 -- server to be available to the api.
200 --
201 -- Pre Conditions:
202 -- When attempting to call the lock the object version number (if defined)
203 -- is mandatory.
204 --
205 -- In Parameters:
206 -- The arguments to the Lck process are the primary key(s) which uniquely
207 -- identify the row and the object version number of row.
208 --
209 -- Post Success:
210 -- On successful completion of the Lck process the row to be updated or
211 -- deleted will be locked and selected into the global data structure
212 -- g_old_rec.
213 --
214 -- Post Failure:
215 -- The Lck process can fail for three reasons:
216 -- 1) When attempting to lock the row the row could already be locked by
217 -- another user. This will raise the HR_Api.Object_Locked exception.
218 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
219 -- This error is trapped and reported using the message name
220 -- 'HR_7220_INVALID_PRIMARY_KEY'.
221 -- 3) The row although existing in the HR Schema has a different object
222 -- version number than the object version number specified.
223 -- This error is trapped and reported using the message name
224 -- 'HR_7155_OBJECT_INVALID'.
225 --
226 -- Developer Implementation Notes:
227 -- For each primary key and the object version number arguments add a
228 -- call to hr_api.mandatory_arg_error procedure to ensure that these
229 -- argument values are not null.
230 --
231 -- Access Status:
232 -- Internal Development Use Only.
233 --
234 -- {End Of Comments}
235 -- ----------------------------------------------------------------------------
236 Procedure lck
237 (
238 p_transaction_id in number
239 );
240 --
241 -- ----------------------------------------------------------------------------
242 -- |-----------------------------< convert_args >-----------------------------|
243 -- ----------------------------------------------------------------------------
244 -- {Start Of Comments}
245 --
246 -- Description:
247 -- This function is used to turn attribute parameters into the record
248 -- structure parameter g_rec_type.
249 --
250 -- Pre Conditions:
251 -- This is a private function and can only be called from the ins or upd
252 -- attribute processes.
253 --
254 -- In Parameters:
255 --
256 -- Post Success:
257 -- A returning record structure will be returned.
258 --
259 -- Post Failure:
260 -- No direct error handling is required within this function. Any possible
261 -- errors within this function will be a PL/SQL value error due to conversion
262 -- of datatypes or data lengths.
263 --
264 -- Developer Implementation Notes:
265 -- None.
266 --
267 -- Access Status:
268 -- Internal Table Handler Use Only.
269 --
270 -- {End Of Comments}
271 -- ----------------------------------------------------------------------------
272 Function convert_args
273 (
274 p_transaction_id in number,
275 p_creator_person_id in number,
276 p_transaction_privilege in varchar2
277 )
278 Return g_rec_type;
279 --
280 -- Overloaded function to accomodate extra columns
281
282 Function convert_args
283 (
284 p_transaction_id in number,
285 p_creator_person_id in number,
286 p_transaction_privilege in varchar2,
287 p_product_code in varchar2,
288 p_url in varchar2,
289 p_status in varchar2,
290 p_transaction_state in varchar2, --ns
291 p_section_display_name in varchar2,
292 p_function_id in number,
293 p_transaction_ref_table in varchar2,
294 p_transaction_ref_id in number,
295 p_transaction_type in varchar2,
296 p_assignment_id in number,
297 p_api_addtnl_info in varchar2,
298 p_selected_person_id in number,
299 p_item_type in varchar2,
300 p_item_key in varchar2,
301 p_transaction_effective_date in date,
302 p_process_name in varchar2,
303 p_plan_id in number,
304 p_rptg_grp_id in number,
305 p_effective_date_option in varchar2,
306 p_creator_role in varchar2,
307 p_last_update_role in varchar2,
308 p_parent_transaction_id in number,
309 p_relaunch_function in varchar2,
310 p_transaction_group in varchar2,
311 p_transaction_identifier in varchar2,
312 p_transaction_document in CLOB
313 )
314 Return g_rec_type;
315 --
316 -- p_plan_id, p_rptg_grp_id, p_effective_date_option added by sanej
317
318 end hr_trn_shd;