DBA Data[Home] [Help]

PACKAGE: APPS.PER_PSE_SHD

Source


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