4 -- ----------------------------------------------------------------------------
1 Package per_kad_upd AUTHID CURRENT_USER as
2 /* $Header: pekadrhi.pkh 120.1 2011/11/17 09:45:28 sidsaxen ship $ */
3 --
5 -- |---------------------------------< upd >----------------------------------|
6 -- ----------------------------------------------------------------------------
7 -- {Start Of Comments}
8 --
9 -- Description:
10 -- This procedure is the record interface for the update business
11 -- process for the specified entity. The role of this process is
12 -- to update a fully validated row for the HR schema passing back
13 -- to the calling process, any system generated values (e.g.
14 -- object version number attribute). This process is the main
15 -- backbone of the upd business process. The processing of this
16 -- procedure is as follows:
17 -- 1) If the p_validate argument has been set to true then a savepoint
18 -- is issued.
19 -- 2) The row to be updated is then locked and selected into the record
20 -- structure g_old_rec.
21 -- 3) Because on update arguments which are not part of the update do not
22 -- have to be defaulted, we need to build up the updated row by
23 -- converting any system defaulted arguments to their corresponding
24 -- value.
25 -- 4) The controlling validation process update_validate is then executed
26 -- which will execute all private and public validation business rule
27 -- processes.
28 -- 5) The pre_update business process is then executed which enables any
29 -- logic to be processed before the update dml process is executed.
30 -- 6) The update_dml process will physical perform the update dml into the
31 -- specified entity.
32 -- 7) The post_update business process is then executed which enables any
33 -- logic to be processed after the update dml process.
34 -- 8) If the p_validate argument has been set to true an exception is
35 -- raised which is handled and processed by performing a rollback to
36 -- the savepoint which was issued at the beginning of the upd process.
37 --
38 -- Pre Conditions:
39 -- The main arguments to the business process have to be in the record
40 -- format.
41 --
42 -- In Arguments:
43 -- p_validate
44 -- Determines if the business process is to be validated. Setting this
45 -- boolean value to true will invoke the process to be validated. The
46 -- default is false. The validation is controlled by a savepoint and
47 -- rollback mechanism. The savepoint is issued at the beginning of the
48 -- business process and is rollbacked at the end of the business process
49 -- when all the processing has been completed. The rollback is controlled
50 -- by raising and handling the exception hr_api.validate_enabled. We use
51 -- the exception because, by raising the exception with the business
52 -- process, we can exit successfully without having any of the 'OUT'
53 -- arguments being set.
54 -- p_rec
55 -- Contains the attributes of the address record.
56 --
57 -- Post Success:
58 -- The specified row will be fully validated and updated for the specified
59 -- entity without being committed. If the p_validate argument has been set
60 -- to true then all the work will be rolled back.
61 -- p_rec.object_version_number will be set with the new object_version_number
62 -- for the address.
63 --
64 -- Post Failure:
65 -- If an error has occurred, an error message will be supplied with the work
66 -- rolled back. A failure will occur if any of the business rules/conditions
67 -- are found:
68 -- 1) All of the mandatory arguments have not been set.
69 -- 2) An attempt is made to update on of the following attributes:
70 -- address_id, business_group_id, person_id and style.
71 -- 3) The p_rec.date_from is greater than p_rec.date_to.
72 -- 4) If the address being updated is a primary address, the new value
73 -- for p_rec.date_from should not leave any non-primary addresses
74 -- without a corresponding primary within the date range.
75 -- 5) The value for p_rec.primary_flag must be in 'Y' or 'N'.
76 -- 6) If the address is updated to a primary address, no other primary
77 -- addresses should exist within the same date range.
78 -- 7) The p_rec.address_type does not exist, or has been disabled, or
79 -- is not currently date effective on hr_lookups.
83 -- for p_rec.date_to should not leave any non-primary addresses
80 -- 8) The p_rec.country value does exist on fnd_territories.
81 -- 9) The p_rec.date_to value is less than p_rec.date_from.
82 -- 10)If the address being updated is a primary address, the new value
84 -- without a corresponding primary within the date range.
85 -- 11)The p_rec.postal_code should not be more than 8 characters long.
86 -- 12)The p_rec.region_1 value should exist on fnd_common_lookups.
87 --
88 -- Access Status:
89 -- Internal Development Use Only.
90 --
91 -- {End Of Comments}
92 -- ----------------------------------------------------------------------------
93 Procedure upd
94 (p_rec in out nocopy per_kad_shd.g_rec_type
95 ,p_validate in boolean default false
96 ,p_effective_date in date
97 );
98 --
99 -- ----------------------------------------------------------------------------
100 -- |---------------------------------< upd >----------------------------------|
101 -- ----------------------------------------------------------------------------
102 -- {Start Of Comments}
103 --
104 -- Description:
105 -- This procedure is the attribute interface for the update business
106 -- process for the specified entity and is the outermost layer. The role
107 -- of this process is to update a fully validated row into the HR schema
108 -- passing back to the calling process, any system generated values
109 -- (e.g. object version number attributes).The processing of this
110 -- procedure is as follows:
111 -- 1) The attributes are converted into a local record structure by
112 -- calling the convert_defs function.
113 -- 2) After the conversion has taken place, the corresponding record upd
114 -- interface business process is executed.
115 -- 3) OUT arguments are then set to their corresponding record arguments.
116 --
117 -- Pre Conditions:
118 -- None
119 --
120 -- In Arguments:
121 -- p_validate
122 -- Determines if the business process is to be validated. Setting this
123 -- Boolean value to true will invoke the process to be validated.
124 -- The default is false.
125 --
126 -- Post Success:
127 -- A fully validated row will be updated for the specified entity
128 -- without being committed (or rollbacked depending on the p_validate
129 -- status).
130 -- p_object_version_number will be set with the new object_version_number
131 -- for the address.
132 --
133 -- Post Failure:
134 -- If an error has occurred, an error message will be supplied with the work
135 -- rolled back. Refer to the upd record interface for details of possible
136 -- failures.
137 --
138 -- Access Status:
139 -- Internal Development Use Only.
140 --
141 -- {End Of Comments}
142 -- ----------------------------------------------------------------------------
143 Procedure upd
144 (p_address_id in number
145 -- 70.2 change start.
146 ,p_date_from in date default hr_api.g_date
147 -- 70.2 change end.
148 ,p_address_line1 in varchar2 default hr_api.g_varchar2
149 ,p_address_line2 in varchar2 default hr_api.g_varchar2
150 ,p_address_line3 in varchar2 default hr_api.g_varchar2
151 ,p_address_type in varchar2 default hr_api.g_varchar2
152 ,p_comments in clob default hr_api.g_varchar2
153 ,p_country in varchar2 default hr_api.g_varchar2
154 ,p_date_to in date default hr_api.g_date
155 ,p_postal_code in varchar2 default hr_api.g_varchar2
156 ,p_region_1 in varchar2 default hr_api.g_varchar2
157 ,p_region_2 in varchar2 default hr_api.g_varchar2
158 ,p_region_3 in varchar2 default hr_api.g_varchar2
159 ,p_telephone_number_1 in varchar2 default hr_api.g_varchar2
160 ,p_telephone_number_2 in varchar2 default hr_api.g_varchar2
161 ,p_telephone_number_3 in varchar2 default hr_api.g_varchar2
162 ,p_town_or_city in varchar2 default hr_api.g_varchar2
163 ,p_request_id in number default hr_api.g_number
164 ,p_program_application_id in number default hr_api.g_number
165 ,p_program_id in number default hr_api.g_number
166 ,p_program_update_date in date default hr_api.g_date
167 ,p_addr_attribute_category in varchar2 default hr_api.g_varchar2
168 ,p_addr_attribute1 in varchar2 default hr_api.g_varchar2
169 ,p_addr_attribute2 in varchar2 default hr_api.g_varchar2
170 ,p_addr_attribute3 in varchar2 default hr_api.g_varchar2
171 ,p_addr_attribute4 in varchar2 default hr_api.g_varchar2
172 ,p_addr_attribute5 in varchar2 default hr_api.g_varchar2
173 ,p_addr_attribute6 in varchar2 default hr_api.g_varchar2
174 ,p_addr_attribute7 in varchar2 default hr_api.g_varchar2
175 ,p_addr_attribute8 in varchar2 default hr_api.g_varchar2
176 ,p_addr_attribute9 in varchar2 default hr_api.g_varchar2
177 ,p_addr_attribute10 in varchar2 default hr_api.g_varchar2
178 ,p_addr_attribute11 in varchar2 default hr_api.g_varchar2
179 ,p_addr_attribute12 in varchar2 default hr_api.g_varchar2
180 ,p_addr_attribute13 in varchar2 default hr_api.g_varchar2
181 ,p_addr_attribute14 in varchar2 default hr_api.g_varchar2
185 ,p_addr_attribute18 in varchar2 default hr_api.g_varchar2
182 ,p_addr_attribute15 in varchar2 default hr_api.g_varchar2
183 ,p_addr_attribute16 in varchar2 default hr_api.g_varchar2
184 ,p_addr_attribute17 in varchar2 default hr_api.g_varchar2
186 ,p_addr_attribute19 in varchar2 default hr_api.g_varchar2
187 ,p_addr_attribute20 in varchar2 default hr_api.g_varchar2
188 ,p_object_version_number in out nocopy number
189 ,p_validate in boolean default false
190 ,p_effective_date in date
191 );
192 --
193 end per_kad_upd;