1 Package per_pat_shd AUTHID CURRENT_USER as
2 /* $Header: pepatrhi.pkh 120.0 2005/09/28 07:38 lsilveir noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (allocated_task_id number(15)
10 ,allocated_checklist_id number(15)
11 ,task_name varchar2(240)
12 ,description varchar2(360)
13 ,performer_orig_system varchar2(240)
14 ,performer_orig_sys_id number(15)
15 ,task_owner_person_id number(15)
16 ,task_sequence number(9)
17 ,target_start_date date
18 ,target_end_date date
19 ,actual_start_date date
20 ,actual_end_date date
21 ,action_url varchar2(1000)
22 ,mandatory_flag varchar2(30)
23 ,status varchar2(60)
24 ,object_version_number number(9)
25 ,attribute_category varchar2(30)
26 ,attribute1 varchar2(150)
27 ,attribute2 varchar2(150)
28 ,attribute3 varchar2(150)
29 ,attribute4 varchar2(150)
30 ,attribute5 varchar2(150)
31 ,attribute6 varchar2(150)
32 ,attribute7 varchar2(150)
33 ,attribute8 varchar2(150)
34 ,attribute9 varchar2(150)
35 ,attribute10 varchar2(150)
36 ,attribute11 varchar2(150)
37 ,attribute12 varchar2(150)
38 ,attribute13 varchar2(150)
39 ,attribute14 varchar2(150)
40 ,attribute15 varchar2(150)
41 ,attribute16 varchar2(150)
42 ,attribute17 varchar2(150)
43 ,attribute18 varchar2(150)
44 ,attribute19 varchar2(150)
45 ,attribute20 varchar2(150)
46 ,information_category varchar2(30)
47 ,information1 varchar2(150)
48 ,information2 varchar2(150)
49 ,information3 varchar2(150)
50 ,information4 varchar2(150)
51 ,information5 varchar2(150)
52 ,information6 varchar2(150)
53 ,information7 varchar2(150)
54 ,information8 varchar2(150)
55 ,information9 varchar2(150)
56 ,information10 varchar2(150)
57 ,information11 varchar2(150)
58 ,information12 varchar2(150)
59 ,information13 varchar2(150)
60 ,information14 varchar2(150)
61 ,information15 varchar2(150)
62 ,information16 varchar2(150)
63 ,information17 varchar2(150)
64 ,information18 varchar2(150)
65 ,information19 varchar2(150)
66 ,information20 varchar2(150)
67 );
68 --
69 -- ----------------------------------------------------------------------------
70 -- | Global Definitions - Internal Development Use Only |
71 -- ----------------------------------------------------------------------------
72 --
73 g_old_rec g_rec_type; -- Global record definition
74 -- Global table name
75 g_tab_nam constant varchar2(30) := 'PER_ALLOCATED_TASKS';
76 --
77 -- ----------------------------------------------------------------------------
78 -- |---------------------------< constraint_error >---------------------------|
79 -- ----------------------------------------------------------------------------
80 -- {Start Of Comments}
81 --
82 -- Description:
83 -- This procedure is called when a constraint has been violated (i.e.
84 -- The exception hr_api.check_integrity_violated,
85 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
86 -- hr_api.unique_integrity_violated has been raised).
87 -- The exceptions can only be raised as follows:
88 -- 1) A check constraint can only be violated during an INSERT or UPDATE
89 -- dml operation.
90 -- 2) A parent integrity constraint can only be violated during an
91 -- INSERT or UPDATE dml operation.
92 -- 3) A child integrity constraint can only be violated during an
93 -- DELETE dml operation.
94 -- 4) A unique integrity constraint can only be violated during INSERT or
95 -- UPDATE dml operation.
96 --
97 -- Prerequisites:
98 -- 1) Either hr_api.check_integrity_violated,
99 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
100 -- hr_api.unique_integrity_violated has been raised with the subsequent
101 -- stripping of the constraint name from the generated error message
102 -- text.
103 -- 2) Standalone validation test which corresponds with a constraint error.
104 --
105 -- In Parameter:
106 -- p_constraint_name is in upper format and is just the constraint name
107 -- (e.g. not prefixed by brackets, schema owner etc).
108 --
109 -- Post Success:
110 -- Development dependant.
111 --
112 -- Post Failure:
113 -- Developement dependant.
114 --
115 -- Developer Implementation Notes:
116 -- For each constraint being checked the hr system package failure message
117 -- has been generated as a template only. These system error messages should
118 -- be modified as required (i.e. change the system failure message to a user
119 -- friendly defined error message).
120 --
121 -- Access Status:
122 -- Internal Development Use Only.
123 --
124 -- {End Of Comments}
125 -- ----------------------------------------------------------------------------
126 Procedure constraint_error
127 (p_constraint_name in all_constraints.constraint_name%TYPE);
128 --
129 -- ----------------------------------------------------------------------------
130 -- |-----------------------------< api_updating >-----------------------------|
131 -- ----------------------------------------------------------------------------
132 -- {Start Of Comments}
133 --
134 -- Description:
135 -- This function is used to populate the g_old_rec record with the
136 -- current row from the database for the specified primary key
137 -- provided that the primary key exists and is valid and does not
138 -- already match the current g_old_rec. The function will always return
139 -- a TRUE value if the g_old_rec is populated with the current row.
140 -- A FALSE value will be returned if all of the primary key arguments
141 -- are null.
142 --
143 -- Prerequisites:
144 -- None.
145 --
146 -- In Parameters:
147 --
148 -- Post Success:
149 -- A value of TRUE will be returned indiciating that the g_old_rec
150 -- is current.
151 -- A value of FALSE will be returned if all of the primary key arguments
152 -- have a null value (this indicates that the row has not be inserted into
153 -- the Schema), and therefore could never have a corresponding row.
154 --
155 -- Post Failure:
156 -- A failure can only occur under two circumstances:
157 -- 1) The primary key is invalid (i.e. a row does not exist for the
158 -- specified primary key values).
159 -- 2) If an object_version_number exists but is NOT the same as the current
160 -- g_old_rec value.
161 --
162 -- Developer Implementation Notes:
163 -- None.
164 --
165 -- Access Status:
166 -- Internal Development Use Only.
167 --
168 -- {End Of Comments}
169 -- ----------------------------------------------------------------------------
170 Function api_updating
171 (p_allocated_task_id in number
172 ,p_object_version_number in number
173 ) Return Boolean;
174 --
175 -- ----------------------------------------------------------------------------
176 -- |---------------------------------< lck >----------------------------------|
177 -- ----------------------------------------------------------------------------
178 -- {Start of comments}
179 --
180 -- Description:
181 -- The Lck process has two main functions to perform. Firstly, the row to be
182 -- updated or deleted must be locked. The locking of the row will only be
183 -- successful if the row is not currently locked by another user.
184 -- Secondly, during the locking of the row, the row is selected into
185 -- the g_old_rec data structure which enables the current row values from
186 -- the server to be available to the api.
187 --
188 -- Prerequisites:
189 -- When attempting to call the lock the object version number (if defined)
190 -- is mandatory.
191 --
192 -- In Parameters:
193 -- The arguments to the Lck process are the primary key(s) which uniquely
194 -- identify the row and the object version number of row.
195 --
196 -- Post Success:
197 -- On successful completion of the Lck process the row to be updated or
198 -- deleted will be locked and selected into the global data structure
199 -- g_old_rec.
200 --
201 -- Post Failure:
202 -- The Lck process can fail for three reasons:
203 -- 1) When attempting to lock the row the row could already be locked by
204 -- another user. This will raise the HR_Api.Object_Locked exception.
205 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
206 -- This error is trapped and reported using the message name
207 -- 'HR_7220_INVALID_PRIMARY_KEY'.
208 -- 3) The row although existing in the HR Schema has a different object
209 -- version number than the object version number specified.
210 -- This error is trapped and reported using the message name
211 -- 'HR_7155_OBJECT_INVALID'.
212 --
213 -- Developer Implementation Notes:
214 -- For each primary key and the object version number arguments add a
215 -- call to hr_api.mandatory_arg_error procedure to ensure that these
216 -- argument values are not null.
217 --
218 -- Access Status:
219 -- Internal Development Use Only.
220 --
221 -- {End of comments}
222 -- ----------------------------------------------------------------------------
223 Procedure lck
224 (p_allocated_task_id in number
225 ,p_object_version_number in number
226 );
227 --
228 -- ----------------------------------------------------------------------------
229 -- |-----------------------------< convert_args >-----------------------------|
230 -- ----------------------------------------------------------------------------
231 -- {Start Of Comments}
232 --
233 -- Description:
234 -- This function is used to turn attribute parameters into the record
235 -- structure parameter g_rec_type.
236 --
237 -- Prerequisites:
238 -- This is a private function and can only be called from the ins or upd
239 -- attribute processes.
240 --
241 -- In Parameters:
242 --
243 -- Post Success:
244 -- A returning record structure will be returned.
245 --
246 -- Post Failure:
247 -- No direct error handling is required within this function. Any possible
248 -- errors within this function will be a PL/SQL value error due to
249 -- conversion of datatypes or data lengths.
250 --
251 -- Developer Implementation Notes:
252 -- None.
253 --
254 -- Access Status:
255 -- Internal Row Handler Use Only.
256 --
257 -- {End Of Comments}
258 -- ----------------------------------------------------------------------------
259 Function convert_args
260 (p_allocated_task_id in number
261 ,p_allocated_checklist_id in number
262 ,p_task_name in varchar2
263 ,p_description in varchar2
264 ,p_performer_orig_system in varchar2
265 ,p_performer_orig_sys_id in number
266 ,p_task_owner_person_id in number
267 ,p_task_sequence in number
268 ,p_target_start_date in date
269 ,p_target_end_date in date
270 ,p_actual_start_date in date
271 ,p_actual_end_date in date
272 ,p_action_url in varchar2
273 ,p_mandatory_flag in varchar2
274 ,p_status in varchar2
275 ,p_object_version_number in number
276 ,p_attribute_category in varchar2
277 ,p_attribute1 in varchar2
278 ,p_attribute2 in varchar2
279 ,p_attribute3 in varchar2
280 ,p_attribute4 in varchar2
281 ,p_attribute5 in varchar2
282 ,p_attribute6 in varchar2
283 ,p_attribute7 in varchar2
284 ,p_attribute8 in varchar2
285 ,p_attribute9 in varchar2
286 ,p_attribute10 in varchar2
287 ,p_attribute11 in varchar2
288 ,p_attribute12 in varchar2
289 ,p_attribute13 in varchar2
290 ,p_attribute14 in varchar2
291 ,p_attribute15 in varchar2
292 ,p_attribute16 in varchar2
293 ,p_attribute17 in varchar2
294 ,p_attribute18 in varchar2
295 ,p_attribute19 in varchar2
296 ,p_attribute20 in varchar2
297 ,p_information_category in varchar2
298 ,p_information1 in varchar2
299 ,p_information2 in varchar2
300 ,p_information3 in varchar2
301 ,p_information4 in varchar2
302 ,p_information5 in varchar2
303 ,p_information6 in varchar2
304 ,p_information7 in varchar2
305 ,p_information8 in varchar2
306 ,p_information9 in varchar2
307 ,p_information10 in varchar2
308 ,p_information11 in varchar2
309 ,p_information12 in varchar2
310 ,p_information13 in varchar2
311 ,p_information14 in varchar2
312 ,p_information15 in varchar2
313 ,p_information16 in varchar2
314 ,p_information17 in varchar2
315 ,p_information18 in varchar2
316 ,p_information19 in varchar2
317 ,p_information20 in varchar2
318 )
319 Return g_rec_type;
320 --
321 end per_pat_shd;