1 PACKAGE pay_exa_upd AUTHID CURRENT_USER AS
2 /* $Header: pyexarhi.pkh 115.5 2002/12/10 18:44:35 dsaxby ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |-----------------------------< convert_defs >-----------------------------|
6 -- ----------------------------------------------------------------------------
7 -- {Start Of Comments}
8 --
9 -- Description:
10 -- The Convert_Defs procedure has one very important function:
11 -- It must return the record structure for the row with all system defaulted
12 -- values converted into its corresponding argument value for update. When
13 -- we attempt to update a row through the Upd business process , certain
14 -- arguments can be defaulted which enables flexibility in the calling of
15 -- the upd process (e.g. only attributes which need to be updated need to be
16 -- specified). For the upd business process to determine which attributes
17 -- have NOT been specified we need to check if the argument has a reserved
18 -- system default value. Therefore, for all attributes which have a
19 -- corresponding reserved system default mechanism specified we need to
20 -- check if a system default is being used. If a system default is being
21 -- used then we convert the defaulted value into its corresponding attribute
22 -- value held in the g_old_rec data structure.
23 --
24 -- Pre Conditions:
25 -- This public procedure can only be called from the upd and upd_or_sel
26 -- processes.
27 --
28 -- In Arguments:
29 -- A Pl/Sql record structre.
30 --
31 -- Post Success:
32 -- The record structure will be returned with all system defaulted argument
33 -- values converted into its current row attribute value.
34 --
35 -- Post Failure:
36 -- No direct error handling is required within this function. Any possible
37 -- errors within this function will be a PL/SQL value error due to conversion
38 -- of datatypes or data lengths.
39 --
40 -- Developer Implementation Notes:
41 -- None.
42 --
43 -- Access Status:
44 -- Internal Table Handle Use Only.
45 --
46 -- {End Of Comments}
47 -- ----------------------------------------------------------------------------
48 procedure convert_defs(p_rec in out nocopy pay_exa_shd.g_rec_type);
49 --
50 -- ----------------------------------------------------------------------------
51 -- |---------------------------------< upd >----------------------------------|
52 -- ----------------------------------------------------------------------------
53 -- {Start Of Comments}
54 --
55 -- Description:
56 -- This procedure is the record interface for the update business
57 -- process for the specified entity. The role of this process is
58 -- to update a fully validated row for the HR schema passing back
59 -- to the calling process, any system generated values (e.g.
60 -- object version number attribute). This process is the main
61 -- backbone of the upd business process. The processing of this
62 -- procedure is as follows:
63 -- 1) If the p_validate argument has been set to true then a savepoint
64 -- is issued.
65 -- 2) The row to be updated is then locked and selected into the record
66 -- structure g_old_rec.
67 -- 3) Because on update arguments which are not part of the update do not
68 -- have to be defaulted, we need to build up the updated row by
69 -- converting any system defaulted arguments to their corresponding
70 -- value.
71 -- 4) The controlling validation process update_validate is then executed
72 -- which will execute all private and public validation business rule
73 -- processes.
74 -- 5) The pre_update business process is then executed which enables any
75 -- logic to be processed before the update dml process is executed.
76 -- 6) The update_dml process will physical perform the update dml into the
77 -- specified entity.
78 -- 7) The post_update business process is then executed which enables any
79 -- logic to be processed after the update dml process.
80 -- 8) If the p_validate argument has been set to true an exception is
81 -- raised which is handled and processed by performing a rollback to
82 -- the savepoint which was issued at the beginning of the upd process.
83 --
84 -- Pre Conditions:
85 -- The main arguments to the business process have to be in the record
86 -- format.
87 --
88 -- In Arguments:
89 -- p_validate
90 -- Determines if the business process is to be validated. Setting this
91 -- boolean value to true will invoke the process to be validated. The
92 -- default is false. The validation is controlled by a savepoint and
93 -- rollback mechanism. The savepoint is issued at the beginning of the
94 -- business process and is rollbacked at the end of the business process
95 -- when all the processing has been completed. The rollback is controlled
96 -- by raising and handling the exception hr_api.validate_enabled. We use
97 -- the exception because, by raising the exception with the business
98 -- process, we can exit successfully without having any of the 'OUT'
99 -- arguments being set.
100 --
101 -- Post Success:
102 -- The specified row will be fully validated and updated for the specified
103 -- entity without being committed. If the p_validate argument has been set
104 -- to true then all the work will be rolled back.
105 --
106 -- Post Failure:
107 -- If an error has occurred, an error message will be supplied with the work
108 -- rolled back.
109 --
110 -- Developer Implementation Notes:
111 -- None.
112 --
113 -- Access Status:
114 -- Internal Development Use Only.
115 --
116 -- {End Of Comments}
117 -- ----------------------------------------------------------------------------
118 procedure upd(
119 p_rec in out nocopy pay_exa_shd.g_rec_type
120 ,p_validate in boolean default false
121 );
122 --
123 -- ----------------------------------------------------------------------------
124 -- |---------------------------------< upd >----------------------------------|
125 -- ----------------------------------------------------------------------------
126 -- {Start Of Comments}
127 --
128 -- Description:
129 -- This procedure is the attribute interface for the update business
130 -- process for the specified entity and is the outermost layer. The role
131 -- of this process is to update a fully validated row into the HR schema
132 -- passing back to the calling process, any system generated values
133 -- (e.g. object version number attributes).The processing of this
134 -- procedure is as follows:
135 -- 1) The attributes are converted into a local record structure by
136 -- calling the convert_defs function.
137 -- 2) After the conversion has taken place, the corresponding record upd
138 -- interface business process is executed.
139 -- 3) OUT arguments are then set to their corresponding record arguments.
140 --
141 -- Pre Conditions:
142 --
143 -- In Arguments:
144 -- p_validate
145 -- Determines if the business process is to be validated. Setting this
146 -- Boolean value to true will invoke the process to be validated.
147 -- The default is false.
148 --
149 -- Post Success:
150 -- A fully validated row will be updated for the specified entity
151 -- without being committed (or rollbacked depending on the p_validate
152 -- status).
153 --
154 -- Post Failure:
155 -- If an error has occurred, an error message will be supplied with the work
156 -- rolled back.
157 --
158 -- Developer Implementation Notes:
159 -- None.
160 --
161 -- Access Status:
162 -- Internal Development Use Only.
163 --
164 -- {End Of Comments}
165 -- ----------------------------------------------------------------------------
166 procedure upd(
167 p_external_account_id in number
168 ,p_territory_code in varchar2
169 ,p_prenote_date in date default hr_api.g_date
170 ,p_object_version_number in out nocopy number
171 ,p_validate in boolean default false
172 );
173 --
174 -- ----------------------------------------------------------------------------
175 -- |-------------------------------< upd_or_sel >-----------------------------|
176 -- ----------------------------------------------------------------------------
177 -- {Start Of Comments}
178 --
179 -- Description:
180 -- This procedure controls the processing required to either insert a new
181 -- combination or update the existing one. This procedure has the same
182 -- functionality of pay_exa_ins.ins_or_sel except is has to take into
183 -- account the building of a partially specified interface by making calls
184 -- in convert_args and convert_defs.
185 -- 1. If a combination does not exist a new combination is inserted
186 -- returning the new p_external_account_id and p_object_version_numbers.
187 -- 2. If a combination does exist and the prenote_date is being updated then
188 -- the combination is upodated.
189 -- 3. If a combination exists and is not updating the prenote_date the
190 -- out arguments are set.
191 -- 4. If the segments are null (i.e. a null combination) then the out
192 -- arguments are set to null.
193 --
194 -- Pre Conditions:
195 --
196 -- In Arguments:
197 -- Name Reqd Type Description
198 -- p_segment1 varchar2 External account combination
199 -- key flexfield.
200 -- . . .
201 -- p_segment30 varchar2 External account combination
202 -- key flexfield.
203 -- p_concat_segments varchar2 External account combination
204 -- string, if specified takes
205 -- precedence over segment1...30.
206 -- p_business_group_id number Is specified to enable the
207 -- derivation of the
208 -- id_flex_num within the
209 -- process pay_exa_shd.
210 -- segment_combination_check.
211 -- p_territory_code varchar Territory code to be placed
212 -- on a freshly created
213 -- combination record,
214 -- nb. Once a combination is
215 -- created the territory code
216 -- cannot be updated.
217 -- p_prenote_date date Prenote data on combination,
218 -- updating this causes the
219 -- ovn of the combination to be
220 -- incremented.
221 -- p_validate boolean If true, the database
222 -- remains unchanged.
223 -- If false, then an external
224 -- account will be created in
225 -- the database.
226 -- Post Success:
227 -- If a combination already exists the out arguments are returned.
228 -- If a combination exists and the prenote_date is being updated then
229 -- combination is updated and out arguments returned.
230 -- If a combination does not exist then the combination is inserted into
231 -- the pay_external_accounts table and the out arguments are returned.
232 -- Processing continues.
233 --
234 -- Name Type Description
235 -- p_external_account_id number If p_validate is false,
236 -- this will be the ccid of a
237 -- new of existing external
238 -- account.
239 -- If p_validate is true,
240 -- this will be set to its in
241 -- value.
242 -- p_object_version_number number If p_validate is false,
243 -- this will be set to the
244 -- object version number of
245 -- the external account.
246 -- If p_validate is set to true,
247 -- this will be set to its in
248 -- value.
249 --
250 -- Post Failure:
251 -- This process has no specific error handling and will only error if an
252 -- application error has ocurred at a lower level.
253 --
254 -- Developer Implementation Notes:
255 -- None.
256 --
257 -- Access Status:
258 -- Internal Development Use Only.
259 --
260 -- {End Of Comments}
261 -- ----------------------------------------------------------------------------
262 procedure upd_or_sel(
263 p_segment1 in varchar2 default hr_api.g_varchar2
264 ,p_segment2 in varchar2 default hr_api.g_varchar2
265 ,p_segment3 in varchar2 default hr_api.g_varchar2
266 ,p_segment4 in varchar2 default hr_api.g_varchar2
267 ,p_segment5 in varchar2 default hr_api.g_varchar2
268 ,p_segment6 in varchar2 default hr_api.g_varchar2
269 ,p_segment7 in varchar2 default hr_api.g_varchar2
270 ,p_segment8 in varchar2 default hr_api.g_varchar2
271 ,p_segment9 in varchar2 default hr_api.g_varchar2
272 ,p_segment10 in varchar2 default hr_api.g_varchar2
273 ,p_segment11 in varchar2 default hr_api.g_varchar2
274 ,p_segment12 in varchar2 default hr_api.g_varchar2
275 ,p_segment13 in varchar2 default hr_api.g_varchar2
276 ,p_segment14 in varchar2 default hr_api.g_varchar2
277 ,p_segment15 in varchar2 default hr_api.g_varchar2
278 ,p_segment16 in varchar2 default hr_api.g_varchar2
279 ,p_segment17 in varchar2 default hr_api.g_varchar2
280 ,p_segment18 in varchar2 default hr_api.g_varchar2
281 ,p_segment19 in varchar2 default hr_api.g_varchar2
282 ,p_segment20 in varchar2 default hr_api.g_varchar2
283 ,p_segment21 in varchar2 default hr_api.g_varchar2
284 ,p_segment22 in varchar2 default hr_api.g_varchar2
285 ,p_segment23 in varchar2 default hr_api.g_varchar2
286 ,p_segment24 in varchar2 default hr_api.g_varchar2
287 ,p_segment25 in varchar2 default hr_api.g_varchar2
288 ,p_segment26 in varchar2 default hr_api.g_varchar2
289 ,p_segment27 in varchar2 default hr_api.g_varchar2
290 ,p_segment28 in varchar2 default hr_api.g_varchar2
291 ,p_segment29 in varchar2 default hr_api.g_varchar2
292 ,p_segment30 in varchar2 default hr_api.g_varchar2
293 ,p_concat_segments in varchar2 default null
294 ,p_business_group_id in number
295 -- make territory_code code a mandatory parameter on U interface
296 ,p_territory_code in varchar2
300 ,p_validate in boolean default false
297 ,p_prenote_date in date default hr_api.g_date
298 ,p_external_account_id in out nocopy number
299 ,p_object_version_number in out nocopy number
301 );
302 --
303 END pay_exa_upd;