1 Package per_add_upd AUTHID CURRENT_USER as
2 /* $Header: peaddrhi.pkh 120.1 2011/11/15 11:34:33 sidsaxen ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |-----------------------------< convert_defs >-----------------------------|
6 -- ----------------------------------------------------------------------------
7 -- {Start Of Comments}
8 --
9 -- Description:
10 -- The Convert_Defs function 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 private function can only be called from the upd process.
26 --
27 -- In Arguments:
28 -- A Pl/Sql record structre.
29 --
30 -- Post Success:
31 -- The record structure will be returned with all system defaulted argument
32 -- values converted into its current row attribute value.
33 --
34 -- Post Failure:
35 -- No direct error handling is required within this function. Any possible
36 -- errors within this function will be a PL/SQL value error due to conversion
37 -- of datatypes or data lengths.
38 --
39 -- Developer Implementation Notes:
40 -- None.
41 --
42 -- Access Status:
43 -- Internal Table Handler Use Only.
44 --
45 -- {End Of Comments}
46 -- ----------------------------------------------------------------------------
47 Function convert_defs(p_rec in out nocopy per_add_shd.g_rec_type)
48 Return per_add_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 -- p_rec
101 -- Contains the attributes of the address record.
102 -- p_validate_county
103 -- if true, then if the geocodes (VERTEX) data is installed then a US
104 -- address will be validated against it. This is the default behaviour.
105 -- If set to false then region_1 will not be validated.
106 --
107 -- Post Success:
108 -- The specified row will be fully validated and updated for the specified
109 -- entity without being committed. If the p_validate argument has been set
110 -- to true then all the work will be rolled back.
111 -- p_rec.object_version_number will be set with the new object_version_number
112 -- for the address.
113 --
114 -- Post Failure:
115 -- If an error has occurred, an error message will be supplied with the work
116 -- rolled back. A failure will occur if any of the business rules/conditions
117 -- are found:
118 -- 1) All of the mandatory arguments have not been set.
119 -- 2) An attempt is made to update on of the following attributes:
120 -- address_id, business_group_id, person_id and style.
121 -- 3) The p_rec.date_from is greater than p_rec.date_to.
122 -- 4) If the address being updated is a primary address, the new value
123 -- for p_rec.date_from should not leave any non-primary addresses
124 -- without a corresponding primary within the date range.
125 -- 5) The value for p_rec.primary_flag must be in 'Y' or 'N'.
126 -- 6) If the address is updated to a primary address, no other primary
127 -- addresses should exist within the same date range.
128 -- 7) The p_rec.address_type does not exist, or has been disabled, or
129 -- is not currently date effective on hr_lookups.
130 -- 8) The p_rec.country value does exist on fnd_territories.
131 -- 9) The p_rec.date_to value is less than p_rec.date_from.
132 -- 10)If the address being updated is a primary address, the new value
133 -- for p_rec.date_to should not leave any non-primary addresses
134 -- without a corresponding primary within the date range.
135 -- 11)The p_rec.postal_code should not be more than 8 characters long.
136 -- 12)The p_rec.region_1 value should exist on fnd_common_lookups.
137 --
138 -- Access Status:
139 -- Internal Development Use Only.
140 --
141 -- {End Of Comments}
142 -- ----------------------------------------------------------------------------
143 Procedure upd
144 (p_rec in out nocopy per_add_shd.g_rec_type
145 ,p_validate in boolean default false
146 ,p_effective_date in date
147 ,p_prflagval_override in boolean default false
148 ,p_validate_county in boolean default true
149 );
150 --
151 -- ----------------------------------------------------------------------------
152 -- |---------------------------------< upd>-----------------------------------|
153 -- ----------------------------------------------------------------------------
154 -- {Start Of Comments}
155 --
156 -- Description:
157 -- This procedure is the attribute interface for the update business
158 -- process for the specified entity and is the outermost layer. The role
159 -- of this process is to update a fully validated row into the HR schema
160 -- passing back to the calling process, any system generated values
161 -- (e.g. object version number attributes).The processing of this
162 -- procedure is as follows:
163 -- 1) The attributes are converted into a local record structure by
164 -- calling the convert_defs function.
165 -- 2) After the conversion has taken place, the corresponding record upd
166 -- interface business process is executed.
167 -- 3) OUT arguments are then set to their corresponding record arguments.
168 --
169 -- Pre Conditions:
170 -- None
171 --
172 -- In Arguments:
173 -- p_validate
174 -- Determines if the business process is to be validated. Setting this
175 -- Boolean value to true will invoke the process to be validated.
176 -- The default is false.
177 -- p_validate_county
178 -- if true, then if the geocodes (VERTEX) data is installed then a US
179 -- address will be validated against it. This is the default behaviour.
180 -- If set to false then region_1 will not be validated.
181 --
182 -- Post Success:
183 -- A fully validated row will be updated for the specified entity
184 -- without being committed (or rollbacked depending on the p_validate
185 -- status).
186 -- p_object_version_number will be set with the new object_version_number
187 -- for the address.
188 --
189 -- Post Failure:
190 -- If an error has occurred, an error message will be supplied with the work
191 -- rolled back. Refer to the upd record interface for details of possible
192 -- failures.
193 --
194 -- Access Status:
195 -- Internal Development Use Only.
196 --
197 -- {End Of Comments}
198 -- ----------------------------------------------------------------------------
199 Procedure upd
200 (p_address_id in number
201 ,p_business_group_id in number default hr_api.g_number
202 ,p_person_id in number default hr_api.g_number
203 -- 70.2 change start.
204 ,p_date_from in date default hr_api.g_date
205 -- 70.2 change end.
206 -- Start of fix for Bug #2431588
207 ,p_primary_flag in varchar2 default hr_api.g_varchar2
208 -- End of fix for Bug #2431588
209 ,p_address_line1 in varchar2 default hr_api.g_varchar2
210 ,p_address_line2 in varchar2 default hr_api.g_varchar2
211 ,p_address_line3 in varchar2 default hr_api.g_varchar2
212 ,p_address_type in varchar2 default hr_api.g_varchar2
213 ,p_comments in clob default hr_api.g_varchar2 -- Bug#13362792
214 ,p_country in varchar2 default hr_api.g_varchar2
215 ,p_date_to in date default hr_api.g_date
216 ,p_postal_code in varchar2 default hr_api.g_varchar2
217 ,p_region_1 in varchar2 default hr_api.g_varchar2
218 ,p_region_2 in varchar2 default hr_api.g_varchar2
219 ,p_region_3 in varchar2 default hr_api.g_varchar2
220 ,p_telephone_number_1 in varchar2 default hr_api.g_varchar2
221 ,p_telephone_number_2 in varchar2 default hr_api.g_varchar2
222 ,p_telephone_number_3 in varchar2 default hr_api.g_varchar2
223 ,p_town_or_city in varchar2 default hr_api.g_varchar2
224 ,p_request_id in number default hr_api.g_number
225 ,p_program_application_id in number default hr_api.g_number
226 ,p_program_id in number default hr_api.g_number
227 ,p_program_update_date in date default hr_api.g_date
228 ,p_addr_attribute_category in varchar2 default hr_api.g_varchar2
229 ,p_addr_attribute1 in varchar2 default hr_api.g_varchar2
230 ,p_addr_attribute2 in varchar2 default hr_api.g_varchar2
231 ,p_addr_attribute3 in varchar2 default hr_api.g_varchar2
232 ,p_addr_attribute4 in varchar2 default hr_api.g_varchar2
233 ,p_addr_attribute5 in varchar2 default hr_api.g_varchar2
234 ,p_addr_attribute6 in varchar2 default hr_api.g_varchar2
235 ,p_addr_attribute7 in varchar2 default hr_api.g_varchar2
236 ,p_addr_attribute8 in varchar2 default hr_api.g_varchar2
237 ,p_addr_attribute9 in varchar2 default hr_api.g_varchar2
238 ,p_addr_attribute10 in varchar2 default hr_api.g_varchar2
239 ,p_addr_attribute11 in varchar2 default hr_api.g_varchar2
240 ,p_addr_attribute12 in varchar2 default hr_api.g_varchar2
241 ,p_addr_attribute13 in varchar2 default hr_api.g_varchar2
242 ,p_addr_attribute14 in varchar2 default hr_api.g_varchar2
243 ,p_addr_attribute15 in varchar2 default hr_api.g_varchar2
244 ,p_addr_attribute16 in varchar2 default hr_api.g_varchar2
245 ,p_addr_attribute17 in varchar2 default hr_api.g_varchar2
246 ,p_addr_attribute18 in varchar2 default hr_api.g_varchar2
247 ,p_addr_attribute19 in varchar2 default hr_api.g_varchar2
248 ,p_addr_attribute20 in varchar2 default hr_api.g_varchar2
249 ,p_add_information13 in varchar2 default hr_api.g_varchar2
250 ,p_add_information14 in varchar2 default hr_api.g_varchar2
251 ,p_add_information15 in varchar2 default hr_api.g_varchar2
252 ,p_add_information16 in varchar2 default hr_api.g_varchar2
253 ,p_add_information17 in varchar2 default hr_api.g_varchar2
254 ,p_add_information18 in varchar2 default hr_api.g_varchar2
255 ,p_add_information19 in varchar2 default hr_api.g_varchar2
256 ,p_add_information20 in varchar2 default hr_api.g_varchar2
257 ,p_object_version_number in out nocopy number
258 ,p_party_id in number default hr_api.g_number
259 ,p_validate in boolean default false
260 ,p_effective_date in date
261 ,p_prflagval_override in boolean default false
262 ,p_validate_county in boolean default true
263 ,p_style in varchar2 default hr_api.g_varchar2
264 );
265 --
266 end per_add_upd;