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