DBA Data[Home] [Help]

PACKAGE: APPS.PQH_RHT_SHD

Source


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