1 Package ghr_cca_shd as
2 /* $Header: ghccarhi.pkh 120.0 2005/05/29 02:50:17 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (compl_appeal_id number(15)
10 ,complaint_id number(15)
11 ,appeal_date date
12 ,appealed_to varchar2(30) -- Increased length
13 ,reason_for_appeal varchar2(30) -- Increased length
14 ,source_decision_date date
15 ,docket_num varchar2(50)
16 ,org_notified_of_appeal date
17 ,agency_recvd_req_for_files date
18 ,files_due date
19 ,files_forwd date
20 ,agcy_recvd_appellant_brief date
21 ,agency_brief_due date
22 ,appellant_brief_forwd_org date
23 ,org_forwd_brief_to_agency date
24 ,agency_brief_forwd date
25 ,decision_date date
26 ,dec_recvd_by_agency date
27 ,decision varchar2(30) -- Increased length
28 ,dec_forwd_to_org date
29 ,agency_rfr_suspense date
30 ,request_for_rfr date
31 ,rfr_docket_num varchar2(50)
32 ,rfr_requested_by varchar2(30) -- Increased length
33 ,agency_rfr_due date
34 ,rfr_forwd_to_org date
35 ,org_forwd_rfr_to_agency date
36 ,agency_forwd_rfr_ofo date
37 ,rfr_decision varchar2(30) -- Increased length
38 ,rfr_decision_date date
39 ,agency_recvd_rfr_dec date
40 ,rfr_decision_forwd_to_org date
41 ,object_version_number number(15)
42 );
43 --
44 -- ----------------------------------------------------------------------------
45 -- | Global Definitions - Internal Development Use Only |
46 -- ----------------------------------------------------------------------------
47 --
48 g_old_rec g_rec_type; -- Global record definition
49 --
50 -- ----------------------------------------------------------------------------
51 -- |---------------------------< constraint_error >---------------------------|
52 -- ----------------------------------------------------------------------------
53 -- {Start Of Comments}
54 --
55 -- Description:
56 -- This procedure is called when a constraint has been violated (i.e.
57 -- The exception hr_api.check_integrity_violated,
58 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
59 -- hr_api.unique_integrity_violated has been raised).
60 -- The exceptions can only be raised as follows:
61 -- 1) A check constraint can only be violated during an INSERT or UPDATE
62 -- dml operation.
63 -- 2) A parent integrity constraint can only be violated during an
64 -- INSERT or UPDATE dml operation.
65 -- 3) A child integrity constraint can only be violated during an
66 -- DELETE dml operation.
67 -- 4) A unique integrity constraint can only be violated during INSERT or
68 -- UPDATE dml operation.
69 --
70 -- Prerequisites:
71 -- 1) Either hr_api.check_integrity_violated,
72 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
73 -- hr_api.unique_integrity_violated has been raised with the subsequent
74 -- stripping of the constraint name from the generated error message
75 -- text.
76 -- 2) Standalone validation test which corresponds with a constraint error.
77 --
78 -- In Parameter:
79 -- p_constraint_name is in upper format and is just the constraint name
80 -- (e.g. not prefixed by brackets, schema owner etc).
81 --
82 -- Post Success:
83 -- Development dependant.
84 --
85 -- Post Failure:
86 -- Developement dependant.
87 --
88 -- Developer Implementation Notes:
89 -- For each constraint being checked the hr system package failure message
90 -- has been generated as a template only. These system error messages should
91 -- be modified as required (i.e. change the system failure message to a user
92 -- friendly defined error message).
93 --
94 -- Access Status:
95 -- Internal Development Use Only.
96 --
97 -- {End Of Comments}
98 -- ----------------------------------------------------------------------------
99 Procedure constraint_error
100 (p_constraint_name in all_constraints.constraint_name%TYPE);
101 --
102 -- ----------------------------------------------------------------------------
103 -- |-----------------------------< api_updating >-----------------------------|
104 -- ----------------------------------------------------------------------------
105 -- {Start Of Comments}
106 --
107 -- Description:
108 -- This function is used to populate the g_old_rec record with the
109 -- current row from the database for the specified primary key
110 -- provided that the primary key exists and is valid and does not
111 -- already match the current g_old_rec. The function will always return
112 -- a TRUE value if the g_old_rec is populated with the current row.
113 -- A FALSE value will be returned if all of the primary key arguments
114 -- are null.
115 --
116 -- Prerequisites:
117 -- None.
118 --
119 -- In Parameters:
120 --
121 -- Post Success:
122 -- A value of TRUE will be returned indiciating that the g_old_rec
123 -- is current.
124 -- A value of FALSE will be returned if all of the primary key arguments
125 -- have a null value (this indicates that the row has not be inserted into
126 -- the Schema), and therefore could never have a corresponding row.
127 --
128 -- Post Failure:
129 -- A failure can only occur under two circumstances:
130 -- 1) The primary key is invalid (i.e. a row does not exist for the
131 -- specified primary key values).
132 -- 2) If an object_version_number exists but is NOT the same as the current
133 -- g_old_rec value.
134 --
135 -- Developer Implementation Notes:
136 -- None.
137 --
138 -- Access Status:
139 -- Internal Development Use Only.
140 --
141 -- {End Of Comments}
142 -- ----------------------------------------------------------------------------
143 Function api_updating
144 (p_compl_appeal_id in number
145 ,p_object_version_number in number
146 ) Return Boolean;
147 --
148 -- ----------------------------------------------------------------------------
149 -- |---------------------------------< lck >----------------------------------|
150 -- ----------------------------------------------------------------------------
151 -- {Start of comments}
152 --
153 -- Description:
154 -- The Lck process has two main functions to perform. Firstly, the row to be
155 -- updated or deleted must be locked. The locking of the row will only be
156 -- successful if the row is not currently locked by another user.
157 -- Secondly, during the locking of the row, the row is selected into
158 -- the g_old_rec data structure which enables the current row values from
159 -- the server to be available to the api.
160 --
161 -- Prerequisites:
162 -- When attempting to call the lock the object version number (if defined)
163 -- is mandatory.
164 --
165 -- In Parameters:
166 -- The arguments to the Lck process are the primary key(s) which uniquely
167 -- identify the row and the object version number of row.
168 --
169 -- Post Success:
170 -- On successful completion of the Lck process the row to be updated or
171 -- deleted will be locked and selected into the global data structure
172 -- g_old_rec.
173 --
174 -- Post Failure:
175 -- The Lck process can fail for three reasons:
176 -- 1) When attempting to lock the row the row could already be locked by
177 -- another user. This will raise the HR_Api.Object_Locked exception.
178 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
179 -- This error is trapped and reported using the message name
180 -- 'HR_7220_INVALID_PRIMARY_KEY'.
181 -- 3) The row although existing in the HR Schema has a different object
182 -- version number than the object version number specified.
183 -- This error is trapped and reported using the message name
184 -- 'HR_7155_OBJECT_INVALID'.
185 --
186 -- Developer Implementation Notes:
187 -- For each primary key and the object version number arguments add a
188 -- call to hr_api.mandatory_arg_error procedure to ensure that these
189 -- argument values are not null.
190 --
191 -- Access Status:
192 -- Internal Development Use Only.
193 --
194 -- {End of comments}
195 -- ----------------------------------------------------------------------------
196 Procedure lck
197 (p_compl_appeal_id in number
198 ,p_object_version_number in number
199 );
200 --
201 -- ----------------------------------------------------------------------------
202 -- |-----------------------------< convert_args >-----------------------------|
203 -- ----------------------------------------------------------------------------
204 -- {Start Of Comments}
205 --
206 -- Description:
207 -- This function is used to turn attribute parameters into the record
208 -- structure parameter g_rec_type.
209 --
210 -- Prerequisites:
211 -- This is a private function and can only be called from the ins or upd
212 -- attribute processes.
213 --
214 -- In Parameters:
215 --
216 -- Post Success:
217 -- A returning record structure will be returned.
218 --
219 -- Post Failure:
220 -- No direct error handling is required within this function. Any possible
221 -- errors within this function will be a PL/SQL value error due to
222 -- conversion of datatypes or data lengths.
223 --
224 -- Developer Implementation Notes:
225 -- None.
226 --
227 -- Access Status:
228 -- Internal Row Handler Use Only.
229 --
230 -- {End Of Comments}
231 -- ----------------------------------------------------------------------------
232 Function convert_args
233 (p_compl_appeal_id in number
234 ,p_complaint_id in number
235 ,p_appeal_date in date
236 ,p_appealed_to in varchar2
237 ,p_reason_for_appeal in varchar2
238 ,p_source_decision_date in date
239 ,p_docket_num in varchar2
240 ,p_org_notified_of_appeal in date
241 ,p_agency_recvd_req_for_files in date
242 ,p_files_due in date
243 ,p_files_forwd in date
244 ,p_agcy_recvd_appellant_brief in date
245 ,p_agency_brief_due in date
246 ,p_appellant_brief_forwd_org in date
247 ,p_org_forwd_brief_to_agency in date
248 ,p_agency_brief_forwd in date
249 ,p_decision_date in date
250 ,p_dec_recvd_by_agency in date
251 ,p_decision in varchar2
252 ,p_dec_forwd_to_org in date
253 ,p_agency_rfr_suspense in date
254 ,p_request_for_rfr in date
255 ,p_rfr_docket_num in varchar2
256 ,p_rfr_requested_by in varchar2
257 ,p_agency_rfr_due in date
258 ,p_rfr_forwd_to_org in date
259 ,p_org_forwd_rfr_to_agency in date
260 ,p_agency_forwd_rfr_ofo in date
261 ,p_rfr_decision in varchar2
262 ,p_rfr_decision_date in date
263 ,p_agency_recvd_rfr_dec in date
264 ,p_rfr_decision_forwd_to_org in date
265 ,p_object_version_number in number
266 )
267 Return g_rec_type;
268 --
269 end ghr_cca_shd;