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