DBA Data[Home] [Help]

PACKAGE: APPS.AME_CFV_SHD

Source


1 Package ame_cfv_shd as
2 /* $Header: amcfvrhi.pkh 120.0 2005/09/02 03:54 mbocutt noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                    Global Record Type Specification                      |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9   (application_id                  number
10   ,variable_name                   varchar2(50)
11   ,variable_value                  varchar2(200)
12   ,description                     varchar2(100)
13   ,start_date                      date
14   ,end_date                        date
15   ,security_group_id               number(15)
16   ,object_version_number           number(9)
17   );
18 --
19 -- ----------------------------------------------------------------------------
20 -- |           Global Definitions - Internal Development Use Only             |
21 -- ----------------------------------------------------------------------------
22 --
23 g_old_rec  g_rec_type;                            -- Global record definition
24 -- Global table name
25 g_tab_nam  constant varchar2(30) := 'AME_CONFIG_VARS';
26 --
27 -- ----------------------------------------------------------------------------
28 -- |---------------------------< constraint_error >---------------------------|
29 -- ----------------------------------------------------------------------------
30 -- {Start Of Comments}
31 --
32 -- Description:
33 --   This procedure is called when a constraint has been violated (i.e.
34 --   The exception hr_api.check_integrity_violated,
35 --   hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
36 --   hr_api.unique_integrity_violated has been raised).
37 --   The exceptions can only be raised as follows:
38 --   1) A check constraint can only be violated during an INSERT or UPDATE
39 --      dml operation.
40 --   2) A parent integrity constraint can only be violated during an
41 --      INSERT or UPDATE dml operation.
42 --   3) A child integrity constraint can only be violated during an
43 --      DELETE dml operation.
44 --   4) A unique integrity constraint can only be violated during INSERT or
45 --      UPDATE dml operation.
46 --
47 -- Prerequisites:
48 --   1) Either hr_api.check_integrity_violated,
49 --      hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
50 --      hr_api.unique_integrity_violated has been raised with the subsequent
51 --      stripping of the constraint name from the generated error message
52 --      text.
53 --   2) Standalone validation test which corresponds with a constraint error.
54 --
55 -- In Parameter:
56 --   p_constraint_name is in upper format and is just the constraint name
57 --   (e.g. not prefixed by brackets, schema owner etc).
58 --
59 -- Post Success:
60 --   Development dependant.
61 --
62 -- Post Failure:
63 --   Developement dependant.
64 --
65 -- Developer Implementation Notes:
66 --   For each constraint being checked the hr system package failure message
67 --   has been generated as a template only. These system error messages should
68 --   be modified as required (i.e. change the system failure message to a user
69 --   friendly defined error message).
70 --
71 -- Access Status:
72 --   Internal Development Use Only.
73 --
74 -- {End Of Comments}
75 -- ----------------------------------------------------------------------------
76 Procedure constraint_error
77   (p_constraint_name in all_constraints.constraint_name%TYPE);
78 --
79 -- ----------------------------------------------------------------------------
80 -- |-----------------------------< api_updating >-----------------------------|
81 -- ----------------------------------------------------------------------------
82 --  {Start Of Comments}
83 --
84 -- Description:
85 --   This function is used to populate the g_old_rec record with the
86 --   current row from the database for the specified primary key
87 --   provided that the primary key exists and is valid and does not
88 --   already match the current g_old_rec. The function will always return
89 --   a TRUE value if the g_old_rec is populated with the current row.
90 --   A FALSE value will be returned if all of the primary key arguments
91 --   are null.
92 --
93 -- Prerequisites:
94 --   None.
95 --
96 -- In Parameters:
97 --
98 -- Post Success:
99 --   A value of TRUE will be returned indiciating that the g_old_rec
100 --   is current.
101 --   A value of FALSE will be returned if all of the primary key arguments
102 --   have a null value (this indicates that the row has not be inserted into
103 --   the Schema), and therefore could never have a corresponding row.
104 --
105 -- Post Failure:
106 --   A failure can only occur under two circumstances:
107 --   1) The primary key is invalid (i.e. a row does not exist for the
108 --      specified primary key values).
109 --   2) If an object_version_number exists but is NOT the same as the current
110 --      g_old_rec value.
111 --
112 -- Developer Implementation Notes:
113 --   None.
114 --
115 -- Access Status:
116 --   Internal Development Use Only.
117 --
118 -- {End Of Comments}
119 -- ----------------------------------------------------------------------------
120 Function api_updating
121   (p_effective_date                   in date
122   ,p_application_id                   in number
123   ,p_variable_name                    in varchar2
124   ,p_object_version_number            in number
125   ) Return Boolean;
126 --
127 -- ----------------------------------------------------------------------------
128 -- |----------------------------< upd_end_date >------------------------------|
129 -- ----------------------------------------------------------------------------
130 -- {Start Of Comments}
131 --
132 -- Description:
133 --   This procedure will update the specified datetrack row with the
134 --   specified new effective end date. The object version number is also
135 --   set to the next object version number. DateTrack modes which call
136 --   this procedure are: UPDATE, UPDATE_CHANGE_INSERT,
137 --   UPDATE_OVERRIDE, DELETE, FUTURE_CHANGE and DELETE_NEXT_CHANGE.
138 --   This is an internal datetrack maintenance procedure which should
139 --   not be modified in anyway.
140 --
141 -- Prerequisites:
142 --   None.
143 --
144 -- In Parameters:
145 --   p_new_effective_end_date
146 --     Specifies the new effective end date which will be set for the
147 --     row as of the effective date.
148 --   p_base_key_value
149 --     Specifies the primary key value for this datetrack entity.
150 --     (E.g. For this entity the assignment of the argument would be:
151 --           p_base_key_value = :application_id).
152 --
153 -- Post Success:
154 --   The specified row will be updated with the new effective end date and
155 --   object_version_number.
156 --
157 -- Post Failure:
158 --   Failure might occur if for the specified effective date and primary key
159 --   value a row doesn't exist.
160 --
161 -- Developer Implementation Notes:
162 --   This is an internal datetrack maintenance procedure which should
163 --   not be modified in anyway.
164 --
165 -- Access Status:
166 --   Internal Row Handler Use Only.
167 --
168 -- {End Of Comments}
169 -- ----------------------------------------------------------------------------
170 Procedure upd_end_date
171   (p_effective_date         in date
172   ,p_application_id                   in number
173   ,p_variable_name                    in varchar2
174   ,p_new_end_date           in date
175   ,p_object_version_number            out nocopy number
176   );
177 --
178 -- ----------------------------------------------------------------------------
179 -- |---------------------------------< lck >----------------------------------|
180 -- ----------------------------------------------------------------------------
181 -- {Start Of Comments}
182 --
183 -- Description:
184 --   The Lck process for datetrack is complicated and comprises of the
185 --   following processing
186 --   The processing steps are as follows:
187 --   1) The row to be updated or deleted must be locked.
188 --      By locking this row, the g_old_rec record data type is populated.
189 --   2) If a comment exists the text is selected from hr_comments.
190 --   3) The datetrack mode is then validated to ensure the operation is
191 --      valid. If the mode is valid the validation start and end dates for
192 --      the mode will be derived and returned. Any required locking is
193 --      completed when the datetrack mode is validated.
194 --
195 -- Prerequisites:
196 --   When attempting to call the lck procedure the object version number,
197 --   primary key, effective date and datetrack mode must be specified.
198 --
199 -- In Parameters:
200 --   p_effective_date
201 --     Specifies the date of the datetrack update operation.
202 --   p_datetrack_mode
203 --     Determines the datetrack update or delete mode.
204 --
205 -- Post Success:
206 --   On successful completion of the Lck process the row to be updated or
207 --   deleted will be locked and selected into the global data structure
208 --   g_old_rec.
209 --
210 -- Post Failure:
211 --   The Lck process can fail for three reasons:
212 --   1) When attempting to lock the row the row could already be locked by
213 --      another user. This will raise the HR_Api.Object_Locked exception.
214 --   2) The row which is required to be locked doesn't exist in the HR Schema.
215 --      This error is trapped and reported using the message name
216 --      'HR_7220_INVALID_PRIMARY_KEY'.
217 --   3) The row although existing in the HR Schema has a different object
218 --      version number than the object version number specified.
219 --      This error is trapped and reported using the message name
220 --      'HR_7155_OBJECT_INVALID'.
221 --
222 -- Developer Implementation Notes:
223 --   None.
224 --
225 -- Access Status:
226 --   Internal Development Use Only.
227 --
228 -- {End Of Comments}
229 -- ----------------------------------------------------------------------------
230 Procedure lck
231   (p_effective_date                   in date
232   ,p_datetrack_mode                   in varchar2
233   ,p_application_id                   in number
234   ,p_variable_name                    in varchar2
235   ,p_object_version_number            in number
236   ,p_validation_start_date            out nocopy date
237   ,p_validation_end_date              out nocopy date
238   );
239 --
240 -- ----------------------------------------------------------------------------
241 -- |-----------------------------< convert_args >-----------------------------|
242 -- ----------------------------------------------------------------------------
243 -- {Start Of Comments}
244 --
245 -- Description:
246 --   This function is used to turn attribute parameters into the record
247 --   structure parameter g_rec_type.
248 --
249 -- Prerequisites:
250 --   This is a private function and can only be called from the ins or upd
251 --   attribute processes.
252 --
253 -- In Parameters:
254 --
255 -- Post Success:
256 --   A returning record structure will be returned.
257 --
258 -- Post Failure:
259 --   No direct error handling is required within this function.  Any possible
260 --   errors within this function will be a PL/SQL value error due to
261 --   conversion of datatypes or data lengths.
262 --
263 -- Developer Implementation Notes:
264 --   None.
265 --
266 -- Access Status:
267 --   Internal Row Handler Use Only.
268 --
269 -- {End Of Comments}
270 -- ----------------------------------------------------------------------------
271 Function convert_args
272   (p_application_id                 in number
273   ,p_variable_name                  in varchar2
274   ,p_variable_value                 in varchar2
275   ,p_description                    in varchar2
276   ,p_start_date                     in date
277   ,p_end_date                       in date
278   ,p_security_group_id              in number
279   ,p_object_version_number          in number
280   )
281   Return g_rec_type;
282 --
283 -- ----------------------------------------------------------------------------
284 -- |-----------------------------< get_object_version_number >----------------|
285 -- ----------------------------------------------------------------------------
286 -- {Start Of Comments}
287 --
288 -- Description:
289 --   This function is used to get the next object version number to be used
290 --   within datetrack for an insert or update dml operation. The returned
291 --   object version number will be determined by taking the maximum
292 --   object version number for the datetracked rows and then incrementing by 1.
293 --
294 --
295 -- Prerequisites:
296 --   This is a private function and can only be called from the ins or upd
297 --   attribute processes.
298 --
299 -- In Parameters:
300 --
301 --
302 -- Post Success:
303 --
304 --
305 -- Post Failure:
306 --
307 --
308 --
309 --
310 -- Developer Implementation Notes:
311 --   None.
312 --
313 -- Access Status:
314 --   Internal Row Handler Use Only.
315 --
316 -- {End Of Comments}
317 -- ----------------------------------------------------------------------------
318 Function get_object_version_number
319   (p_application_id  in  number
320   ,p_variable_name  in  varchar2
321   )
322   Return number;
323   --
324 --
325 end ame_cfv_shd;