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