76: -- select all organizations in scope for the certification
77: CURSOR get_all_orgs
78: IS
79: SELECT DISTINCT organization_id
80: FROM amw_execution_scope
81: WHERE entity_type = 'BUSIPROC_CERTIFICATION'
82: AND entity_id = p_certification_id
83: AND organization_id is not null;
84:
267:
268: CURSOR get_all_processes
269: IS
270: SELECT count(distinct process_id)
271: FROM amw_execution_scope
272: WHERE organization_id = p_org_id
273: AND entity_id = p_certification_id
274: ---07.05.2005 npanandi: added entity_type below, bugfix for bug 4471783
275: AND entity_type = 'BUSIPROC_CERTIFICATION';
278: --change object_name to 'AMW_ORG_PROCESS' from 'AMW_PROCESS_ORG'
279: CURSOR get_certified_processes
280: IS
281: SELECT count(DISTINCT process_id)
282: FROM amw_execution_scope amw_exec
283: WHERE EXISTS (SELECT opinion.opinion_id
284: FROM amw_opinions_v opinion
285: WHERE opinion.pk1_value = amw_exec.process_id
286: AND opinion.pk3_value = p_org_id
293: --change object_name to 'AMW_ORG_PROCESS' from 'AMW_PROCESS_ORG'
294: CURSOR get_proc_cert_issues
295: IS
296: SELECT count(DISTINCT process_id)
297: FROM amw_execution_scope amw_exec
298: WHERE EXISTS (SELECT opinion.opinion_id
299: FROM amw_opinions_v opinion
300: WHERE opinion.pk1_value = amw_exec.process_id
301: AND opinion.pk3_value = p_org_id
311: --add entity_type and entity_id
312: CURSOR get_evaluated_processes
313: IS
314: SELECT count(DISTINCT process_id)
315: FROM amw_execution_scope amw_exec
316: WHERE amw_exec.entity_type = 'BUSIPROC_CERTIFICATION'
317: AND amw_exec.entity_id = p_certification_id
318: AND EXISTS (SELECT opinion.opinion_id
319: FROM amw_opinions_v opinion
336: --add entity_type and entity_id
337: CURSOR get_ineffective_processes
338: IS
339: SELECT count(DISTINCT process_id)
340: FROM amw_execution_scope amw_exec
341: WHERE amw_exec.entity_type = 'BUSIPROC_CERTIFICATION'
342: AND amw_exec.entity_id = p_certification_id
343: AND EXISTS (SELECT opinion.opinion_id
344: FROM amw_opinions_v opinion
413:
414: CURSOR get_top_org_processes
415: IS
416: SELECT count(distinct aes.process_id)
417: FROM amw_execution_scope aes
418: WHERE aes.entity_type = 'BUSIPROC_CERTIFICATION'
419: AND aes.level_id = 4
420: AND aes.parent_process_id = -1
421: AND aes.entity_id = p_certification_id
423:
424: CURSOR get_top_orgproc_pend_cert
425: IS
426: SELECT count(distinct aes.process_id)
427: FROM amw_execution_scope aes
428: WHERE aes.entity_type = 'BUSIPROC_CERTIFICATION'
429: AND aes.level_id = 4
430: AND aes.parent_process_id = -1 --need to verify if this is -2
431: AND aes.entity_id = p_certification_id