1 Package per_cei_shd as
2 /* $Header: peceirhi.pkh 120.1 2006/10/18 09:02:59 grreddy noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (cagr_entitlement_item_id number(15)
10 ,item_name varchar2(80)
11 ,element_type_id number(15)
12 ,input_value_id varchar2(15)
13 ,column_type varchar2(30)
14 ,column_size number(15)
15 ,legislation_code varchar2(30)
16 ,cagr_api_id number(10)
17 ,cagr_api_param_id number(10)
18 ,business_group_id number(15)
19 ,beneficial_rule varchar2(30)
20 ,category_name varchar2(30)
21 ,uom varchar2(30)
22 ,flex_value_set_id number(10)
23 ,beneficial_formula_id number(15)
24 ,object_version_number number(9)
25 ,ben_rule_value_set_id number(10)
26 ,mult_entries_allowed_flag varchar2(30)
27 ,auto_create_entries_flag varchar2(30) -- Added for CEI enhancement
28 ,opt_id number(15));
29 --
30 -- ----------------------------------------------------------------------------
31 -- | Global Definitions - Internal Development Use Only |
32 -- ----------------------------------------------------------------------------
33 --
34 g_old_rec g_rec_type; -- Global record definition
35 --
36 -- ---------------------------------------------------------------------------
37 -- |---------------------< entitlement_item_in_use >-------------------------|
38 -- ---------------------------------------------------------------------------
39 --
40 -- Desciption :
41 --
42 -- Check to see if the entitlement item is being used by a collective
43 -- agreement. If it is then it returns TRUE otherwise it returns FALSE
44 --
45 --
46 -- Pre-conditions :
47 --
48 --
49 -- In Arguments :
50 -- p_cagr_entitlement_item_id
51 -- p_item_name
52 -- p_cagr_api_id
53 --
54 -- Post Success :
55 -- Processing continues
56 --
57 -- Post Failure :
58 -- An application error will be raised and processing is
59 -- terminated
60 --
61 -- Access Status :
62 -- Internal Development Use Only.
63 --
64 -- {End of Comments}
65 --
66 -- ---------------------------------------------------------------------------
67 --
68 FUNCTION entitlement_item_in_use
69 (p_cagr_entitlement_item_id IN per_cagr_entitlement_items.cagr_entitlement_item_id%TYPE)
70 RETURN BOOLEAN;
71 --
72 -- ----------------------------------------------------------------------------
73 -- |---------------------------< constraint_error >---------------------------|
74 -- ----------------------------------------------------------------------------
75 -- {Start Of Comments}
76 --
77 -- Description:
78 -- This procedure is called when a constraint has been violated (i.e.
79 -- The exception hr_api.check_integrity_violated,
80 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
81 -- hr_api.unique_integrity_violated has been raised).
82 -- The exceptions can only be raised as follows:
83 -- 1) A check constraint can only be violated during an INSERT or UPDATE
84 -- dml operation.
85 -- 2) A parent integrity constraint can only be violated during an
86 -- INSERT or UPDATE dml operation.
87 -- 3) A child integrity constraint can only be violated during an
88 -- DELETE dml operation.
89 -- 4) A unique integrity constraint can only be violated during INSERT or
90 -- UPDATE dml operation.
91 --
92 -- Prerequisites:
93 -- 1) Either hr_api.check_integrity_violated,
94 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
95 -- hr_api.unique_integrity_violated has been raised with the subsequent
96 -- stripping of the constraint name from the generated error message
97 -- text.
98 -- 2) Standalone validation test which corresponds with a constraint error.
99 --
100 -- In Parameter:
101 -- p_constraint_name is in upper format and is just the constraint name
102 -- (e.g. not prefixed by brackets, schema owner etc).
103 --
104 -- Post Success:
105 -- Development dependant.
106 --
107 -- Post Failure:
108 -- Developement dependant.
109 --
110 -- Developer Implementation Notes:
111 -- For each constraint being checked the hr system package failure message
112 -- has been generated as a template only. These system error messages should
113 -- be modified as required (i.e. change the system failure message to a user
114 -- friendly defined error message).
115 --
116 -- Access Status:
117 -- Internal Development Use Only.
118 --
119 -- {End Of Comments}
120 -- ----------------------------------------------------------------------------
121 Procedure constraint_error
122 (p_constraint_name in all_constraints.constraint_name%TYPE);
123 --
124 -- ----------------------------------------------------------------------------
125 -- |-----------------------------< api_updating >-----------------------------|
126 -- ----------------------------------------------------------------------------
127 -- {Start Of Comments}
128 --
129 -- Description:
130 -- This function is used to populate the g_old_rec record with the
131 -- current row from the database for the specified primary key
132 -- provided that the primary key exists and is valid and does not
133 -- already match the current g_old_rec. The function will always return
134 -- a TRUE value if the g_old_rec is populated with the current row.
135 -- A FALSE value will be returned if all of the primary key arguments
136 -- are null.
137 --
138 -- Prerequisites:
139 -- None.
140 --
141 -- In Parameters:
142 --
143 -- Post Success:
144 -- A value of TRUE will be returned indiciating that the g_old_rec
145 -- is current.
146 -- A value of FALSE will be returned if all of the primary key arguments
147 -- have a null value (this indicates that the row has not be inserted into
148 -- the Schema), and therefore could never have a corresponding row.
149 --
150 -- Post Failure:
151 -- A failure can only occur under two circumstances:
152 -- 1) The primary key is invalid (i.e. a row does not exist for the
153 -- specified primary key values).
154 -- 2) If an object_version_number exists but is NOT the same as the current
155 -- g_old_rec value.
156 --
157 -- Developer Implementation Notes:
158 -- None.
159 --
160 -- Access Status:
161 -- Internal Development Use Only.
162 --
163 -- {End Of Comments}
164 -- ----------------------------------------------------------------------------
165 Function api_updating
166 (p_cagr_entitlement_item_id in number
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 (p_cagr_entitlement_item_id in number,
219 p_object_version_number in number
220 );
221 --
222 -- ----------------------------------------------------------------------------
223 -- |-----------------------------< convert_args >-----------------------------|
224 -- ----------------------------------------------------------------------------
225 -- {Start Of Comments}
226 --
227 -- Description:
228 -- This function is used to turn attribute parameters into the record
229 -- structure parameter g_rec_type.
230 --
231 -- Prerequisites:
232 -- This is a private function and can only be called from the ins or upd
233 -- attribute processes.
234 --
235 -- In Parameters:
236 --
237 -- Post Success:
238 -- A returning record structure will be returned.
239 --
240 -- Post Failure:
241 -- No direct error handling is required within this function. Any possible
242 -- errors within this function will be a PL/SQL value error due to conversion
243 -- of datatypes or data lengths.
244 --
245 -- Developer Implementation Notes:
246 -- None.
247 --
248 -- Access Status:
249 -- Internal Row Handler Use Only.
250 --
251 -- {End Of Comments}
252 -- ----------------------------------------------------------------------------
253 Function convert_args
254 (p_cagr_entitlement_item_id in number
255 ,p_item_name in varchar2
256 ,p_element_type_id in number
257 ,p_input_value_id in varchar2
258 ,p_column_type in varchar2
259 ,p_column_size in number
260 ,p_legislation_code in varchar2
261 ,p_cagr_api_id in number
262 ,p_cagr_api_param_id in number
263 ,p_business_group_id in number
264 ,p_beneficial_rule in varchar2
265 ,p_category_name in varchar2
266 ,p_uom in varchar2
267 ,p_flex_value_set_id in number
268 ,p_beneficial_formula_id in number
269 ,p_object_version_number in number
270 ,p_ben_rule_value_set_id in number
271 ,p_mult_entries_allowed_flag in varchar2
272 ,p_auto_create_entries_flag in varchar2 -- Added for CEI enhancement
273 ,p_opt_id in number) Return g_rec_type;
274 --
275 end per_cei_shd;