1 Package pqh_tsh_shd as
2 /* $Header: pqtshrhi.pkh 120.1 2005/09/30 06:13:33 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 ,approval_history_id number(9) -- Increased length
11 ,creator_person_id number(15)
12 ,creator_role varchar2(320)
13 ,status varchar2(10)
14 ,transaction_state varchar2(10)
15 ,effective_date date
16 ,effective_date_option varchar2(10)
17 ,last_update_role varchar2(320)
18 ,parent_transaction_id number(15)
19 ,relaunch_function varchar2(30)
20 ,transaction_document CLOB
21 );
22 --
23 -- ----------------------------------------------------------------------------
24 -- | Global Definitions - Internal Development Use Only |
25 -- ----------------------------------------------------------------------------
26 --
27 g_old_rec g_rec_type; -- Global record definition
28 -- Global table name
29 g_tab_nam constant varchar2(30) := 'PQH_SS_TRANS_STATE_HISTORY';
30 --
31 -- ----------------------------------------------------------------------------
32 -- |---------------------------< constraint_error >---------------------------|
33 -- ----------------------------------------------------------------------------
34 -- {Start Of Comments}
35 --
36 -- Description:
37 -- This procedure is called when a constraint has been violated (i.e.
38 -- The exception hr_api.check_integrity_violated,
39 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
40 -- hr_api.unique_integrity_violated has been raised).
41 -- The exceptions can only be raised as follows:
42 -- 1) A check constraint can only be violated during an INSERT or UPDATE
43 -- dml operation.
44 -- 2) A parent integrity constraint can only be violated during an
45 -- INSERT or UPDATE dml operation.
46 -- 3) A child integrity constraint can only be violated during an
47 -- DELETE dml operation.
48 -- 4) A unique integrity constraint can only be violated during INSERT or
49 -- UPDATE dml operation.
50 --
51 -- Prerequisites:
52 -- 1) Either hr_api.check_integrity_violated,
53 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
54 -- hr_api.unique_integrity_violated has been raised with the subsequent
55 -- stripping of the constraint name from the generated error message
56 -- text.
57 -- 2) Standalone validation test which corresponds with a constraint error.
58 --
59 -- In Parameter:
60 -- p_constraint_name is in upper format and is just the constraint name
61 -- (e.g. not prefixed by brackets, schema owner etc).
62 --
63 -- Post Success:
64 -- Development dependant.
65 --
66 -- Post Failure:
67 -- Developement dependant.
68 --
69 -- Developer Implementation Notes:
70 -- For each constraint being checked the hr system package failure message
71 -- has been generated as a template only. These system error messages should
72 -- be modified as required (i.e. change the system failure message to a user
73 -- friendly defined error message).
74 --
75 -- Access Status:
76 -- Internal Development Use Only.
77 --
78 -- {End Of Comments}
79 -- ----------------------------------------------------------------------------
80 Procedure constraint_error
81 (p_constraint_name in all_constraints.constraint_name%TYPE);
82 --
83 -- ----------------------------------------------------------------------------
84 -- |-----------------------------< api_updating >-----------------------------|
85 -- ----------------------------------------------------------------------------
86 -- {Start Of Comments}
87 --
88 -- Description:
89 -- This function is used to populate the g_old_rec record with the
90 -- current row from the database for the specified primary key
91 -- provided that the primary key exists and is valid and does not
92 -- already match the current g_old_rec. The function will always return
93 -- a TRUE value if the g_old_rec is populated with the current row.
94 -- A FALSE value will be returned if all of the primary key arguments
95 -- are null.
96 --
97 -- Prerequisites:
98 -- None.
99 --
100 -- In Parameters:
101 --
102 -- Post Success:
103 -- A value of TRUE will be returned indiciating that the g_old_rec
104 -- is current.
105 -- A value of FALSE will be returned if all of the primary key arguments
106 -- have a null value (this indicates that the row has not be inserted into
107 -- the Schema), and therefore could never have a corresponding row.
108 --
109 -- Post Failure:
110 -- A failure can only occur under two circumstances:
111 -- 1) The primary key is invalid (i.e. a row does not exist for the
112 -- specified primary key values).
113 -- 2) If an object_version_number exists but is NOT the same as the current
114 -- g_old_rec value.
115 --
116 -- Developer Implementation Notes:
117 -- None.
118 --
119 -- Access Status:
120 -- Internal Development Use Only.
121 --
122 -- {End Of Comments}
123 -- ----------------------------------------------------------------------------
124 Function api_updating
125 (p_transaction_history_id in number
126 ,p_approval_history_id in number
127 ) Return Boolean;
128 --
129 -- ----------------------------------------------------------------------------
130 -- |---------------------------------< lck >----------------------------------|
131 -- ----------------------------------------------------------------------------
132 -- {Start of comments}
133 --
134 -- Description:
135 -- The Lck process has two main functions to perform. Firstly, the row to be
136 -- updated or deleted must be locked. The locking of the row will only be
137 -- successful if the row is not currently locked by another user.
138 -- Secondly, during the locking of the row, the row is selected into
139 -- the g_old_rec data structure which enables the current row values from
140 -- the server to be available to the api.
141 --
142 -- Prerequisites:
143 -- When attempting to call the lock the object version number (if defined)
144 -- is mandatory.
145 --
146 -- In Parameters:
147 -- The arguments to the Lck process are the primary key(s) which uniquely
148 -- identify the row and the object version number of row.
149 --
150 -- Post Success:
151 -- On successful completion of the Lck process the row to be updated or
152 -- deleted will be locked and selected into the global data structure
153 -- g_old_rec.
154 --
155 -- Post Failure:
156 -- The Lck process can fail for three reasons:
157 -- 1) When attempting to lock the row the row could already be locked by
158 -- another user. This will raise the HR_Api.Object_Locked exception.
159 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
160 -- This error is trapped and reported using the message name
161 -- 'HR_7220_INVALID_PRIMARY_KEY'.
162 -- 3) The row although existing in the HR Schema has a different object
163 -- version number than the object version number specified.
164 -- This error is trapped and reported using the message name
165 -- 'HR_7155_OBJECT_INVALID'.
166 --
167 -- Developer Implementation Notes:
168 -- For each primary key and the object version number arguments add a
169 -- call to hr_api.mandatory_arg_error procedure to ensure that these
170 -- argument values are not null.
171 --
172 -- Access Status:
173 -- Internal Development Use Only.
174 --
175 -- {End of comments}
176 -- ----------------------------------------------------------------------------
177 Procedure lck
178 (p_transaction_history_id in number
179 ,p_approval_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_approval_history_id in number
216 ,p_creator_person_id in number
217 ,p_creator_role in varchar2
218 ,p_status in varchar2
219 ,p_transaction_state in varchar2
220 ,p_effective_date in date
221 ,p_effective_date_option in varchar2
222 ,p_last_update_role in varchar2
223 ,p_parent_transaction_id in number
224 ,p_relaunch_function in varchar2
225 ,p_transaction_document in CLOB
226 )
227 Return g_rec_type;
228 --
229 end pqh_tsh_shd;