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