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