1: package body WF_PROCESS_ACTIVITY as
2: /* $Header: wfengb.pls 120.38.12020000.3 2012/11/13 19:42:45 alsosa ship $ */
3:
4: type InstanceArrayTyp is table of pls_integer
5: index by binary_integer;
19: --
20: procedure ClearCache
21: is
22: begin
23: wf_process_activity.c_itemtype := '';
24: wf_process_activity.c_itemkey := '';
25: wf_process_activity.c_process := '';
26: wf_process_activity.c_rootid := '';
27: exception
20: procedure ClearCache
21: is
22: begin
23: wf_process_activity.c_itemtype := '';
24: wf_process_activity.c_itemkey := '';
25: wf_process_activity.c_process := '';
26: wf_process_activity.c_rootid := '';
27: exception
28: when others then
21: is
22: begin
23: wf_process_activity.c_itemtype := '';
24: wf_process_activity.c_itemkey := '';
25: wf_process_activity.c_process := '';
26: wf_process_activity.c_rootid := '';
27: exception
28: when others then
29: Wf_Core.Context('Wf_Process_Activity', 'ClearCache');
22: begin
23: wf_process_activity.c_itemtype := '';
24: wf_process_activity.c_itemkey := '';
25: wf_process_activity.c_process := '';
26: wf_process_activity.c_rootid := '';
27: exception
28: when others then
29: Wf_Core.Context('Wf_Process_Activity', 'ClearCache');
30: raise;
25: wf_process_activity.c_process := '';
26: wf_process_activity.c_rootid := '';
27: exception
28: when others then
29: Wf_Core.Context('Wf_Process_Activity', 'ClearCache');
30: raise;
31: end ClearCache;
32:
33: --
55: actdate date;
56: instid pls_integer;
57: begin
58: -- Check cache for a valid value
59: if ((itemtype = wf_process_activity.c_itemtype) and
60: (itemkey = wf_process_activity.c_itemkey) and
61: (process = wf_process_activity.c_process)) then
62: return(wf_process_activity.c_rootid);
63: end if;
56: instid pls_integer;
57: begin
58: -- Check cache for a valid value
59: if ((itemtype = wf_process_activity.c_itemtype) and
60: (itemkey = wf_process_activity.c_itemkey) and
61: (process = wf_process_activity.c_process)) then
62: return(wf_process_activity.c_rootid);
63: end if;
64:
57: begin
58: -- Check cache for a valid value
59: if ((itemtype = wf_process_activity.c_itemtype) and
60: (itemkey = wf_process_activity.c_itemkey) and
61: (process = wf_process_activity.c_process)) then
62: return(wf_process_activity.c_rootid);
63: end if;
64:
65: -- No joy. Select a new value.
58: -- Check cache for a valid value
59: if ((itemtype = wf_process_activity.c_itemtype) and
60: (itemkey = wf_process_activity.c_itemkey) and
61: (process = wf_process_activity.c_process)) then
62: return(wf_process_activity.c_rootid);
63: end if;
64:
65: -- No joy. Select a new value.
66: actdate := Wf_Item.Active_Date(itemtype, itemkey);
77: and PA.PROCESS_VERSION = A.VERSION
78: and PA.INSTANCE_LABEL = process;
79:
80: -- Save value to cache
81: wf_process_activity.c_itemtype := itemtype;
82: wf_process_activity.c_itemkey := itemkey;
83: wf_process_activity.c_process := process;
84: wf_process_activity.c_rootid := instid;
85:
78: and PA.INSTANCE_LABEL = process;
79:
80: -- Save value to cache
81: wf_process_activity.c_itemtype := itemtype;
82: wf_process_activity.c_itemkey := itemkey;
83: wf_process_activity.c_process := process;
84: wf_process_activity.c_rootid := instid;
85:
86: return instid;
79:
80: -- Save value to cache
81: wf_process_activity.c_itemtype := itemtype;
82: wf_process_activity.c_itemkey := itemkey;
83: wf_process_activity.c_process := process;
84: wf_process_activity.c_rootid := instid;
85:
86: return instid;
87:
80: -- Save value to cache
81: wf_process_activity.c_itemtype := itemtype;
82: wf_process_activity.c_itemkey := itemkey;
83: wf_process_activity.c_process := process;
84: wf_process_activity.c_rootid := instid;
85:
86: return instid;
87:
88: exception
88: exception
89: when NO_DATA_FOUND then
90: return '';
91: when OTHERS then
92: Wf_Core.Context('Wf_Process_Activity', 'RootInstanceId', itemtype,
93: itemkey, process);
94: raise;
95: end RootInstanceId;
96:
133: Wf_Core.Token('ACTID', to_char(actid));
134: Wf_Core.Token('DATE', '');
135: Wf_Core.Raise('WFENG_ACTID');
136: when others then
137: Wf_Core.Context('Wf_Process_Activity', 'ActivityName', to_char(actid));
138: raise;
139: end ActivityName;
140:
141: --
180:
181: return instid;
182: exception
183: when no_data_found then
184: Wf_Core.Context('Wf_Process_Activity', 'StartInstanceId', itemtype,
185: process, to_char(version), activity);
186: Wf_Core.Token('TYPE', itemtype);
187: Wf_Core.Token('PROCESS', process);
188: Wf_Core.Token('NAME', activity);
187: Wf_Core.Token('PROCESS', process);
188: Wf_Core.Token('NAME', activity);
189: Wf_Core.Raise('WFENG_NOT_START');
190: when too_many_rows then
191: Wf_Core.Context('Wf_Process_Activity', 'StartInstanceId', itemtype,
192: process, to_char(version), activity);
193: Wf_Core.Token('TYPE', itemtype);
194: Wf_Core.Token('PROCESS', process);
195: Wf_Core.Token('NAME', activity);
194: Wf_Core.Token('PROCESS', process);
195: Wf_Core.Token('NAME', activity);
196: Wf_Core.Raise('WFENG_ACTIVITY_UNIQUE');
197: when others then
198: Wf_Core.Context('Wf_Process_Activity', 'StartInstanceId', itemtype,
199: process, to_char(version), activity);
200: raise;
201: end StartInstanceId;
202:
282: exception
283: when no_data_found then
284: return '';
285: when too_many_rows then
286: Wf_Core.Context('Wf_Process_Activity', 'ActiveInstanceId', itemtype,
287: itemkey, activity, status);
288: Wf_Core.Token('TYPE', itemtype);
289: Wf_Core.Token('KEY', itemkey);
290: Wf_Core.Token('NAME', activity);
289: Wf_Core.Token('KEY', itemkey);
290: Wf_Core.Token('NAME', activity);
291: Wf_Core.Raise('WFENG_ITEM_ACTIVITY_UNIQUE');
292: when others then
293: Wf_Core.Context('Wf_Process_Activity', 'ActiveInstanceId', itemtype,
294: itemkey, activity, status);
295: raise;
296: end ActiveInstanceId;
297:
473: -- If you made it here the activity was not found anywhere in the tree.
474: return(FALSE);
475: exception
476: when OTHERS then
477: Wf_Core.Context('Wf_Process_Activity', 'IsChild', to_char(rootid),
478: acttype, actname, to_char(actdate));
479: raise;
480: end IsChild;
481:
606: -- will still be null.
607: return(actid);
608: exception
609: when wf_dup_activity then
610: Wf_Core.Context('Wf_Process_Activity', 'FindActivity', to_char(parentid),
611: activity, to_char(actdate));
612: Wf_Core.Token('NAME', activity);
613: Wf_Core.Raise('WFENG_ACTIVITY_UNIQUE');
614: when OTHERS then
611: activity, to_char(actdate));
612: Wf_Core.Token('NAME', activity);
613: Wf_Core.Raise('WFENG_ACTIVITY_UNIQUE');
614: when OTHERS then
615: Wf_Core.Context('Wf_Process_Activity', 'FindActivity', to_char(parentid),
616: activity, to_char(actdate));
617: raise;
618: end FindActivity;
619:
616: activity, to_char(actdate));
617: raise;
618: end FindActivity;
619:
620: end WF_PROCESS_ACTIVITY;