1 Package ota_cpr_bus as
2 /* $Header: otcprrhi.pkh 120.0.12000000.1 2007/01/18 04:07:15 appldev noship $ */
3 --
4 -- ---------------------------------------------------------------------------
5 -- |----------------------< set_security_group_id >--------------------------|
6 -- ---------------------------------------------------------------------------
7 -- {Start Of Comments}
8 --
9 -- Description:
10 -- Sets the security_group_id in CLIENT_INFO for the appropriate business
11 -- group context.
12 --
13 -- Prerequisites:
14 -- The primary key identified by p_activity_version_id
15 -- p_prerequisite_course_id
16 -- already exists.
17 --
18 -- In Arguments:
19 -- p_activity_version_id
20 -- p_prerequisite_course_id
21 --
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 value does not exist.
28 --
29 -- Access Status:
30 -- Internal Development Use Only.
31 --
32 -- {End Of Comments}
33 -- ---------------------------------------------------------------------------
34 procedure set_security_group_id
35 (p_activity_version_id in number
36 ,p_prerequisite_course_id in number
37 ,p_associated_column1 in varchar2 default null
38 ,p_associated_column2 in varchar2 default null
39 );
40 --
41 --
42 -- ---------------------------------------------------------------------------
43 -- |---------------------< return_legislation_code >-------------------------|
44 -- ---------------------------------------------------------------------------
45 -- {Start Of Comments}
46 --
47 -- Description:
48 -- Return the legislation code for a specific primary key value
49 --
50 -- Prerequisites:
51 -- The primary key identified by p_activity_version_id
52 -- p_prerequisite_course_id
53 -- already exists.
54 --
55 -- In Arguments:
56 -- p_activity_version_id
57 -- p_prerequisite_course_id
58 --
59 --
60 -- Post Success:
61 -- The business group's legislation code will be returned.
62 --
63 -- Post Failure:
64 -- An error is raised if the value does not exist.
65 --
66 -- Access Status:
67 -- Internal Development Use Only.
68 --
69 -- {End Of Comments}
70 -- ---------------------------------------------------------------------------
71 FUNCTION return_legislation_code
72 (p_activity_version_id in number
73 ,p_prerequisite_course_id in number
74 ) RETURN varchar2;
75 --
76 -- ----------------------------------------------------------------------------
77 -- |---------------------------< check_unique_key >----------------------------|
78 -- ----------------------------------------------------------------------------
79 -- {Start Of Comments}
80 --
81 -- Description:
82 -- This procedure checks whether the prerequisite course has already been
83 -- attached to the destination course
84 --
85 -- Prerequisites:
86 -- This private procedure is called from insert_validate.
87 --
88 -- In Parameters:
89 -- p_activity_version_id and p_prerequisite_course_id
90 --
91 -- Post Success:
92 -- Processing continues.
93 --
94 -- Post Failure:
95 -- If a business rules fails the error will not be handled by this procedure
96 -- unless explicity coded.
97 --
98 -- Developer Implementation Notes:
99 --
100 --
101 -- Access Status:
102 -- Internal Row Handler Use Only.
103 --
104 -- {End Of Comments}
105 -- ----------------------------------------------------------------------------
106 Procedure check_unique_key
107 (
108 p_activity_version_id in number
109 ,p_prerequisite_course_id in number
110 );
111 --
112 -- ----------------------------------------------------------------------------
113 -- |-----------------------< check_prereq_course_expiry >---------------------|
114 -- ----------------------------------------------------------------------------
115 -- {Start Of Comments}
116 --
117 -- Description:
118 -- This procedure validates the end date of prerequisite course
119 -- Prerequisite course end date must be greater than or equal to sysdate
120 --
121 -- Prerequisites:
122 -- This private procedure is called from insert_validate.
123 --
124 -- In Parameters:
125 -- p_prerequisite_course_id
126 --
127 -- Post Success:
128 -- Processing continues.
129 --
130 -- Post Failure:
131 -- If a business rules fails the error will not be handled by this procedure
132 -- unless explicity coded.
133 --
134 -- Developer Implementation Notes:
135 --
136 --
137 -- Access Status:
138 -- Internal Row Handler Use Only.
139 --
140 -- {End Of Comments}
141 -- ----------------------------------------------------------------------------
142 Procedure check_prereq_course_expiry
143 (
144 p_prerequisite_course_id in number
145 );
146 --
147 -- ----------------------------------------------------------------------------
148 -- |---------------------------< check_course_start_date >---------------------|
149 -- ----------------------------------------------------------------------------
150 -- {Start Of Comments}
151 --
152 -- Description:
153 -- This procedure validates the start date of prerequisite and destination
154 -- courses
155 -- Prerequisite course start date must be less than or equal to destination
156 -- course start date.
157 --
158 -- Prerequisites:
159 -- This private procedure is called from insert_validate.
160 --
161 -- In Parameters:
162 -- p_activity_version_id and p_prerequisite_course_id
163 --
164 -- Post Success:
165 -- Processing continues.
166 --
167 -- Post Failure:
168 -- If a business rules fails the error will not be handled by this procedure
169 -- unless explicity coded.
170 --
171 -- Developer Implementation Notes:
172 --
173 --
174 -- Access Status:
175 -- Internal Row Handler Use Only.
176 --
177 -- {End Of Comments}
178 -- ----------------------------------------------------------------------------
179 Procedure check_course_start_date
180 (
181 p_activity_version_id in number
182 ,p_prerequisite_course_id in number
183 );
184 --
185 -- ----------------------------------------------------------------------------
186 -- |---------------------< check_valid_classes_available >---------------------|
187 -- ----------------------------------------------------------------------------
188 -- {Start Of Comments}
189 --
190 -- Description:
191 -- Validates whether prerequisite course contains valid classes or not.
192 -- Course should have associated offering and valid classes. Valid classes
193 -- include classes whose class type is SCHEDULED or SELFPACED and whose
194 -- class status is not Cancelled
195 --
196 -- Prerequisites:
197 -- This private procedure is called from insert_validate.
198 --
199 -- In Parameters:
200 -- p_prerequisite_course_id
201 --
202 -- Post Success:
203 -- Processing continues.
204 --
205 -- Post Failure:
206 -- If a business rules fails the error will not be handled by this procedure
207 -- unless explicity coded.
208 --
209 -- Developer Implementation Notes:
210 --
211 --
212 -- Access Status:
213 -- Internal Row Handler Use Only.
214 --
215 -- {End Of Comments}
216 -- ----------------------------------------------------------------------------
217 Procedure check_valid_classes_available
218 (p_prerequisite_course_id in number
219 );
220 --
221 -- ----------------------------------------------------------------------------
222 -- |---------------------< check_course_chaining >----------------------------|
223 -- ----------------------------------------------------------------------------
224 -- {Start Of Comments}
225 --
226 -- Description:
227 -- Validates whether specifying prerequisite course for a course results in
228 -- course chaining or not.
229 --
230 -- Prerequisites:
231 -- This private procedure is called from insert_validate.
232 --
233 -- In Parameters:
234 -- p_activity_version_id
235 -- p_prerequisite_course_id
236 --
237 -- Post Success:
238 -- Processing continues.
239 --
240 -- Post Failure:
241 -- If a business rules fails the error will not be handled by this procedure
242 -- unless explicity coded.
243 --
244 -- Developer Implementation Notes:
245 --
246 --
247 -- Access Status:
248 -- Internal Row Handler Use Only.
249 --
250 -- {End Of Comments}
251 -- ----------------------------------------------------------------------------
252
253 Procedure check_course_chaining
254 (
255 p_activity_version_id in number
256 ,p_prerequisite_course_id in number
257 );
258 --
259 -- ----------------------------------------------------------------------------
260 -- |---------------------------< insert_validate >----------------------------|
261 -- ----------------------------------------------------------------------------
262 -- {Start of comments}
263 --
264 -- Description:
265 -- This procedure controls the execution of all insert business rules
266 -- validation.
267 --
268 -- Prerequisites:
269 -- This private procedure is called from ins procedure.
270 --
271 -- In Parameters:
272 -- A Pl/Sql record structure.
273 --
274 -- Post Success:
275 -- Processing continues.
276 --
277 -- Post Failure:
278 -- If a business rules fails the error will not be handled by this procedure
279 -- unless explicity coded.
280 --
281 -- Developer Implementation Notes:
282 -- For insert, your business rules should be executed from this procedure
283 -- and should ideally (unless really necessary) just be straight procedure
284 -- or function calls. Try and avoid using conditional branching logic.
285 --
286 -- Access Status:
287 -- Internal Row Handler Use Only.
288 --
289 -- {End of comments}
290 -- ----------------------------------------------------------------------------
291 Procedure insert_validate
292 (p_effective_date in date
293 ,p_rec in ota_cpr_shd.g_rec_type
294 );
295 --
296 -- ----------------------------------------------------------------------------
297 -- |---------------------------< update_validate >----------------------------|
298 -- ----------------------------------------------------------------------------
299 -- {Start Of Comments}
300 --
301 -- Description:
302 -- This procedure controls the execution of all update business rules
303 -- validation.
304 --
305 -- Prerequisites:
306 -- This private procedure is called from upd procedure.
307 --
308 -- In Parameters:
309 -- A Pl/Sql record structure.
310 --
311 -- Post Success:
312 -- Processing continues.
313 --
314 -- Post Failure:
315 -- If a business rules fails the error will not be handled by this procedure
316 -- unless explicity coded.
317 --
318 -- Access Status:
319 -- Internal Row Handler Use Only.
320 --
321 -- {End Of Comments}
322 -- ----------------------------------------------------------------------------
323 Procedure update_validate
324 (p_effective_date in date
325 ,p_rec in ota_cpr_shd.g_rec_type
326 );
327 --
328 -- ----------------------------------------------------------------------------
329 -- |---------------------------< delete_validate >----------------------------|
330 -- ----------------------------------------------------------------------------
331 -- {Start Of Comments}
332 --
333 -- Description:
334 -- This procedure controls the execution of all delete business rules
335 -- validation.
336 --
337 -- Prerequisites:
338 -- This private procedure is called from del procedure.
339 --
340 -- In Parameters:
341 -- A Pl/Sql record structure.
342 --
343 -- Post Success:
344 -- Processing continues.
345 --
346 -- Post Failure:
347 -- If a business rules fails the error will not be handled by this procedure
348 -- unless explicity coded.
349 --
350 -- Developer Implementation Notes:
351 -- For delete, your business rules should be executed from this procedure
352 -- and should ideally (unless really necessary) just be straight procedure
353 -- or function calls. Try and avoid using conditional branching logic.
354 --
355 -- Access Status:
356 -- Internal Row Handler Use Only.
357 --
358 -- {End Of Comments}
359 -- ----------------------------------------------------------------------------
360 Procedure delete_validate
361 (p_rec in ota_cpr_shd.g_rec_type
362 );
363 --
364 end ota_cpr_bus;