1 Package hr_qsa_bus as
2 /* $Header: hrqsarhi.pkh 120.0 2005/05/31 02:26:14 appldev noship $ */
3 --
4 --
5 -- ----------------------------------------------------------------------------
6 -- |------------------------< set_security_group_id >-------------------------|
7 -- ----------------------------------------------------------------------------
8 -- {Start Of Comments}
9 --
10 -- Description:
11 -- Sets the security_group_id in CLIENT_INFO for the questionnaire_answer business
12 -- group context.
13 --
14 -- Prerequisites:
15 -- None,
16 --
17 -- In Parameters:
18 -- Name Reqd Type Description
19 -- p_questionnaire_answer_id Yes Number questionaire answer to use for
20 -- deriving the security group
21 -- context.
22 --
23 -- Post Success:
24 -- The security_group_id will be set in CLIENT_INFO.
25 --
26 -- Post Failure:
27 -- An error is raised if the p_questionnaire_answer_id does not exist.
28 --
29 -- Access Status:
30 -- Internal Development Use Only.
31 --
32 -- {End Of Comments}
33 --
34 procedure set_security_group_id(p_questionnaire_answer_id in hr_quest_answers.questionnaire_answer_id%TYPE);
35 -- ----------------------------------------------------------------------------
36 -- |-------------------------< chk_type >-------------------------------------|
37 -- ----------------------------------------------------------------------------
38 --
39 -- Description:
40 -- Validates the type against HR_LOOKUPS, where the lookup code
41 -- is QUEST_OBJECT_TYPE.
42 --
43 -- Pre-requisites:
44 -- None.
45 --
46 -- IN Parameters:
47 -- p_type
48 -- p_effective_date
49 --
50 -- Post Success:
51 -- Processing continues if the type is valid.
52 --
53 -- Post Failure:
54 -- An application error is raised, and processing is terminated if the
55 -- type is invalid.
56 --
57 -- Developer Implementation Notes:
58 -- None.
59 --
60 -- Access Status:
61 -- Internal Development Use Only.
62 --
63 -- ----------------------------------------------------------------------------
64 procedure chk_type
65 (p_type in HR_QUEST_ANSWERS.TYPE%TYPE
66 ,p_effective_date in date
67 );
68 --
69 -- ----------------------------------------------------------------------------
70 -- |------------------------< chk_type_object_id >----------------------------|
71 -- ----------------------------------------------------------------------------
72 --
73 -- Description:
74 -- Validates that:
75 -- - when type is APPRAISAL, the type_object_id is valid against
76 -- PER_APPRAISALS, for the given business group.
77 -- - when type is PARTICIPANT, the type_object_id is valid against
78 -- PER_PARTICIPANTS, for the given business_group_id.
79 -- Also, that the participation is for an appraisal.
80 -- Further checking is done to ensure the type_object_id is UNIQUE
81 -- for the given type.
82 --
83 -- Pre-Requisites:
84 -- That the TYPE is valid, and the business_group_id exists.
85 --
86 -- IN Parameters:
87 -- p_type_object_id
88 -- p_type
89 -- p_business_group_id
90 --
91 -- Post Success:
92 -- Processing continues if the type_object_id is valid.
93 --
94 -- Post Failure:
95 -- An application error is raised, and processing is terminated if the
96 -- type_object_id is invalid.
97 --
98 -- Developer Implementation Notes:
99 -- None.
100 --
101 -- Access Status:
102 -- Internal Development Use Only.
103 --
104 -- ----------------------------------------------------------------------------
105 procedure chk_type_object_id
106 (p_type_object_id in HR_QUEST_ANSWERS.type_object_id%TYPE
107 ,p_type in HR_QUEST_ANSWERS.type%TYPE
108 ,p_business_group_id in HR_QUEST_ANSWERS.business_group_id%TYPE
109 );
110 --
111 -- ----------------------------------------------------------------------------
112 -- |------------------< chk_questionnaire_template_id >----------------------|
113 -- ----------------------------------------------------------------------------
114 --
115 -- Description:
116 -- Validates that the questionnaire_template_id exists in HR_QUESTIONNAIRES.
117 -- Also, validates that the questionnaire_template_id is valid against the
118 -- PER_APPRAISAL_TEMPLATES table, when type = 'APPRAISAL', or valid against
119 -- the PER_APPRAISALS table when type = 'PARTICIPANT'.
120 --
121 -- Pre-requisites:
122 -- p_type, p_type_object_id and p_business_group_id are all valid.
123 --
124 -- IN Parameters:
125 -- p_questionnaire_template_id
126 -- p_type
127 -- p_type_object_id
128 -- p_business_group_id
129 --
130 -- Post Success:
131 -- Processing continues if questionnaire_template_id is valid.
132 --
133 -- Post Failure:
134 -- An application error is raised, and processing is terminated if the
135 -- questionniare_template_id is invalid.
136 --
137 -- Developer/Implementation Notes:
138 -- None.
139 --
140 -- Access Status:
141 -- Internal Development Use Only.
142 --
143 -- ----------------------------------------------------------------------------
144 procedure chk_questionnaire_template_id
145 (p_questionnaire_template_id in
146 HR_QUEST_ANSWERS.questionnaire_template_id%TYPE
147 ,p_type in
148 HR_QUEST_ANSWERS.type%TYPE
149 ,p_type_object_id in
150 HR_QUEST_ANSWERS.type_object_id%TYPE
151 ,p_business_group_id in
152 HR_QUEST_ANSWERS.business_group_id%TYPE
153 );
154 --
155 -- ----------------------------------------------------------------------------
156 -- |------------------------< chk_row_delete >--------------------------------|
157 -- ----------------------------------------------------------------------------
158 --
159 -- Description:
160 -- This procedure validates that a row can be deleted, by ensuring that
161 -- no child rows exist in HR_QUEST_ANSWER_VALUES.
162 --
163 -- Pre-requisites:
164 -- None.
165 --
166 -- IN Parameters:
167 -- p_questionnaire_answer_id
168 --
169 -- Post Success:
170 -- Processing continues, and the row is deleted.
171 --
172 -- Post Failure:
173 -- An application error is raised, and processing terminated if a child row
174 -- exists, and the row may not be deleted.
175 --
176 -- Developer/Implementation Notes:
177 -- None.
178 --
179 -- Access Status:
180 -- Internal Development Use Only.
181 --
182 -- ----------------------------------------------------------------------------
183 procedure chk_row_delete
184 (p_questionnaire_answer_id
185 in hr_quest_answers.questionnaire_answer_id%TYPE
186 );
187 --
188 -- ----------------------------------------------------------------------------
189 -- |---------------------------< insert_validate >----------------------------|
190 -- ----------------------------------------------------------------------------
191 -- {Start Of Comments}
192 --
193 -- Description:
194 -- This procedure controls the execution of all insert business rules
195 -- validation.
196 --
197 -- Prerequisites:
198 -- This private procedure is called from ins procedure.
199 --
200 -- In Parameters:
201 -- A Pl/Sql record structre.
202 --
203 -- Post Success:
204 -- Processing continues.
205 --
206 -- Post Failure:
207 -- If a business rules fails the error will not be handled by this procedure
208 -- unless explicity coded.
209 --
210 -- Developer Implementation Notes:
211 -- For insert, your business rules should be executed from this procedure and
212 -- should ideally (unless really necessary) just be straight procedure or
213 -- function calls. Try and avoid using conditional branching logic.
214 --
215 -- Access Status:
216 -- Internal Row Handler Use Only.
217 --
218 -- {End Of Comments}
219 -- ----------------------------------------------------------------------------
220 Procedure insert_validate(p_rec in hr_qsa_shd.g_rec_type
221 ,p_effective_date in date
222 );
223 --
224 -- ----------------------------------------------------------------------------
225 -- |---------------------------< update_validate >----------------------------|
226 -- ----------------------------------------------------------------------------
227 -- {Start Of Comments}
228 --
229 -- Description:
230 -- This procedure controls the execution of all update business rules
231 -- validation.
232 --
233 -- Prerequisites:
234 -- This private procedure is called from upd procedure.
235 --
236 -- In Parameters:
237 -- A Pl/Sql record structre.
238 --
239 -- Post Success:
240 -- Processing continues.
241 --
242 -- Post Failure:
243 -- If a business rules fails the error will not be handled by this procedure
244 -- unless explicity coded.
245 --
246 -- Developer Implementation Notes:
247 -- For update, your business rules should be executed from this procedure and
248 -- should ideally (unless really necessary) just be straight procedure or
249 -- function calls. Try and avoid using conditional branching logic.
250 --
251 -- Access Status:
252 -- Internal Row Handler Use Only.
253 --
254 -- {End Of Comments}
255 -- ----------------------------------------------------------------------------
256 Procedure update_validate(p_rec in hr_qsa_shd.g_rec_type
257 ,p_effective_date in date
258 );
259 --
260 -- ----------------------------------------------------------------------------
261 -- |---------------------------< delete_validate >----------------------------|
262 -- ----------------------------------------------------------------------------
263 -- {Start Of Comments}
264 --
265 -- Description:
266 -- This procedure controls the execution of all delete business rules
267 -- validation.
268 --
269 -- Prerequisites:
270 -- This private procedure is called from del procedure.
271 --
272 -- In Parameters:
273 -- A Pl/Sql record structre.
274 --
275 -- Post Success:
276 -- Processing continues.
277 --
278 -- Post Failure:
279 -- If a business rules fails the error will not be handled by this procedure
280 -- unless explicity coded.
281 --
282 -- Developer Implementation Notes:
283 -- For delete, your business rules should be executed from this procedure and
284 -- should ideally (unless really necessary) just be straight procedure or
285 -- function calls. Try and avoid using conditional branching logic.
286 --
287 -- Access Status:
288 -- Internal Row Handler Use Only.
289 --
290 -- {End Of Comments}
291 -- ----------------------------------------------------------------------------
292 Procedure delete_validate(p_rec in hr_qsa_shd.g_rec_type);
293 --
294 -- ----------------------------------------------------------------------------
295 -- |-----------------< return_legislation_code >------------------------------|
296 -- ----------------------------------------------------------------------------
297 --
298 function return_legislation_code
299 (p_questionnaire_answer_id in hr_quest_answers.questionnaire_answer_id%TYPE
300 ) return varchar2;
301 --
302 --
303 end hr_qsa_bus;