DBA Data[Home] [Help]

PACKAGE: APPS.HXC_HAS_SHD

Source


1 Package hxc_has_shd AUTHID CURRENT_USER as
2 /* $Header: hxchasrhi.pkh 120.2 2006/06/08 13:22:58 gsirigin noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                    Global Record Type Specification                      |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9   (approval_style_id               number(15)
10   ,object_version_number           number(9)
11   ,name                            varchar2(80)
12   ,business_group_id		   number(15)
13   ,legislation_code		   varchar2(30)
14   ,description                     varchar2(2000)
15   ,run_recipient_extensions        varchar2(1)
16   ,admin_role                      varchar2(320)
17   ,error_admin_role                varchar2(320)
18   );
19 --
20 -- ----------------------------------------------------------------------------
21 -- |           Global Definitions - Internal Development Use Only             |
22 -- ----------------------------------------------------------------------------
23 --
24 g_old_rec  g_rec_type;                            -- Global record definition
25 g_api_dml  boolean;                               -- Global api dml status
26 --
27 -- ----------------------------------------------------------------------------
28 -- |------------------------< return_api_dml_status >-------------------------|
29 -- ----------------------------------------------------------------------------
30 -- {Start Of Comments}
31 --
32 -- Description:
33 --   This function will return the current g_api_dml private global
34 --   boolean status.
35 --   The g_api_dml status determines if at the time of the function
36 --   being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
37 --   is being issued from within an api.
38 --   If the status is TRUE then a dml statement is being issued from
39 --   within this entity api.
40 --   This function is primarily to support database triggers which
41 --   need to maintain the object_version_number for non-supported
42 --   dml statements (i.e. dml statement issued outside of the api layer).
43 --
44 -- Prerequisites:
45 --   None.
46 --
47 -- In Parameters:
48 --   None.
49 --
50 -- Post Success:
51 --   Processing continues.
52 --   If the function returns a TRUE value then, dml is being executed from
53 --   within this api.
54 --
55 -- Post Failure:
56 --   None.
57 --
58 -- Access Status:
59 --   Internal Row Handler Use Only.
60 --
61 -- {End Of Comments}
62 -- ----------------------------------------------------------------------------
63 Function return_api_dml_status Return Boolean;
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_approval_style_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 the
173 --   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_approval_style_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 conversion
236 --   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_approval_style_id              in number
248   ,p_object_version_number          in number
249   ,p_name                           in varchar2
250   ,p_business_group_id		    in number
251   ,p_legislation_code		    in varchar2
252   ,p_description                    in varchar2
253   ,p_run_recipient_extensions       in varchar2
254   ,p_admin_role                     in varchar2
255   ,p_error_admin_role               in varchar2
256   )
257   Return g_rec_type;
258 --
259 end hxc_has_shd;