1 Package ben_bdi_shd AUTHID CURRENT_USER as
2 /* $Header: bebdirhi.pkh 120.0.12000000.1 2007/01/19 00:50:01 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (
10 batch_dpnt_id number(15),
11 benefit_action_id number(15),
12 person_id number(15),
13 pgm_id number(15),
14 pl_id number(15),
15 oipl_id number(15),
16 contact_typ_cd varchar2(30),
17 dpnt_person_id number(15),
18 business_group_id number(15),
19 object_version_number varchar2(240),
20 enrt_cvg_strt_dt date,
21 enrt_cvg_thru_dt date,
22 actn_cd varchar2(30)
23 );
24 --
25 -- ----------------------------------------------------------------------------
26 -- | Global Definitions - Internal Development Use Only |
27 -- ----------------------------------------------------------------------------
28 --
29 g_old_rec g_rec_type; -- Global record definition
30 g_api_dml boolean; -- Global api dml status
31 --
32 -- ----------------------------------------------------------------------------
33 -- |------------------------< return_api_dml_status >-------------------------|
34 -- ----------------------------------------------------------------------------
35 -- {Start Of Comments}
36 --
37 -- Description:
38 -- This function will return the current g_api_dml private global
39 -- boolean status.
40 -- The g_api_dml status determines if at the time of the function
41 -- being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
42 -- is being issued from within an api.
43 -- If the status is TRUE then a dml statement is being issued from
44 -- within this entity api.
45 -- This function is primarily to support database triggers which
46 -- need to maintain the object_version_number for non-supported
47 -- dml statements (i.e. dml statement issued outside of the api layer).
48 --
49 -- Prerequisites:
50 -- None.
51 --
52 -- In Parameters:
53 -- None.
54 --
55 -- Post Success:
56 -- Processing continues.
57 -- If the function returns a TRUE value then, dml is being executed from
58 -- within this api.
59 --
60 -- Post Failure:
61 -- None.
62 --
63 -- Access Status:
64 -- Internal Row Handler Use Only.
65 --
66 -- {End Of Comments}
67 -- ----------------------------------------------------------------------------
68 Function return_api_dml_status Return Boolean;
69 --
70 -- ----------------------------------------------------------------------------
71 -- |---------------------------< constraint_error >---------------------------|
72 -- ----------------------------------------------------------------------------
73 -- {Start Of Comments}
74 --
75 -- Description:
76 -- This procedure is called when a constraint has been violated (i.e.
77 -- The exception hr_api.check_integrity_violated,
78 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
79 -- hr_api.unique_integrity_violated has been raised).
80 -- The exceptions can only be raised as follows:
81 -- 1) A check constraint can only be violated during an INSERT or UPDATE
82 -- dml operation.
83 -- 2) A parent integrity constraint can only be violated during an
84 -- INSERT or UPDATE dml operation.
85 -- 3) A child integrity constraint can only be violated during an
86 -- DELETE dml operation.
87 -- 4) A unique integrity constraint can only be violated during INSERT or
88 -- UPDATE dml operation.
89 --
90 -- Prerequisites:
91 -- 1) Either hr_api.check_integrity_violated,
92 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
93 -- hr_api.unique_integrity_violated has been raised with the subsequent
94 -- stripping of the constraint name from the generated error message
95 -- text.
96 -- 2) Standalone validation test which corresponds with a constraint error.
97 --
98 -- In Parameter:
99 -- p_constraint_name is in upper format and is just the constraint name
100 -- (e.g. not prefixed by brackets, schema owner etc).
101 --
102 -- Post Success:
103 -- Development dependant.
104 --
105 -- Post Failure:
106 -- Developement dependant.
107 --
108 -- Developer Implementation Notes:
109 -- For each constraint being checked the hr system package failure message
110 -- has been generated as a template only. These system error messages should
111 -- be modified as required (i.e. change the system failure message to a user
112 -- friendly defined error message).
113 --
114 -- Access Status:
115 -- Internal Development Use Only.
116 --
117 -- {End Of Comments}
118 -- ----------------------------------------------------------------------------
119 Procedure constraint_error
120 (p_constraint_name in all_constraints.constraint_name%TYPE);
121 --
122 -- ----------------------------------------------------------------------------
123 -- |-----------------------------< api_updating >-----------------------------|
124 -- ----------------------------------------------------------------------------
125 -- {Start Of Comments}
126 --
127 -- Description:
128 -- This function is used to populate the g_old_rec record with the
129 -- current row from the database for the specified primary key
130 -- provided that the primary key exists and is valid and does not
131 -- already match the current g_old_rec. The function will always return
132 -- a TRUE value if the g_old_rec is populated with the current row.
133 -- A FALSE value will be returned if all of the primary key arguments
134 -- are null.
135 --
136 -- Prerequisites:
137 -- None.
138 --
139 -- In Parameters:
140 --
141 -- Post Success:
142 -- A value of TRUE will be returned indiciating that the g_old_rec
143 -- is current.
144 -- A value of FALSE will be returned if all of the primary key arguments
145 -- have a null value (this indicates that the row has not be inserted into
146 -- the Schema), and therefore could never have a corresponding row.
147 --
148 -- Post Failure:
149 -- A failure can only occur under two circumstances:
150 -- 1) The primary key is invalid (i.e. a row does not exist for the
151 -- specified primary key values).
152 -- 2) If an object_version_number exists but is NOT the same as the current
153 -- g_old_rec value.
154 --
155 -- Developer Implementation Notes:
156 -- None.
157 --
158 -- Access Status:
159 -- Internal Development Use Only.
160 --
161 -- {End Of Comments}
162 -- ----------------------------------------------------------------------------
163 Function api_updating
164 (
165 p_batch_dpnt_id in number,
166 p_object_version_number in varchar2
167 ) Return Boolean;
168 --
169 -- ----------------------------------------------------------------------------
170 -- |---------------------------------< lck >----------------------------------|
171 -- ----------------------------------------------------------------------------
172 -- {Start Of Comments}
173 --
174 -- Description:
175 -- The Lck process has two main functions to perform. Firstly, the row to be
176 -- updated or deleted must be locked. The locking of the row will only be
177 -- successful if the row is not currently locked by another user.
178 -- Secondly, during the locking of the row, the row is selected into
179 -- the g_old_rec data structure which enables the current row values from the
180 -- server to be available to the api.
181 --
182 -- Prerequisites:
183 -- When attempting to call the lock the object version number (if defined)
184 -- is mandatory.
185 --
186 -- In Parameters:
187 -- The arguments to the Lck process are the primary key(s) which uniquely
188 -- identify the row and the object version number of row.
189 --
190 -- Post Success:
191 -- On successful completion of the Lck process the row to be updated or
192 -- deleted will be locked and selected into the global data structure
193 -- g_old_rec.
194 --
195 -- Post Failure:
196 -- The Lck process can fail for three reasons:
197 -- 1) When attempting to lock the row the row could already be locked by
198 -- another user. This will raise the HR_Api.Object_Locked exception.
199 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
200 -- This error is trapped and reported using the message name
201 -- 'HR_7220_INVALID_PRIMARY_KEY'.
202 -- 3) The row although existing in the HR Schema has a different object
203 -- version number than the object version number specified.
204 -- This error is trapped and reported using the message name
205 -- 'HR_7155_OBJECT_INVALID'.
206 --
207 -- Developer Implementation Notes:
208 -- For each primary key and the object version number arguments add a
209 -- call to hr_api.mandatory_arg_error procedure to ensure that these
210 -- argument values are not null.
211 --
212 -- Access Status:
213 -- Internal Development Use Only.
214 --
215 -- {End Of Comments}
216 -- ----------------------------------------------------------------------------
217 Procedure lck
218 (
219 p_batch_dpnt_id in number,
220 p_object_version_number in varchar2
221 );
222 --
223 -- ----------------------------------------------------------------------------
224 -- |-----------------------------< convert_args >-----------------------------|
225 -- ----------------------------------------------------------------------------
226 -- {Start Of Comments}
227 --
228 -- Description:
229 -- This function is used to turn attribute parameters into the record
230 -- structure parameter g_rec_type.
231 --
232 -- Prerequisites:
233 -- This is a private function and can only be called from the ins or upd
234 -- attribute processes.
235 --
236 -- In Parameters:
237 --
238 -- Post Success:
239 -- A returning record structure will be returned.
240 --
241 -- Post Failure:
242 -- No direct error handling is required within this function. Any possible
243 -- errors within this function will be a PL/SQL value error due to conversion
244 -- of datatypes or data lengths.
245 --
246 -- Developer Implementation Notes:
247 -- None.
248 --
249 -- Access Status:
250 -- Internal Row Handler Use Only.
251 --
252 -- {End Of Comments}
253 -- ----------------------------------------------------------------------------
254 Function convert_args
255 (
256 p_batch_dpnt_id in number,
257 p_benefit_action_id in number,
258 p_person_id in number,
259 p_pgm_id in number,
260 p_pl_id in number,
261 p_oipl_id in number,
262 p_contact_typ_cd in varchar2,
263 p_dpnt_person_id in number,
264 p_business_group_id in number,
265 p_object_version_number in varchar2,
266 p_enrt_cvg_strt_dt in date,
267 p_enrt_cvg_thru_dt in date,
268 p_actn_cd in varchar2
269 )
270 Return g_rec_type;
271 --
272 end ben_bdi_shd;