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