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