1 Package ghr_prh_shd AUTHID CURRENT_USER as
2 /* $Header: ghprhrhi.pkh 120.1.12020000.2 2012/07/11 09:30:41 vmididho ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (
10 pa_routing_history_id number(15),
11 pa_request_id number(15),
12 attachment_modified_flag varchar2(9),
13 initiator_flag varchar2(9),
14 approver_flag varchar2(9),
15 reviewer_flag varchar2(9),
16 requester_flag varchar2(9),
17 authorizer_flag varchar2(9),
18 personnelist_flag varchar2(9),
19 approved_flag varchar2(9),
20 user_name varchar2(100), --BUG# 13655849
21 user_name_employee_id number(10),
22 user_name_emp_first_name varchar2(150),
23 user_name_emp_last_name varchar2(150),
24 user_name_emp_middle_names varchar2(60),
25 notepad varchar2(2000),
26 action_taken varchar2(30),
27 groupbox_id number(15),
28 routing_list_id number(15),
29 routing_seq_number number(15),--
30 noa_family_code varchar2(30),
31 nature_of_action_id number(15),
32 second_nature_of_action_id number(15),
33 approval_Status varchar2(30),
34 date_notification_sent date,
35 object_version_number number(9)
36 );
37 --
38 -- ----------------------------------------------------------------------------
39 -- | Global Definitions - Internal Development Use Only |
40 -- ----------------------------------------------------------------------------
41 --
42 g_old_rec g_rec_type; -- Global record definition
43 --
44 -- ----------------------------------------------------------------------------
45 -- |---------------------------< constraint_error >---------------------------|
46 -- ----------------------------------------------------------------------------
47 -- {Start Of Comments}
48 --
49 -- Description:
50 -- This procedure is called when a constraint has been violated (i.e.
51 -- The exception hr_api.check_integrity_violated,
52 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
53 -- hr_api.unique_integrity_violated has been raised).
54 -- The exceptions can only be raised as follows:
55 -- 1) A check constraint can only be violated during an INSERT or UPDATE
56 -- dml operation.
57 -- 2) A parent integrity constraint can only be violated during an
58 -- INSERT or UPDATE dml operation.
59 -- 3) A child integrity constraint can only be violated during an
60 -- DELETE dml operation.
61 -- 4) A unique integrity constraint can only be violated during INSERT or
62 -- UPDATE dml operation.
63 --
64 -- Pre Conditions:
65 -- 1) Either hr_api.check_integrity_violated,
66 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
67 -- hr_api.unique_integrity_violated has been raised with the subsequent
68 -- stripping of the constraint name from the generated error message
69 -- text.
70 -- 2) Standalone validation test which corresponds with a constraint error.
71 --
72 -- In Parameter:
73 -- p_constraint_name is in upper format and is just the constraint name
74 -- (e.g. not prefixed by brackets, schema owner etc).
75 --
76 -- Post Success:
77 -- Development dependant.
78 --
79 -- Post Failure:
80 -- Developement dependant.
81 --
82 -- Developer Implementation Notes:
83 -- For each constraint being checked the hr system package failure message
84 -- has been generated as a template only. These system error messages should
85 -- be modified as required (i.e. change the system failure message to a user
86 -- friendly defined error message).
87 --
88 -- Access Status:
89 -- Internal Development Use Only.
90 --
91 -- {End Of Comments}
92 -- ----------------------------------------------------------------------------
93 Procedure constraint_error
94 (p_constraint_name in all_constraints.constraint_name%TYPE);
95 --
96 -- ----------------------------------------------------------------------------
97 -- |-----------------------------< api_updating >-----------------------------|
98 -- ----------------------------------------------------------------------------
99 -- {Start Of Comments}
100 --
101 -- Description:
102 -- This function is used to populate the g_old_rec record with the
103 -- current row from the database for the specified primary key
104 -- provided that the primary key exists and is valid and does not
105 -- already match the current g_old_rec. The function will always return
106 -- a TRUE value if the g_old_rec is populated with the current row.
107 -- A FALSE value will be returned if all of the primary key arguments
108 -- are null.
109 --
110 -- Pre Conditions:
111 -- None.
112 --
113 -- In Parameters:
114 --
115 -- Post Success:
116 -- A value of TRUE will be returned indiciating that the g_old_rec
117 -- is current.
118 -- A value of FALSE will be returned if all of the primary key arguments
119 -- have a null value (this indicates that the row has not be inserted into
120 -- the Schema), and therefore could never have a corresponding row.
121 --
122 -- Post Failure:
123 -- A failure can only occur under two circumstances:
124 -- 1) The primary key is invalid (i.e. a row does not exist for the
125 -- specified primary key values).
126 -- 2) If an object_version_number exists but is NOT the same as the current
127 -- g_old_rec value.
128 --
129 -- Developer Implementation Notes:
130 -- None.
131 --
132 -- Access Status:
133 -- Internal Development Use Only.
134 --
135 -- {End Of Comments}
136 -- ----------------------------------------------------------------------------
137 Function api_updating
138 (
139 p_pa_routing_history_id in number,
140 p_object_version_number in number
141 )Return Boolean;
142 --
143 -- ----------------------------------------------------------------------------
144 -- |---------------------------------< lck >----------------------------------|
145 -- ----------------------------------------------------------------------------
146 -- {Start Of Comments}
147 --
148 -- Description:
149 -- The Lck process has two main functions to perform. Firstly, the row to be
150 -- updated or deleted must be locked. The locking of the row will only be
151 -- successful if the row is not currently locked by another user.
152 -- Secondly, during the locking of the row, the row is selected into
153 -- the g_old_rec data structure which enables the current row values from the
154 -- server to be available to the api.
155 --
156 -- Pre Conditions:
157 -- When attempting to call the lock the object version number (if defined)
158 -- is mandatory.
159 --
160 -- In Parameters:
161 -- The arguments to the Lck process are the primary key(s) which uniquely
162 -- identify the row and the object version number of row.
163 --
164 -- Post Success:
165 -- On successful completion of the Lck process the row to be updated or
166 -- deleted will be locked and selected into the global data structure
167 -- g_old_rec.
168 --
169 -- Post Failure:
170 -- The Lck process can fail for three reasons:
171 -- 1) When attempting to lock the row the row could already be locked by
172 -- another user. This will raise the HR_Api.Object_Locked exception.
173 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
174 -- This error is trapped and reported using the message name
175 -- 'HR_7220_INVALID_PRIMARY_KEY'.
176 -- 3) The row although existing in the HR Schema has a different object
177 -- version number than the object version number specified.
178 -- This error is trapped and reported using the message name
179 -- 'HR_7155_OBJECT_INVALID'.
180 --
181 -- Developer Implementation Notes:
182 -- For each primary key and the object version number arguments add a
183 -- call to hr_api.mandatory_arg_error procedure to ensure that these
184 -- argument values are not null.
185 --
186 -- Access Status:
187 -- Internal Development Use Only.
188 --
189 -- {End Of Comments}
190 -- ----------------------------------------------------------------------------
191 Procedure lck
192 (
193 p_pa_routing_history_id in number,
194 p_object_version_number in number
195 );
196 --
197 -- ----------------------------------------------------------------------------
198 -- |-----------------------------< convert_args >-----------------------------|
199 -- ----------------------------------------------------------------------------
200 -- {Start Of Comments}
201 --
202 -- Description:
203 -- This function is used to turn attribute parameters into the record
204 -- structure parameter g_rec_type.
205 --
206 -- Pre Conditions:
207 -- This is a private function and can only be called from the ins or upd
208 -- attribute processes.
209 --
210 -- In Parameters:
211 --
212 -- Post Success:
213 -- A returning record structure will be returned.
214 --
215 -- Post Failure:
216 -- No direct error handling is required within this function. Any possible
217 -- errors within this function will be a PL/SQL value error due to conversion
218 -- of datatypes or data lengths.
219 --
220 -- Developer Implementation Notes:
221 -- None.
222 --
223 -- Access Status:
224 -- Internal Table Handler Use Only.
225 --
226 -- {End Of Comments}
227 -- ----------------------------------------------------------------------------
228 Function convert_args
229 (
230 p_pa_routing_history_id in number,
231 p_pa_request_id in number,
232 p_attachment_modified_flag in varchar2,
233 p_initiator_flag in varchar2,
234 p_approver_flag in varchar2,
235 p_reviewer_flag in varchar2,
236 p_requester_flag in varchar2,
237 p_authorizer_flag in varchar2,
238 p_personnelist_flag in varchar2,
239 p_approved_flag in varchar2,
240 p_user_name in varchar2,
241 p_user_name_employee_id in number,
242 p_user_name_emp_first_name in varchar2,
243 p_user_name_emp_last_name in varchar2,
244 p_user_name_emp_middle_names in varchar2,
245 p_notepad in varchar2,
246 p_action_taken in varchar2,
247 p_groupbox_id in number,
248 p_routing_list_id in number,
249 p_routing_seq_number in number,
250 p_noa_family_code in varchar2,
251 p_nature_of_action_id in number,
252 p_second_nature_of_action_id in number,
253 p_approval_status in varchar2,
254 p_date_notification_sent in date,
255 p_object_version_number in number
256 )Return g_rec_type;
257 --
258 end ghr_prh_shd;