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