1 Package pay_app_shd as
2 /* $Header: pyapprhi.pkh 120.2 2006/12/04 13:44:32 abhargav noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (process_parameter_id number(15)
10 ,process_id number(15)
11 ,internal_name varchar2(80)
12 ,data_type varchar2(30)
13 ,enabled_flag varchar2(30)
14 ,object_version_number number(9)
15 );
16 --
17 -- ----------------------------------------------------------------------------
18 -- | Global Definitions - Internal Development Use Only |
19 -- ----------------------------------------------------------------------------
20 --
21 g_old_rec g_rec_type; -- Global record definition
22 -- Global table name
23 g_tab_nam constant varchar2(30) := 'PAY_AU_PROCESS_PARAMETERS';
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 (p_process_parameter_id in number
159 ,p_object_version_number in number
160 ) Return Boolean;
161 --
162 -- ----------------------------------------------------------------------------
163 -- |---------------------------------< lck >----------------------------------|
164 -- ----------------------------------------------------------------------------
165 -- {Start of comments}
166 --
167 -- Description:
168 -- The Lck process has two main functions to perform. Firstly, the row to be
169 -- updated or deleted must be locked. The locking of the row will only be
170 -- successful if the row is not currently locked by another user.
171 -- Secondly, during the locking of the row, the row is selected into
172 -- the g_old_rec data structure which enables the current row values from
173 -- the server to be available to the api.
174 --
175 -- Prerequisites:
176 -- When attempting to call the lock the object version number (if defined)
177 -- is mandatory.
178 --
179 -- In Parameters:
180 -- The arguments to the Lck process are the primary key(s) which uniquely
181 -- identify the row and the object version number of row.
182 --
183 -- Post Success:
184 -- On successful completion of the Lck process the row to be updated or
185 -- deleted will be locked and selected into the global data structure
186 -- g_old_rec.
187 --
188 -- Post Failure:
189 -- The Lck process can fail for three reasons:
190 -- 1) When attempting to lock the row the row could already be locked by
191 -- another user. This will raise the HR_Api.Object_Locked exception.
192 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
193 -- This error is trapped and reported using the message name
194 -- 'HR_7220_INVALID_PRIMARY_KEY'.
195 -- 3) The row although existing in the HR Schema has a different object
196 -- version number than the object version number specified.
197 -- This error is trapped and reported using the message name
198 -- 'HR_7155_OBJECT_INVALID'.
199 --
200 -- Developer Implementation Notes:
201 -- For each primary key and the object version number arguments add a
202 -- call to hr_api.mandatory_arg_error procedure to ensure that these
203 -- argument values are not null.
204 --
205 -- Access Status:
206 -- Internal Development Use Only.
207 --
208 -- {End of comments}
209 -- ----------------------------------------------------------------------------
210 Procedure lck
211 (p_process_parameter_id in number
212 ,p_object_version_number in number
213 );
214 --
215 -- ----------------------------------------------------------------------------
216 -- |-----------------------------< convert_args >-----------------------------|
217 -- ----------------------------------------------------------------------------
218 -- {Start Of Comments}
219 --
220 -- Description:
221 -- This function is used to turn attribute parameters into the record
222 -- structure parameter g_rec_type.
223 --
224 -- Prerequisites:
225 -- This is a private function and can only be called from the ins or upd
226 -- attribute processes.
227 --
228 -- In Parameters:
229 --
230 -- Post Success:
231 -- A returning record structure will be returned.
232 --
233 -- Post Failure:
234 -- No direct error handling is required within this function. Any possible
235 -- errors within this function will be a PL/SQL value error due to
236 -- conversion of datatypes or data lengths.
237 --
238 -- Developer Implementation Notes:
239 -- None.
240 --
241 -- Access Status:
242 -- Internal Row Handler Use Only.
243 --
244 -- {End Of Comments}
245 -- ----------------------------------------------------------------------------
246 Function convert_args
247 (p_process_parameter_id in number
248 ,p_process_id in number
249 ,p_internal_name in varchar2
250 ,p_data_type in varchar2
251 ,p_enabled_flag in varchar2
252 ,p_object_version_number in number
253 )
254 Return g_rec_type;
255 --
256 end pay_app_shd;