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