1 Package per_pma_shd as
2 /* $Header: pepmarhi.pkh 120.2.12010000.1 2008/07/28 05:21:57 appldev ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (appraisal_period_id number(15)
10 ,object_version_number number(15)
11 ,plan_id number(15)
12 ,appraisal_template_id number(15)
13 ,start_date date
14 ,end_date date
15 ,task_start_date date
16 ,task_end_date date
17 ,initiator_code varchar2(30)
18 ,appraisal_system_type varchar2(30)
19 ,appraisal_type varchar2(30)
20 ,appraisal_assmt_status varchar2(30)
21 ,auto_conc_process varchar2(10)
22 ,days_before_task_st_dt number(15)
23 ,attribute_category varchar2(30)
24 ,attribute1 varchar2(150)
25 ,attribute2 varchar2(150)
26 ,attribute3 varchar2(150)
27 ,attribute4 varchar2(150)
28 ,attribute5 varchar2(150)
29 ,attribute6 varchar2(150)
30 ,attribute7 varchar2(150)
31 ,attribute8 varchar2(150)
32 ,attribute9 varchar2(150)
33 ,attribute10 varchar2(150)
34 ,attribute11 varchar2(150)
35 ,attribute12 varchar2(150)
36 ,attribute13 varchar2(150)
37 ,attribute14 varchar2(150)
38 ,attribute15 varchar2(150)
39 ,attribute16 varchar2(150)
40 ,attribute17 varchar2(150)
41 ,attribute18 varchar2(150)
42 ,attribute19 varchar2(150)
43 ,attribute20 varchar2(150)
44 ,attribute21 varchar2(150)
45 ,attribute22 varchar2(150)
46 ,attribute23 varchar2(150)
47 ,attribute24 varchar2(150)
48 ,attribute25 varchar2(150)
49 ,attribute26 varchar2(150)
50 ,attribute27 varchar2(150)
51 ,attribute28 varchar2(150)
52 ,attribute29 varchar2(150)
53 ,attribute30 varchar2(150)
54 );
55 --
56 -- ----------------------------------------------------------------------------
57 -- | Global Definitions - Internal Development Use Only |
58 -- ----------------------------------------------------------------------------
59 --
60 g_old_rec g_rec_type; -- Global record definition
61 -- Global table name
62 g_tab_nam constant varchar2(30) := 'PER_APPRAISAL_PERIODS';
63 --
64 -- ----------------------------------------------------------------------------
65 -- |---------------------------< constraint_error >---------------------------|
66 -- ----------------------------------------------------------------------------
67 -- {Start Of Comments}
68 --
69 -- Description:
70 -- This procedure is called when a constraint has been violated (i.e.
71 -- The exception 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).
74 -- The exceptions can only be raised as follows:
75 -- 1) A check constraint can only be violated during an INSERT or UPDATE
76 -- dml operation.
77 -- 2) A parent integrity constraint can only be violated during an
78 -- INSERT or UPDATE dml operation.
79 -- 3) A child integrity constraint can only be violated during an
80 -- DELETE dml operation.
81 -- 4) A unique integrity constraint can only be violated during INSERT or
82 -- UPDATE dml operation.
83 --
84 -- Prerequisites:
85 -- 1) Either hr_api.check_integrity_violated,
86 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
87 -- hr_api.unique_integrity_violated has been raised with the subsequent
88 -- stripping of the constraint name from the generated error message
89 -- text.
90 -- 2) Standalone validation test which corresponds with a constraint error.
91 --
92 -- In Parameter:
93 -- p_constraint_name is in upper format and is just the constraint name
94 -- (e.g. not prefixed by brackets, schema owner etc).
95 --
96 -- Post Success:
97 -- Development dependant.
98 --
99 -- Post Failure:
100 -- Developement dependant.
101 --
102 -- Developer Implementation Notes:
103 -- For each constraint being checked the hr system package failure message
104 -- has been generated as a template only. These system error messages should
105 -- be modified as required (i.e. change the system failure message to a user
106 -- friendly defined error message).
107 --
108 -- Access Status:
109 -- Internal Development Use Only.
110 --
111 -- {End Of Comments}
112 -- ----------------------------------------------------------------------------
113 Procedure constraint_error
114 (p_constraint_name in all_constraints.constraint_name%TYPE);
115 --
116 -- ----------------------------------------------------------------------------
117 -- |-----------------------------< api_updating >-----------------------------|
118 -- ----------------------------------------------------------------------------
119 -- {Start Of Comments}
120 --
121 -- Description:
122 -- This function is used to populate the g_old_rec record with the
123 -- current row from the database for the specified primary key
124 -- provided that the primary key exists and is valid and does not
125 -- already match the current g_old_rec. The function will always return
126 -- a TRUE value if the g_old_rec is populated with the current row.
127 -- A FALSE value will be returned if all of the primary key arguments
128 -- are null.
129 --
130 -- Prerequisites:
131 -- None.
132 --
133 -- In Parameters:
134 --
135 -- Post Success:
136 -- A value of TRUE will be returned indiciating that the g_old_rec
137 -- is current.
138 -- A value of FALSE will be returned if all of the primary key arguments
139 -- have a null value (this indicates that the row has not be inserted into
140 -- the Schema), and therefore could never have a corresponding row.
141 --
142 -- Post Failure:
143 -- A failure can only occur under two circumstances:
144 -- 1) The primary key is invalid (i.e. a row does not exist for the
145 -- specified primary key values).
146 -- 2) If an object_version_number exists but is NOT the same as the current
147 -- g_old_rec value.
148 --
149 -- Developer Implementation Notes:
150 -- None.
151 --
152 -- Access Status:
153 -- Internal Development Use Only.
154 --
155 -- {End Of Comments}
156 -- ----------------------------------------------------------------------------
157 Function api_updating
158 (p_appraisal_period_id in number
159 ,p_object_version_number in number
160 ) Return Boolean;
161 --
162 -- ----------------------------------------------------------------------------
163 -- |---------------------------------< lck >----------------------------------|
164 -- ----------------------------------------------------------------------------
165 -- {Start of comments}
166 --
167 -- Description:
168 -- The Lck process has two main functions to perform. Firstly, the row to be
169 -- updated or deleted must be locked. The locking of the row will only be
170 -- successful if the row is not currently locked by another user.
171 -- Secondly, during the locking of the row, the row is selected into
172 -- the g_old_rec data structure which enables the current row values from
173 -- the server to be available to the api.
174 --
175 -- Prerequisites:
176 -- When attempting to call the lock the object version number (if defined)
177 -- is mandatory.
178 --
179 -- In Parameters:
180 -- The arguments to the Lck process are the primary key(s) which uniquely
181 -- identify the row and the object version number of row.
182 --
183 -- Post Success:
184 -- On successful completion of the Lck process the row to be updated or
185 -- deleted will be locked and selected into the global data structure
186 -- g_old_rec.
187 --
188 -- Post Failure:
189 -- The Lck process can fail for three reasons:
190 -- 1) When attempting to lock the row the row could already be locked by
191 -- another user. This will raise the HR_Api.Object_Locked exception.
192 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
193 -- This error is trapped and reported using the message name
194 -- 'HR_7220_INVALID_PRIMARY_KEY'.
195 -- 3) The row although existing in the HR Schema has a different object
196 -- version number than the object version number specified.
197 -- This error is trapped and reported using the message name
198 -- 'HR_7155_OBJECT_INVALID'.
199 --
200 -- Developer Implementation Notes:
201 -- For each primary key and the object version number arguments add a
202 -- call to hr_api.mandatory_arg_error procedure to ensure that these
203 -- argument values are not null.
204 --
205 -- Access Status:
206 -- Internal Development Use Only.
207 --
208 -- {End of comments}
209 -- ----------------------------------------------------------------------------
210 Procedure lck
211 (p_appraisal_period_id in number
212 ,p_object_version_number in number
213 );
214 --
215 -- ----------------------------------------------------------------------------
216 -- |-----------------------------< convert_args >-----------------------------|
217 -- ----------------------------------------------------------------------------
218 -- {Start Of Comments}
219 --
220 -- Description:
221 -- This function is used to turn attribute parameters into the record
222 -- structure parameter g_rec_type.
223 --
224 -- Prerequisites:
225 -- This is a private function and can only be called from the ins or upd
226 -- attribute processes.
227 --
228 -- In Parameters:
229 --
230 -- Post Success:
231 -- A returning record structure will be returned.
232 --
233 -- Post Failure:
234 -- No direct error handling is required within this function. Any possible
235 -- errors within this function will be a PL/SQL value error due to
236 -- conversion of datatypes or data lengths.
237 --
238 -- Developer Implementation Notes:
239 -- None.
240 --
241 -- Access Status:
242 -- Internal Row Handler Use Only.
243 --
244 -- {End Of Comments}
245 -- ----------------------------------------------------------------------------
246 Function convert_args
247 (p_appraisal_period_id in number
248 ,p_object_version_number in number
249 ,p_plan_id in number
250 ,p_appraisal_template_id in number
251 ,p_start_date in date
252 ,p_end_date in date
253 ,p_task_start_date in date
254 ,p_task_end_date in date
255 ,p_initiator_code in varchar2
256 ,p_appraisal_system_type in varchar2
257 ,p_appraisal_type in varchar2
258 ,p_appraisal_assmt_status in varchar2
259 ,p_auto_conc_process in varchar2
260 ,p_days_before_task_st_dt in number
261 ,p_attribute_category in varchar2
262 ,p_attribute1 in varchar2
263 ,p_attribute2 in varchar2
264 ,p_attribute3 in varchar2
265 ,p_attribute4 in varchar2
266 ,p_attribute5 in varchar2
267 ,p_attribute6 in varchar2
268 ,p_attribute7 in varchar2
269 ,p_attribute8 in varchar2
270 ,p_attribute9 in varchar2
271 ,p_attribute10 in varchar2
272 ,p_attribute11 in varchar2
273 ,p_attribute12 in varchar2
274 ,p_attribute13 in varchar2
275 ,p_attribute14 in varchar2
276 ,p_attribute15 in varchar2
277 ,p_attribute16 in varchar2
278 ,p_attribute17 in varchar2
279 ,p_attribute18 in varchar2
280 ,p_attribute19 in varchar2
281 ,p_attribute20 in varchar2
282 ,p_attribute21 in varchar2
283 ,p_attribute22 in varchar2
284 ,p_attribute23 in varchar2
285 ,p_attribute24 in varchar2
286 ,p_attribute25 in varchar2
287 ,p_attribute26 in varchar2
288 ,p_attribute27 in varchar2
289 ,p_attribute28 in varchar2
290 ,p_attribute29 in varchar2
291 ,p_attribute30 in varchar2
292 )
293 Return g_rec_type;
294 --
295 end per_pma_shd;