1: PACKAGE BODY WF_ROUTE AS
2: /* $Header: wfrtgb.pls 120.4 2006/04/06 09:31:41 rwunderl ship $ */
3:
4: --
5: -- Error (PRIVATE)
42:
43: return owner;
44: exception
45: when others then
46: wf_core.context('Wf_Route', 'RuleOwner', to_char(ruleid));
47: raise;
48: end RuleOwner;
49:
50: --
89:
90: return(user);
91: exception
92: when others then
93: wf_core.context('Wf_Route', 'Authenticate', user);
94: raise;
95: end Authenticate;
96:
97: --
126: exception
127: when no_data_found then
128: return(FALSE);
129: when others then
130: wf_core.context('Wf_Route', 'GetAttrValue', to_char(ruleid), attrname);
131: raise;
132: end GetAttrValue;
133:
134: --
157: exception
158: when no_data_found then
159: return(lcode);
160: when others then
161: wf_core.context('Wf_Route', 'GetLookupMeaning', ltype, lcode);
162: raise;
163: end GetLookupMeaning;
164:
165: --
241: return(value);
242:
243: exception
244: when others then
245: wf_core.context('Wf_Route', 'GetDisplayWindow', type, format,
246: tvalue, to_char(nvalue), to_char(dvalue));
247: raise;
248: end GetDisplayValue;
249:
303: cattributes=>'id=""');
304:
305: exception
306: when others then
307: wf_core.context('Wf_route', 'GetRole', name, seq);
308: raise;
309: end GetRole;
310:
311:
371: end if;
372:
373: exception
374: when others then
375: wf_core.context('Wf_Route', 'GetLookup', name, value, format, seq);
376: raise;
377: end GetLookup;
378:
379: -- GetDocument (PRIVATE)
419: cattributes=>'id=""');
420:
421: exception
422: when others then
423: wf_core.context('Wf_route', 'GetDocument', name, format, dvalue);
424: raise;
425: end GetDocument;
426:
427: --
480: cattributes=>'id=""');
481: end if;
482: exception
483: when others then
484: wf_core.context('Wf_Route', 'GetField', name, type, format, dvalue,
485: index_num);
486: raise;
487: end GetField;
488:
527: end;
528:
529: exception
530: when others then
531: wf_core.context('Wf_Route', 'ValidateRole', role);
532: raise;
533: end ValidateRole;
534:
535: --
590:
591: return(datebuf);
592: exception
593: when others then
594: wf_core.context('Wf_Route', 'StringToDate', dstring);
595: raise;
596: end StringToDate;
597:
598: --
691: );
692: end if;
693: exception
694: when others then
695: wf_core.context('Wf_Route', 'SetAttribute',
696: to_char(ruleid), attr_name_type, attr_value);
697: raise;
698: end SetAttribute;
699:
711: is
712: owner varchar2(320);
713: begin
714: -- Validate access
715: owner := Wf_Route.Authenticate(user);
716:
717: -- Delete this rule along with any child attributes
718: delete from WF_ROUTING_RULE_ATTRIBUTES
719: where RULE_ID = ruleid;
721: delete from WF_ROUTING_RULES
722: where RULE_ID = ruleid;
723:
724: -- Return to opening page
725: Wf_Route.List(user, '--EDITSCREEN--');
726: exception
727: when others then
728: wf_core.context('Wf_Route', 'DeleteRule', ruleid, user);
729: wf_route.error;
724: -- Return to opening page
725: Wf_Route.List(user, '--EDITSCREEN--');
726: exception
727: when others then
728: wf_core.context('Wf_Route', 'DeleteRule', ruleid, user);
729: wf_route.error;
730: end;
731:
732: --
725: Wf_Route.List(user, '--EDITSCREEN--');
726: exception
727: when others then
728: wf_core.context('Wf_Route', 'DeleteRule', ruleid, user);
729: wf_route.error;
730: end;
731:
732: --
733: -- SubmitUpdate
773: CANCEL_RECORD exception;
774: begin
775: -- Find rule owner and validate access
776: nruleid := to_number(rule_id);
777: owner := Wf_Route.RuleOwner(nruleid);
778: owner := Wf_Route.Authenticate(owner);
779: wf_directory.GetRoleInfo(owner, realname, s0, s0, s0, s0);
780:
781: l_action := substrb(action, 1, 30);
774: begin
775: -- Find rule owner and validate access
776: nruleid := to_number(rule_id);
777: owner := Wf_Route.RuleOwner(nruleid);
778: owner := Wf_Route.Authenticate(owner);
779: wf_directory.GetRoleInfo(owner, realname, s0, s0, s0, s0);
780:
781: l_action := substrb(action, 1, 30);
782:
845: end if;
846: end if;
847:
848: -- Go back to the List page
849: owa_util.redirect_url(curl=>wfa_html.base_url || '/wf_route.list?user='||owner||'&display_user=--EDITSCREEN--',
850: bclose_header=>TRUE);
851:
852: exception
853: when CANCEL_RECORD then
850: bclose_header=>TRUE);
851:
852: exception
853: when CANCEL_RECORD then
854: Wf_Route.List(owner);
855:
856: when others then
857: wf_core.context('Wf_Route', 'SubmitUpdate', rule_id, action,
858: action_argument, begin_date, end_date);
853: when CANCEL_RECORD then
854: Wf_Route.List(owner);
855:
856: when others then
857: wf_core.context('Wf_Route', 'SubmitUpdate', rule_id, action,
858: action_argument, begin_date, end_date);
859: wf_route.error;
860: end SubmitUpdate;
861:
855:
856: when others then
857: wf_core.context('Wf_Route', 'SubmitUpdate', rule_id, action,
858: action_argument, begin_date, end_date);
859: wf_route.error;
860: end SubmitUpdate;
861:
862: --
863: -- UpdateRule
953:
954: begin
955: -- Find rule owner and validate access
956: nruleid := to_number(ruleid);
957: owner := Wf_Route.RuleOwner(nruleid);
958: owner := Wf_Route.Authenticate(owner);
959: wf_directory.GetRoleInfo(owner, realname, s0, s0, s0, s0);
960:
961: -- Get rule data
954: begin
955: -- Find rule owner and validate access
956: nruleid := to_number(ruleid);
957: owner := Wf_Route.RuleOwner(nruleid);
958: owner := Wf_Route.Authenticate(owner);
959: wf_directory.GetRoleInfo(owner, realname, s0, s0, s0, s0);
960:
961: -- Get rule data
962: open rulecurs;