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