DBA Data[Home] [Help]

APPS.WF_ENGINE_UTIL dependencies on WF_ENGINE

Line 1: package body WF_ENGINE_UTIL as

1: package body WF_ENGINE_UTIL as
2: /* $Header: wfengb.pls 120.25.12010000.3 2008/10/28 15:19:48 alepe ship $ */
3:
4: type InstanceArrayTyp is table of pls_integer
5: index by binary_integer;

Line 56: wf_engine_util.app_itemtype := '';

52: -- Clear runtime cache
53: procedure ClearCache
54: is
55: begin
56: wf_engine_util.app_itemtype := '';
57: wf_engine_util.app_itemkey := '';
58: wf_engine_util.app_level := '';
59: exception
60: when others then

Line 57: wf_engine_util.app_itemkey := '';

53: procedure ClearCache
54: is
55: begin
56: wf_engine_util.app_itemtype := '';
57: wf_engine_util.app_itemkey := '';
58: wf_engine_util.app_level := '';
59: exception
60: when others then
61: Wf_Core.Context('Wf_Engine_Util', 'ClearCache');

Line 58: wf_engine_util.app_level := '';

54: is
55: begin
56: wf_engine_util.app_itemtype := '';
57: wf_engine_util.app_itemkey := '';
58: wf_engine_util.app_level := '';
59: exception
60: when others then
61: Wf_Core.Context('Wf_Engine_Util', 'ClearCache');
62: raise;

Line 61: Wf_Core.Context('Wf_Engine_Util', 'ClearCache');

57: wf_engine_util.app_itemkey := '';
58: wf_engine_util.app_level := '';
59: exception
60: when others then
61: Wf_Core.Context('Wf_Engine_Util', 'ClearCache');
62: raise;
63: end ClearCache;
64:
65: --

Line 93: if (itemkey = wf_engine.eng_synch) then

89: -- while a synch process is still running. In that case you will
90: -- should eventually get an error from app for the process 1
91: -- because process 2 has trashed the stack. Can't think of a way to
92: -- detect the error directly here.
93: if (itemkey = wf_engine.eng_synch) then
94: if ((not rootflag) and
95: ((nvl(wf_engine_util.app_itemtype, 'x') <> itemtype) or
96: (nvl(wf_engine_util.app_itemkey, 'x') <> itemkey))) then
97: Wf_Core.Token('ITEMTYPE', itemtype);

Line 95: ((nvl(wf_engine_util.app_itemtype, 'x') <> itemtype) or

91: -- because process 2 has trashed the stack. Can't think of a way to
92: -- detect the error directly here.
93: if (itemkey = wf_engine.eng_synch) then
94: if ((not rootflag) and
95: ((nvl(wf_engine_util.app_itemtype, 'x') <> itemtype) or
96: (nvl(wf_engine_util.app_itemkey, 'x') <> itemkey))) then
97: Wf_Core.Token('ITEMTYPE', itemtype);
98: Wf_Core.Token('ITEMKEY', itemkey);
99: Wf_Core.Raise('WFENG_SYNCH_ITEM');

Line 96: (nvl(wf_engine_util.app_itemkey, 'x') <> itemkey))) then

92: -- detect the error directly here.
93: if (itemkey = wf_engine.eng_synch) then
94: if ((not rootflag) and
95: ((nvl(wf_engine_util.app_itemtype, 'x') <> itemtype) or
96: (nvl(wf_engine_util.app_itemkey, 'x') <> itemkey))) then
97: Wf_Core.Token('ITEMTYPE', itemtype);
98: Wf_Core.Token('ITEMKEY', itemkey);
99: Wf_Core.Raise('WFENG_SYNCH_ITEM');
100: end if;

Line 106: (nvl(wf_engine_util.app_itemtype, 'x') <> itemtype) or

102:
103: -- If this is the root process, OR this is a different item,
104: -- then re-initialize the stack.
105: if ((rootflag) or
106: (nvl(wf_engine_util.app_itemtype, 'x') <> itemtype) or
107: (nvl(wf_engine_util.app_itemkey, 'x') <> itemkey)) then
108: wf_engine_util.app_itemtype := itemtype;
109: wf_engine_util.app_itemkey := itemkey;
110: wf_engine_util.app_level := 0;

Line 107: (nvl(wf_engine_util.app_itemkey, 'x') <> itemkey)) then

103: -- If this is the root process, OR this is a different item,
104: -- then re-initialize the stack.
105: if ((rootflag) or
106: (nvl(wf_engine_util.app_itemtype, 'x') <> itemtype) or
107: (nvl(wf_engine_util.app_itemkey, 'x') <> itemkey)) then
108: wf_engine_util.app_itemtype := itemtype;
109: wf_engine_util.app_itemkey := itemkey;
110: wf_engine_util.app_level := 0;
111: end if;

Line 108: wf_engine_util.app_itemtype := itemtype;

104: -- then re-initialize the stack.
105: if ((rootflag) or
106: (nvl(wf_engine_util.app_itemtype, 'x') <> itemtype) or
107: (nvl(wf_engine_util.app_itemkey, 'x') <> itemkey)) then
108: wf_engine_util.app_itemtype := itemtype;
109: wf_engine_util.app_itemkey := itemkey;
110: wf_engine_util.app_level := 0;
111: end if;
112:

Line 109: wf_engine_util.app_itemkey := itemkey;

105: if ((rootflag) or
106: (nvl(wf_engine_util.app_itemtype, 'x') <> itemtype) or
107: (nvl(wf_engine_util.app_itemkey, 'x') <> itemkey)) then
108: wf_engine_util.app_itemtype := itemtype;
109: wf_engine_util.app_itemkey := itemkey;
110: wf_engine_util.app_level := 0;
111: end if;
112:
113: -- Add the process to the stack

Line 110: wf_engine_util.app_level := 0;

106: (nvl(wf_engine_util.app_itemtype, 'x') <> itemtype) or
107: (nvl(wf_engine_util.app_itemkey, 'x') <> itemkey)) then
108: wf_engine_util.app_itemtype := itemtype;
109: wf_engine_util.app_itemkey := itemkey;
110: wf_engine_util.app_level := 0;
111: end if;
112:
113: -- Add the process to the stack
114: wf_engine_util.app_level := wf_engine_util.app_level + 1;

Line 114: wf_engine_util.app_level := wf_engine_util.app_level + 1;

110: wf_engine_util.app_level := 0;
111: end if;
112:
113: -- Add the process to the stack
114: wf_engine_util.app_level := wf_engine_util.app_level + 1;
115: wf_engine_util.app_parent_itemtype(wf_engine_util.app_level) := act_itemtype;
116: wf_engine_util.app_parent_name(wf_engine_util.app_level) := act_name;
117: wf_engine_util.app_parent_id(wf_engine_util.app_level) := actid;
118: exception

Line 115: wf_engine_util.app_parent_itemtype(wf_engine_util.app_level) := act_itemtype;

111: end if;
112:
113: -- Add the process to the stack
114: wf_engine_util.app_level := wf_engine_util.app_level + 1;
115: wf_engine_util.app_parent_itemtype(wf_engine_util.app_level) := act_itemtype;
116: wf_engine_util.app_parent_name(wf_engine_util.app_level) := act_name;
117: wf_engine_util.app_parent_id(wf_engine_util.app_level) := actid;
118: exception
119: when others then

Line 116: wf_engine_util.app_parent_name(wf_engine_util.app_level) := act_name;

112:
113: -- Add the process to the stack
114: wf_engine_util.app_level := wf_engine_util.app_level + 1;
115: wf_engine_util.app_parent_itemtype(wf_engine_util.app_level) := act_itemtype;
116: wf_engine_util.app_parent_name(wf_engine_util.app_level) := act_name;
117: wf_engine_util.app_parent_id(wf_engine_util.app_level) := actid;
118: exception
119: when others then
120: Wf_Core.Context('Wf_Engine_Util', 'AddProcessStack',

Line 117: wf_engine_util.app_parent_id(wf_engine_util.app_level) := actid;

113: -- Add the process to the stack
114: wf_engine_util.app_level := wf_engine_util.app_level + 1;
115: wf_engine_util.app_parent_itemtype(wf_engine_util.app_level) := act_itemtype;
116: wf_engine_util.app_parent_name(wf_engine_util.app_level) := act_name;
117: wf_engine_util.app_parent_id(wf_engine_util.app_level) := actid;
118: exception
119: when others then
120: Wf_Core.Context('Wf_Engine_Util', 'AddProcessStack',
121: itemtype, itemkey, act_itemtype, act_name, to_char(actid));

Line 120: Wf_Core.Context('Wf_Engine_Util', 'AddProcessStack',

116: wf_engine_util.app_parent_name(wf_engine_util.app_level) := act_name;
117: wf_engine_util.app_parent_id(wf_engine_util.app_level) := actid;
118: exception
119: when others then
120: Wf_Core.Context('Wf_Engine_Util', 'AddProcessStack',
121: itemtype, itemkey, act_itemtype, act_name, to_char(actid));
122: raise;
123: end AddProcessStack;
124:

Line 143: if (nvl(wf_engine_util.app_level, 0) > 0) then

139: begin
140: -- If this is the top process on the stack, pop it off.
141: -- Must check if type/key/actid match, in case items and processes
142: -- are being interwoven and this is not the correct stack.
143: if (nvl(wf_engine_util.app_level, 0) > 0) then
144: if ((wf_engine_util.app_itemtype = itemtype) and
145: (wf_engine_util.app_itemkey = itemkey) and
146: (wf_engine_util.app_parent_id(wf_engine_util.app_level) = actid)) then
147: wf_engine_util.app_level := wf_engine_util.app_level - 1;

Line 144: if ((wf_engine_util.app_itemtype = itemtype) and

140: -- If this is the top process on the stack, pop it off.
141: -- Must check if type/key/actid match, in case items and processes
142: -- are being interwoven and this is not the correct stack.
143: if (nvl(wf_engine_util.app_level, 0) > 0) then
144: if ((wf_engine_util.app_itemtype = itemtype) and
145: (wf_engine_util.app_itemkey = itemkey) and
146: (wf_engine_util.app_parent_id(wf_engine_util.app_level) = actid)) then
147: wf_engine_util.app_level := wf_engine_util.app_level - 1;
148: end if;

Line 145: (wf_engine_util.app_itemkey = itemkey) and

141: -- Must check if type/key/actid match, in case items and processes
142: -- are being interwoven and this is not the correct stack.
143: if (nvl(wf_engine_util.app_level, 0) > 0) then
144: if ((wf_engine_util.app_itemtype = itemtype) and
145: (wf_engine_util.app_itemkey = itemkey) and
146: (wf_engine_util.app_parent_id(wf_engine_util.app_level) = actid)) then
147: wf_engine_util.app_level := wf_engine_util.app_level - 1;
148: end if;
149: end if;

Line 146: (wf_engine_util.app_parent_id(wf_engine_util.app_level) = actid)) then

142: -- are being interwoven and this is not the correct stack.
143: if (nvl(wf_engine_util.app_level, 0) > 0) then
144: if ((wf_engine_util.app_itemtype = itemtype) and
145: (wf_engine_util.app_itemkey = itemkey) and
146: (wf_engine_util.app_parent_id(wf_engine_util.app_level) = actid)) then
147: wf_engine_util.app_level := wf_engine_util.app_level - 1;
148: end if;
149: end if;
150: exception

Line 147: wf_engine_util.app_level := wf_engine_util.app_level - 1;

143: if (nvl(wf_engine_util.app_level, 0) > 0) then
144: if ((wf_engine_util.app_itemtype = itemtype) and
145: (wf_engine_util.app_itemkey = itemkey) and
146: (wf_engine_util.app_parent_id(wf_engine_util.app_level) = actid)) then
147: wf_engine_util.app_level := wf_engine_util.app_level - 1;
148: end if;
149: end if;
150: exception
151: when others then

Line 152: Wf_Core.Context('Wf_Engine_Util', 'RemoveProcessStack', itemtype,

148: end if;
149: end if;
150: exception
151: when others then
152: Wf_Core.Context('Wf_Engine_Util', 'RemoveProcessStack', itemtype,
153: itemkey, to_char(actid));
154: raise;
155: end RemoveProcessStack;
156:

Line 196: if ((nvl(wf_engine_util.app_level, 0) > 0) and

192: -- 1. Itemtype and key
193: -- 2. Parent type and name
194: -- are the same, then the parent id must be the same.
195: -- Return it directly.
196: if ((nvl(wf_engine_util.app_level, 0) > 0) and
197: (itemtype = wf_engine_util.app_itemtype) and
198: (itemkey = wf_engine_util.app_itemkey)) then
199: for i in reverse 1 .. wf_engine_util.app_level loop
200: if ((WF_CACHE.ProcessActivities(actid).PROCESS_ITEM_TYPE =

Line 197: (itemtype = wf_engine_util.app_itemtype) and

193: -- 2. Parent type and name
194: -- are the same, then the parent id must be the same.
195: -- Return it directly.
196: if ((nvl(wf_engine_util.app_level, 0) > 0) and
197: (itemtype = wf_engine_util.app_itemtype) and
198: (itemkey = wf_engine_util.app_itemkey)) then
199: for i in reverse 1 .. wf_engine_util.app_level loop
200: if ((WF_CACHE.ProcessActivities(actid).PROCESS_ITEM_TYPE =
201: wf_engine_util.app_parent_itemtype(i)) and

Line 198: (itemkey = wf_engine_util.app_itemkey)) then

194: -- are the same, then the parent id must be the same.
195: -- Return it directly.
196: if ((nvl(wf_engine_util.app_level, 0) > 0) and
197: (itemtype = wf_engine_util.app_itemtype) and
198: (itemkey = wf_engine_util.app_itemkey)) then
199: for i in reverse 1 .. wf_engine_util.app_level loop
200: if ((WF_CACHE.ProcessActivities(actid).PROCESS_ITEM_TYPE =
201: wf_engine_util.app_parent_itemtype(i)) and
202: (WF_CACHE.ProcessActivities(actid).PROCESS_NAME =

Line 199: for i in reverse 1 .. wf_engine_util.app_level loop

195: -- Return it directly.
196: if ((nvl(wf_engine_util.app_level, 0) > 0) and
197: (itemtype = wf_engine_util.app_itemtype) and
198: (itemkey = wf_engine_util.app_itemkey)) then
199: for i in reverse 1 .. wf_engine_util.app_level loop
200: if ((WF_CACHE.ProcessActivities(actid).PROCESS_ITEM_TYPE =
201: wf_engine_util.app_parent_itemtype(i)) and
202: (WF_CACHE.ProcessActivities(actid).PROCESS_NAME =
203: wf_engine_util.app_parent_name(i))) then

Line 201: wf_engine_util.app_parent_itemtype(i)) and

197: (itemtype = wf_engine_util.app_itemtype) and
198: (itemkey = wf_engine_util.app_itemkey)) then
199: for i in reverse 1 .. wf_engine_util.app_level loop
200: if ((WF_CACHE.ProcessActivities(actid).PROCESS_ITEM_TYPE =
201: wf_engine_util.app_parent_itemtype(i)) and
202: (WF_CACHE.ProcessActivities(actid).PROCESS_NAME =
203: wf_engine_util.app_parent_name(i))) then
204: -- Found a match.
205: return(wf_engine_util.app_parent_id(i));

Line 203: wf_engine_util.app_parent_name(i))) then

199: for i in reverse 1 .. wf_engine_util.app_level loop
200: if ((WF_CACHE.ProcessActivities(actid).PROCESS_ITEM_TYPE =
201: wf_engine_util.app_parent_itemtype(i)) and
202: (WF_CACHE.ProcessActivities(actid).PROCESS_NAME =
203: wf_engine_util.app_parent_name(i))) then
204: -- Found a match.
205: return(wf_engine_util.app_parent_id(i));
206: end if;
207: end loop;

Line 205: return(wf_engine_util.app_parent_id(i));

201: wf_engine_util.app_parent_itemtype(i)) and
202: (WF_CACHE.ProcessActivities(actid).PROCESS_NAME =
203: wf_engine_util.app_parent_name(i))) then
204: -- Found a match.
205: return(wf_engine_util.app_parent_id(i));
206: end if;
207: end loop;
208: end if;
209:

Line 212: if (itemkey = wf_engine.eng_synch) then

208: end if;
209:
210: -- SYNCHMODE: If we don't have a match in the cache, then some restricted
211: -- activity must have happened. Raise an error.
212: if (itemkey = wf_engine.eng_synch) then
213: Wf_Core.Token('ITEMTYPE', itemtype);
214: Wf_Core.Token('ITEMKEY', itemkey);
215: Wf_Core.Raise('WFENG_SYNCH_ITEM');
216: end if;

Line 246: Wf_Engine_Util.AddProcessStack(itemtype, itemkey,

242: AND WIAS.ITEM_TYPE = activity_parent_process.itemtype
243: AND WIAS.ITEM_KEY = activity_parent_process.itemkey;
244:
245: -- Re-initialize process stack, starting with the new value
246: Wf_Engine_Util.AddProcessStack(itemtype, itemkey,
247: WF_CACHE.ProcessActivities(actid).PROCESS_ITEM_TYPE,
248: WF_CACHE.ProcessActivities(actid).PROCESS_NAME, parentid, TRUE);
249:
250: return parentid;

Line 253: Wf_Core.Context('Wf_Engine_Util', 'Activity_Parent_Process',

249:
250: return parentid;
251: exception
252: when no_data_found then
253: Wf_Core.Context('Wf_Engine_Util', 'Activity_Parent_Process',
254: to_char(actid));
255: Wf_Core.Token('ITEMTYPE', itemtype);
256: Wf_Core.Token('ITEMKEY', itemkey);
257: Wf_Core.Token('CHILDPROCESS', to_char(actid));

Line 261: Wf_Core.Context('Wf_Engine_Util', 'Activity_Parent_Process',

257: Wf_Core.Token('CHILDPROCESS', to_char(actid));
258: Wf_Core.Token('FUNCTION', 'Activity_Parent_Process');
259: Wf_Core.Raise('WFSQL_INTERNAL');
260: when others then
261: Wf_Core.Context('Wf_Engine_Util', 'Activity_Parent_Process',
262: to_char(actid));
263: raise;
264:
265: end activity_parent_process;

Line 295: AND (WAT1.RESULT_CODE in (fromact_result, wf_engine.eng_trans_any)

291: SELECT WAT1.FROM_PROCESS_ACTIVITY, WAT1.RESULT_CODE,
292: WAT1.TO_PROCESS_ACTIVITY
293: FROM WF_ACTIVITY_TRANSITIONS WAT1
294: WHERE WAT1.FROM_PROCESS_ACTIVITY = fromact
295: AND (WAT1.RESULT_CODE in (fromact_result, wf_engine.eng_trans_any)
296: OR (WAT1.RESULT_CODE = wf_engine.eng_trans_default
297: AND NOT EXISTS
298: (SELECT NULL
299: FROM WF_ACTIVITY_TRANSITIONS WAT2

Line 296: OR (WAT1.RESULT_CODE = wf_engine.eng_trans_default

292: WAT1.TO_PROCESS_ACTIVITY
293: FROM WF_ACTIVITY_TRANSITIONS WAT1
294: WHERE WAT1.FROM_PROCESS_ACTIVITY = fromact
295: AND (WAT1.RESULT_CODE in (fromact_result, wf_engine.eng_trans_any)
296: OR (WAT1.RESULT_CODE = wf_engine.eng_trans_default
297: AND NOT EXISTS
298: (SELECT NULL
299: FROM WF_ACTIVITY_TRANSITIONS WAT2
300: WHERE WAT2.FROM_PROCESS_ACTIVITY = fromact

Line 341: if (runpntf and (acttype = wf_engine.eng_notification)) then

337: begin
338: actdate := Wf_Item.Active_Date(itemtype, itemkey);
339: acttype := Wf_Activity.Instance_Type(actid, actdate);
340:
341: if (runpntf and (acttype = wf_engine.eng_notification)) then
342: -- First execute possible post-notification function to see if activity
343: -- should really complete.
344: Wf_Engine_Util.Execute_Post_NTF_Function(itemtype, itemkey, actid,
345: wf_engine.eng_run, pntfstatus, pntfresult);

Line 344: Wf_Engine_Util.Execute_Post_NTF_Function(itemtype, itemkey, actid,

340:
341: if (runpntf and (acttype = wf_engine.eng_notification)) then
342: -- First execute possible post-notification function to see if activity
343: -- should really complete.
344: Wf_Engine_Util.Execute_Post_NTF_Function(itemtype, itemkey, actid,
345: wf_engine.eng_run, pntfstatus, pntfresult);
346:
347: if (pntfstatus = wf_engine.eng_waiting) then
348: -- Either post-notification function is not complete, or error occurred.

Line 345: wf_engine.eng_run, pntfstatus, pntfresult);

341: if (runpntf and (acttype = wf_engine.eng_notification)) then
342: -- First execute possible post-notification function to see if activity
343: -- should really complete.
344: Wf_Engine_Util.Execute_Post_NTF_Function(itemtype, itemkey, actid,
345: wf_engine.eng_run, pntfstatus, pntfresult);
346:
347: if (pntfstatus = wf_engine.eng_waiting) then
348: -- Either post-notification function is not complete, or error occurred.
349: -- In either case exit immediately without changing status.

Line 347: if (pntfstatus = wf_engine.eng_waiting) then

343: -- should really complete.
344: Wf_Engine_Util.Execute_Post_NTF_Function(itemtype, itemkey, actid,
345: wf_engine.eng_run, pntfstatus, pntfresult);
346:
347: if (pntfstatus = wf_engine.eng_waiting) then
348: -- Either post-notification function is not complete, or error occurred.
349: -- In either case exit immediately without changing status.
350:
351: -- Bug 2078211

Line 353: -- wf_engine.eng_timedout, continue executing as the activity

349: -- In either case exit immediately without changing status.
350:
351: -- Bug 2078211
352: -- if the status is waiting and the input parameter result is
353: -- wf_engine.eng_timedout, continue executing as the activity
354: -- needs to be timedout as determined by the procedure
355: -- Wf_Engine_Util.processtimeout
356:
357: if (result = wf_engine.eng_timedout) then

Line 355: -- Wf_Engine_Util.processtimeout

351: -- Bug 2078211
352: -- if the status is waiting and the input parameter result is
353: -- wf_engine.eng_timedout, continue executing as the activity
354: -- needs to be timedout as determined by the procedure
355: -- Wf_Engine_Util.processtimeout
356:
357: if (result = wf_engine.eng_timedout) then
358: lresult := result;
359: else

Line 357: if (result = wf_engine.eng_timedout) then

353: -- wf_engine.eng_timedout, continue executing as the activity
354: -- needs to be timedout as determined by the procedure
355: -- Wf_Engine_Util.processtimeout
356:
357: if (result = wf_engine.eng_timedout) then
358: lresult := result;
359: else
360: return;
361: end if;

Line 362: elsif (pntfstatus = wf_engine.eng_completed) then

358: lresult := result;
359: else
360: return;
361: end if;
362: elsif (pntfstatus = wf_engine.eng_completed) then
363: -- Post-notification activity is complete.
364: -- Replace result with result of post-notification function.
365: lresult := pntfresult;
366: else

Line 377: wf_engine.eng_completed, lresult, '', SYSDATE);

373: end if;
374:
375: -- Update the item activity status
376: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actid,
377: wf_engine.eng_completed, lresult, '', SYSDATE);
378:
379: if (acttype = wf_engine.eng_process) then
380: -- If this activity is a process, kill any deferred children.
381: Wf_Engine_Util.Process_Kill_Children(itemtype, itemkey, actid);

Line 379: if (acttype = wf_engine.eng_process) then

375: -- Update the item activity status
376: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actid,
377: wf_engine.eng_completed, lresult, '', SYSDATE);
378:
379: if (acttype = wf_engine.eng_process) then
380: -- If this activity is a process, kill any deferred children.
381: Wf_Engine_Util.Process_Kill_Children(itemtype, itemkey, actid);
382:
383: -- Remove myself from the process call stack

Line 381: Wf_Engine_Util.Process_Kill_Children(itemtype, itemkey, actid);

377: wf_engine.eng_completed, lresult, '', SYSDATE);
378:
379: if (acttype = wf_engine.eng_process) then
380: -- If this activity is a process, kill any deferred children.
381: Wf_Engine_Util.Process_Kill_Children(itemtype, itemkey, actid);
382:
383: -- Remove myself from the process call stack
384: Wf_Engine_Util.RemoveProcessStack(itemtype, itemkey, actid);
385: elsif (acttype = wf_engine.eng_notification) then

Line 384: Wf_Engine_Util.RemoveProcessStack(itemtype, itemkey, actid);

380: -- If this activity is a process, kill any deferred children.
381: Wf_Engine_Util.Process_Kill_Children(itemtype, itemkey, actid);
382:
383: -- Remove myself from the process call stack
384: Wf_Engine_Util.RemoveProcessStack(itemtype, itemkey, actid);
385: elsif (acttype = wf_engine.eng_notification) then
386: -- Cancel any outstanding notifications for this activity if
387: -- a response is expected.
388: -- (Response expected is signalled by a non-null result)

Line 385: elsif (acttype = wf_engine.eng_notification) then

381: Wf_Engine_Util.Process_Kill_Children(itemtype, itemkey, actid);
382:
383: -- Remove myself from the process call stack
384: Wf_Engine_Util.RemoveProcessStack(itemtype, itemkey, actid);
385: elsif (acttype = wf_engine.eng_notification) then
386: -- Cancel any outstanding notifications for this activity if
387: -- a response is expected.
388: -- (Response expected is signalled by a non-null result)
389: Wf_Item_Activity_Status.Notification_Status(itemtype, itemkey, actid,

Line 391: if ((notid is not null) and (lresult <> wf_engine.eng_null)) then

387: -- a response is expected.
388: -- (Response expected is signalled by a non-null result)
389: Wf_Item_Activity_Status.Notification_Status(itemtype, itemkey, actid,
390: notid, user);
391: if ((notid is not null) and (lresult <> wf_engine.eng_null)) then
392: begin
393: Wf_Notification.CancelGroup(gid=>notid, timeout=>TRUE);
394: exception
395: when others then

Line 416: if (itemkey <> wf_engine.eng_synch) then

412: -- an end activity (immediately below).
413: -- 2. avoid creating confusing COMPLETE/#FORCE rows in process_activity
414: -- for activities following this one.
415: -- SYNCHMODE: No need to check, parent must always be active.
416: if (itemkey <> wf_engine.eng_synch) then
417: Wf_Item_Activity_Status.Status(itemtype, itemkey,
418: Wf_Engine_Util.Activity_Parent_Process(itemtype, itemkey, actid),
419: parent_status);
420: if (parent_status in (wf_engine.eng_completed, wf_engine.eng_error)) then

Line 418: Wf_Engine_Util.Activity_Parent_Process(itemtype, itemkey, actid),

414: -- for activities following this one.
415: -- SYNCHMODE: No need to check, parent must always be active.
416: if (itemkey <> wf_engine.eng_synch) then
417: Wf_Item_Activity_Status.Status(itemtype, itemkey,
418: Wf_Engine_Util.Activity_Parent_Process(itemtype, itemkey, actid),
419: parent_status);
420: if (parent_status in (wf_engine.eng_completed, wf_engine.eng_error)) then
421: return;
422: end if;

Line 420: if (parent_status in (wf_engine.eng_completed, wf_engine.eng_error)) then

416: if (itemkey <> wf_engine.eng_synch) then
417: Wf_Item_Activity_Status.Status(itemtype, itemkey,
418: Wf_Engine_Util.Activity_Parent_Process(itemtype, itemkey, actid),
419: parent_status);
420: if (parent_status in (wf_engine.eng_completed, wf_engine.eng_error)) then
421: return;
422: end if;
423: end if;
424:

Line 455: Wf_Engine_Util.Complete_Activity(itemtype, itemkey,

451:
452: end if;
453:
454: -- Complete the parent process and return immediately.
455: Wf_Engine_Util.Complete_Activity(itemtype, itemkey,
456: Wf_Engine_Util.Activity_Parent_Process(itemtype, itemkey, actid),
457: WF_CACHE.ProcessActivities(complete_activity.actid).DEFAULT_RESULT);
458: return;
459: end if;

Line 456: Wf_Engine_Util.Activity_Parent_Process(itemtype, itemkey, actid),

452: end if;
453:
454: -- Complete the parent process and return immediately.
455: Wf_Engine_Util.Complete_Activity(itemtype, itemkey,
456: Wf_Engine_Util.Activity_Parent_Process(itemtype, itemkey, actid),
457: WF_CACHE.ProcessActivities(complete_activity.actid).DEFAULT_RESULT);
458: return;
459: end if;
460:

Line 551: if ((itemkey = wf_engine.eng_synch) and (i > 1)) then

547: --
548:
549: -- SYNCHMODE: Check for branching.
550: -- If more than one transition out, this is an illegal branch point.
551: if ((itemkey = wf_engine.eng_synch) and (i > 1)) then
552: Wf_Core.Token('ACTID', to_char(actid));
553: Wf_Core.Token('RESULT', lresult);
554: Wf_Core.Raise('WFENG_SYNCH_BRANCH');
555: end if;

Line 560: Wf_Engine_Util.Process_Activity(itemtype, itemkey,

556:
557: i := 0;
558: -- While loop to hande the next transition activities.
559: while (childarr(i) is not NULL) loop
560: Wf_Engine_Util.Process_Activity(itemtype, itemkey,
561: childarr(i),
562: WF_ENGINE.THRESHOLD);
563: i := i+1;
564: end loop;

Line 562: WF_ENGINE.THRESHOLD);

558: -- While loop to hande the next transition activities.
559: while (childarr(i) is not NULL) loop
560: Wf_Engine_Util.Process_Activity(itemtype, itemkey,
561: childarr(i),
562: WF_ENGINE.THRESHOLD);
563: i := i+1;
564: end loop;
565:
566: exception

Line 568: Wf_Core.Context('Wf_Engine_Util', 'Complete_Activity', itemtype, itemkey,

564: end loop;
565:
566: exception
567: when others then
568: Wf_Core.Context('Wf_Engine_Util', 'Complete_Activity', itemtype, itemkey,
569: actid, result);
570: raise;
571: end complete_activity;
572:

Line 609: AND WPA.START_END = wf_engine.eng_start

605: FROM WF_PROCESS_ACTIVITIES WPA
606: WHERE WPA.PROCESS_ITEM_TYPE = itemtype
607: AND WPA.PROCESS_NAME = process
608: AND WPA.PROCESS_VERSION = version
609: AND WPA.START_END = wf_engine.eng_start
610: AND NOT EXISTS (
611: SELECT NULL
612: FROM WF_ACTIVITY_TRANSITIONS WAT
613: WHERE WAT.TO_PROCESS_ACTIVITY = WPA.INSTANCE_ID);

Line 660: wf_engine.eng_active, wf_engine.eng_null, SYSDATE, null,

656: Wf_Core.Raise('WFENG_PROCESS_RUNNABLE');
657: end if;
658:
659: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, processid,
660: wf_engine.eng_active, wf_engine.eng_null, SYSDATE, null,
661: newStatus=>TRUE);
662:
663: -- Initialize process call stack with the root process.
664: Wf_Engine_Util.AddProcessStack(itemtype, itemkey, itemtype, process,

Line 664: Wf_Engine_Util.AddProcessStack(itemtype, itemkey, itemtype, process,

660: wf_engine.eng_active, wf_engine.eng_null, SYSDATE, null,
661: newStatus=>TRUE);
662:
663: -- Initialize process call stack with the root process.
664: Wf_Engine_Util.AddProcessStack(itemtype, itemkey, itemtype, process,
665: processid, TRUE);
666:
667: -- Get the cost of the parent process.
668: -- If the cost is over the threshold, then set a flag to immediately

Line 680: if ((itemkey <> wf_engine.eng_synch) and

676: --
677: -- SYNCHMODE: Synch processes cannot be deferred.
678: actdate := Wf_Item.Active_Date(itemtype, itemkey);
679: Wf_Activity.Info(processid, actdate, rerun, acttype, cost, ftype);
680: if ((itemkey <> wf_engine.eng_synch) and
681: (cost > wf_engine.threshold)) then
682: defer_mode := TRUE;
683: end if;
684:

Line 681: (cost > wf_engine.threshold)) then

677: -- SYNCHMODE: Synch processes cannot be deferred.
678: actdate := Wf_Item.Active_Date(itemtype, itemkey);
679: Wf_Activity.Info(processid, actdate, rerun, acttype, cost, ftype);
680: if ((itemkey <> wf_engine.eng_synch) and
681: (cost > wf_engine.threshold)) then
682: defer_mode := TRUE;
683: end if;
684:
685: --

Line 799: if ((itemkey = wf_engine.eng_synch) and

795: end if;
796: --
797:
798: -- SYNCHMODE: Only 1 starter allowed in synch processes
799: if ((itemkey = wf_engine.eng_synch) and
800: (i > 1)) then
801: Wf_Core.Token('ACTID', process);
802: Wf_Core.Token('RESULT', 'START');
803: Wf_Core.Raise('WFENG_SYNCH_BRANCH');

Line 823: wf_engine.eng_notified, wf_engine.eng_null, SYSDATE, null,

819: -- and thus ready for external input, but don't actually run
820: -- them. Only the start activities matching the specific
821: -- activity/event will be run (below).
822: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, childarr(i),
823: wf_engine.eng_notified, wf_engine.eng_null, SYSDATE, null,
824: newStatus=>TRUE);
825: elsif (defer_mode) then
826: -- Insert child rows as deferred with no further processing
827: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, childarr(i),

Line 828: wf_engine.eng_deferred, wf_engine.eng_null, SYSDATE, null,

824: newStatus=>TRUE);
825: elsif (defer_mode) then
826: -- Insert child rows as deferred with no further processing
827: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, childarr(i),
828: wf_engine.eng_deferred, wf_engine.eng_null, SYSDATE, null,
829: newStatus=>TRUE);
830: else -- Must be START mode, and not deferred
831: -- Process start activity normally
832: if (itemkey = wf_engine.eng_synch) then

Line 832: if (itemkey = wf_engine.eng_synch) then

828: wf_engine.eng_deferred, wf_engine.eng_null, SYSDATE, null,
829: newStatus=>TRUE);
830: else -- Must be START mode, and not deferred
831: -- Process start activity normally
832: if (itemkey = wf_engine.eng_synch) then
833: -- SYNCHMODE: No fancy error processing!
834: Wf_Engine_Util.Process_Activity(itemtype, itemkey, childarr(i),
835: WF_ENGINE.THRESHOLD);
836: else

Line 834: Wf_Engine_Util.Process_Activity(itemtype, itemkey, childarr(i),

830: else -- Must be START mode, and not deferred
831: -- Process start activity normally
832: if (itemkey = wf_engine.eng_synch) then
833: -- SYNCHMODE: No fancy error processing!
834: Wf_Engine_Util.Process_Activity(itemtype, itemkey, childarr(i),
835: WF_ENGINE.THRESHOLD);
836: else
837: begin
838: savepoint wf_savepoint;

Line 835: WF_ENGINE.THRESHOLD);

831: -- Process start activity normally
832: if (itemkey = wf_engine.eng_synch) then
833: -- SYNCHMODE: No fancy error processing!
834: Wf_Engine_Util.Process_Activity(itemtype, itemkey, childarr(i),
835: WF_ENGINE.THRESHOLD);
836: else
837: begin
838: savepoint wf_savepoint;
839: Wf_Engine_Util.Process_Activity(itemtype, itemkey, childarr(i),

Line 839: Wf_Engine_Util.Process_Activity(itemtype, itemkey, childarr(i),

835: WF_ENGINE.THRESHOLD);
836: else
837: begin
838: savepoint wf_savepoint;
839: Wf_Engine_Util.Process_Activity(itemtype, itemkey, childarr(i),
840: WF_ENGINE.THRESHOLD);
841: exception
842: when trig_savepoint or dist_savepoint then
843: -- Oops, you forgot to defer your trigger or distributed

Line 840: WF_ENGINE.THRESHOLD);

836: else
837: begin
838: savepoint wf_savepoint;
839: Wf_Engine_Util.Process_Activity(itemtype, itemkey, childarr(i),
840: WF_ENGINE.THRESHOLD);
841: exception
842: when trig_savepoint or dist_savepoint then
843: -- Oops, you forgot to defer your trigger or distributed
844: -- transaction initiated process! I'll do it for you.

Line 846: childarr(i), wf_engine.eng_deferred, wf_engine.eng_null,

842: when trig_savepoint or dist_savepoint then
843: -- Oops, you forgot to defer your trigger or distributed
844: -- transaction initiated process! I'll do it for you.
845: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey,
846: childarr(i), wf_engine.eng_deferred, wf_engine.eng_null,
847: SYSDATE, null, newStatus=>TRUE);
848: when others then
849: -- If anything in this process raises an exception:
850: -- 1. rollback any work in this process thread

Line 855: Wf_Core.Context('Wf_Engine', 'Start_Process_Internal', itemtype, itemkey);

851: -- 2. set this activity to error status
852: -- 3. execute the error process (if any)
853: -- 4. clear the error to continue with next activity
854: rollback to wf_savepoint;
855: Wf_Core.Context('Wf_Engine', 'Start_Process_Internal', itemtype, itemkey);
856: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, processid,
857: wf_engine.eng_exception, FALSE);
858: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, processid,
859: wf_engine.eng_exception);

Line 857: wf_engine.eng_exception, FALSE);

853: -- 4. clear the error to continue with next activity
854: rollback to wf_savepoint;
855: Wf_Core.Context('Wf_Engine', 'Start_Process_Internal', itemtype, itemkey);
856: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, processid,
857: wf_engine.eng_exception, FALSE);
858: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, processid,
859: wf_engine.eng_exception);
860: Wf_Core.Clear;
861: return;

Line 858: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, processid,

854: rollback to wf_savepoint;
855: Wf_Core.Context('Wf_Engine', 'Start_Process_Internal', itemtype, itemkey);
856: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, processid,
857: wf_engine.eng_exception, FALSE);
858: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, processid,
859: wf_engine.eng_exception);
860: Wf_Core.Clear;
861: return;
862: end;

Line 859: wf_engine.eng_exception);

855: Wf_Core.Context('Wf_Engine', 'Start_Process_Internal', itemtype, itemkey);
856: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, processid,
857: wf_engine.eng_exception, FALSE);
858: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, processid,
859: wf_engine.eng_exception);
860: Wf_Core.Clear;
861: return;
862: end;
863: end if;

Line 878: if ((itemkey = WF_ENGINE.eng_synch) and

874: exception
875: when others then
876: -- Bug 4117740
877: -- Call clearcache() when #SYNCH flow is in error
878: if ((itemkey = WF_ENGINE.eng_synch) and
879: (wf_core.error_name is null or wf_core.error_name <> 'WFENG_SYNCH_ITEM') and
880: (not WF_ENGINE.debug)) then
881: Wf_Item.ClearCache;
882: end if;

Line 880: (not WF_ENGINE.debug)) then

876: -- Bug 4117740
877: -- Call clearcache() when #SYNCH flow is in error
878: if ((itemkey = WF_ENGINE.eng_synch) and
879: (wf_core.error_name is null or wf_core.error_name <> 'WFENG_SYNCH_ITEM') and
880: (not WF_ENGINE.debug)) then
881: Wf_Item.ClearCache;
882: end if;
883:
884: Wf_Core.Context('Wf_Engine_Util', 'Start_Process_Internal',

Line 884: Wf_Core.Context('Wf_Engine_Util', 'Start_Process_Internal',

880: (not WF_ENGINE.debug)) then
881: Wf_Item.ClearCache;
882: end if;
883:
884: Wf_Core.Context('Wf_Engine_Util', 'Start_Process_Internal',
885: itemtype, itemkey);
886: raise;
887: end Start_Process_Internal;
888:

Line 924: AND C.START_END = wf_engine.eng_start

920: AND A.NAME = C.PROCESS_NAME
921: AND A.ITEM_TYPE = C.PROCESS_ITEM_TYPE
922: AND actdate >= A.BEGIN_DATE
923: AND actdate < NVL(A.END_DATE, actdate+1)
924: AND C.START_END = wf_engine.eng_start
925: AND NOT EXISTS (
926: SELECT NULL
927: FROM WF_ACTIVITY_TRANSITIONS WAT
928: WHERE WAT.TO_PROCESS_ACTIVITY = C.INSTANCE_ID);

Line 950: if (itemkey <> wf_engine.eng_synch) then

946: begin
947:
948: -- Check this activity's parent process
949: -- SYNCHMODE: No need to check parent, will always be active.
950: if (itemkey <> wf_engine.eng_synch) then
951: Wf_Item_Activity_Status.Status(itemtype, itemkey,
952: Wf_Engine_Util.Activity_Parent_Process(itemtype, itemkey, actid),
953: status);
954:

Line 952: Wf_Engine_Util.Activity_Parent_Process(itemtype, itemkey, actid),

948: -- Check this activity's parent process
949: -- SYNCHMODE: No need to check parent, will always be active.
950: if (itemkey <> wf_engine.eng_synch) then
951: Wf_Item_Activity_Status.Status(itemtype, itemkey,
952: Wf_Engine_Util.Activity_Parent_Process(itemtype, itemkey, actid),
953: status);
954:
955: if (status is null) then
956: -- return WF_PARENT_PROCESS_NOT_RUNNING;

Line 960: elsif ((status = wf_engine.eng_completed) or

956: -- return WF_PARENT_PROCESS_NOT_RUNNING;
957: -- TO BE UPDATED
958: -- Actually this case should not happen
959: return;
960: elsif ((status = wf_engine.eng_completed) or
961: (status = wf_engine.eng_error)) then
962: -- Mark it as completed cause the parent process is completed/errored
963: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actid,
964: wf_engine.eng_completed, wf_engine.eng_force, sysdate, sysdate);

Line 961: (status = wf_engine.eng_error)) then

957: -- TO BE UPDATED
958: -- Actually this case should not happen
959: return;
960: elsif ((status = wf_engine.eng_completed) or
961: (status = wf_engine.eng_error)) then
962: -- Mark it as completed cause the parent process is completed/errored
963: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actid,
964: wf_engine.eng_completed, wf_engine.eng_force, sysdate, sysdate);
965: return;

Line 964: wf_engine.eng_completed, wf_engine.eng_force, sysdate, sysdate);

960: elsif ((status = wf_engine.eng_completed) or
961: (status = wf_engine.eng_error)) then
962: -- Mark it as completed cause the parent process is completed/errored
963: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actid,
964: wf_engine.eng_completed, wf_engine.eng_force, sysdate, sysdate);
965: return;
966:
967: elsif (status = wf_engine.eng_suspended) then
968: -- Insert this activity as deferred

Line 967: elsif (status = wf_engine.eng_suspended) then

963: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actid,
964: wf_engine.eng_completed, wf_engine.eng_force, sysdate, sysdate);
965: return;
966:
967: elsif (status = wf_engine.eng_suspended) then
968: -- Insert this activity as deferred
969: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actid,
970: wf_engine.eng_deferred, null,
971: sysdate, null, suspended=>TRUE);

Line 970: wf_engine.eng_deferred, null,

966:
967: elsif (status = wf_engine.eng_suspended) then
968: -- Insert this activity as deferred
969: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actid,
970: wf_engine.eng_deferred, null,
971: sysdate, null, suspended=>TRUE);
972: return;
973: elsif (status in (wf_engine.eng_notified, wf_engine.eng_waiting,
974: wf_engine.eng_deferred)) then

Line 973: elsif (status in (wf_engine.eng_notified, wf_engine.eng_waiting,

969: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actid,
970: wf_engine.eng_deferred, null,
971: sysdate, null, suspended=>TRUE);
972: return;
973: elsif (status in (wf_engine.eng_notified, wf_engine.eng_waiting,
974: wf_engine.eng_deferred)) then
975: -- NOTE: This should never happened because the engine will never
976: -- set the status of a process to be 'WAITING' or 'NOTIFIED'
977: -- return;

Line 974: wf_engine.eng_deferred)) then

970: wf_engine.eng_deferred, null,
971: sysdate, null, suspended=>TRUE);
972: return;
973: elsif (status in (wf_engine.eng_notified, wf_engine.eng_waiting,
974: wf_engine.eng_deferred)) then
975: -- NOTE: This should never happened because the engine will never
976: -- set the status of a process to be 'WAITING' or 'NOTIFIED'
977: -- return;
978: Wf_Core.Token('ITEM_TYPE', itemtype);

Line 999: if (itemkey = wf_engine.eng_synch) then

995: -- If this activity has already been completed, check the rerun flag
996: --
997: -- SYNCHMODE: Ignore the current status of the activity. No loop
998: -- reset or other processing is allowed.
999: if (itemkey = wf_engine.eng_synch) then
1000: status := '';
1001: result := '';
1002: else
1003: Wf_Item_Activity_Status.Result(itemtype, itemkey, actid, status, result);

Line 1005: if ( (status = wf_engine.eng_active) AND (activate = FALSE) )then

1001: result := '';
1002: else
1003: Wf_Item_Activity_Status.Result(itemtype, itemkey, actid, status, result);
1004: if (status is not null) then
1005: if ( (status = wf_engine.eng_active) AND (activate = FALSE) )then
1006: -- Maybe don't have to do anything because it is running already
1007: return;
1008:
1009: -- Bug 2111183

Line 1014: elsif (status in (wf_engine.eng_completed, wf_engine.eng_error,

1010: -- resetting activity with status eng_notified prevents a orphaned
1011: -- notification in WF_NOTIFICATIONS if the notification activity
1012: -- is revisited in a loop simultaneously by two incoming transitions
1013:
1014: elsif (status in (wf_engine.eng_completed, wf_engine.eng_error,
1015: wf_engine.eng_notified)) then
1016: -- Check the rerun flag to see what should be done
1017: if (rerun = wf_engine.eng_ignore) then
1018: -- No loop - do nothing

Line 1015: wf_engine.eng_notified)) then

1011: -- notification in WF_NOTIFICATIONS if the notification activity
1012: -- is revisited in a loop simultaneously by two incoming transitions
1013:
1014: elsif (status in (wf_engine.eng_completed, wf_engine.eng_error,
1015: wf_engine.eng_notified)) then
1016: -- Check the rerun flag to see what should be done
1017: if (rerun = wf_engine.eng_ignore) then
1018: -- No loop - do nothing
1019: return;

Line 1017: if (rerun = wf_engine.eng_ignore) then

1013:
1014: elsif (status in (wf_engine.eng_completed, wf_engine.eng_error,
1015: wf_engine.eng_notified)) then
1016: -- Check the rerun flag to see what should be done
1017: if (rerun = wf_engine.eng_ignore) then
1018: -- No loop - do nothing
1019: return;
1020: elsif (rerun = wf_engine.eng_reset) then
1021: -- Reset activities, cancel mode

Line 1020: elsif (rerun = wf_engine.eng_reset) then

1016: -- Check the rerun flag to see what should be done
1017: if (rerun = wf_engine.eng_ignore) then
1018: -- No loop - do nothing
1019: return;
1020: elsif (rerun = wf_engine.eng_reset) then
1021: -- Reset activities, cancel mode
1022: Wf_Engine_Util.Reset_Activities(itemtype, itemkey, actid, TRUE);
1023: elsif (rerun = wf_engine.eng_loop) then
1024: -- Reset activities, no-cancel mode

Line 1022: Wf_Engine_Util.Reset_Activities(itemtype, itemkey, actid, TRUE);

1018: -- No loop - do nothing
1019: return;
1020: elsif (rerun = wf_engine.eng_reset) then
1021: -- Reset activities, cancel mode
1022: Wf_Engine_Util.Reset_Activities(itemtype, itemkey, actid, TRUE);
1023: elsif (rerun = wf_engine.eng_loop) then
1024: -- Reset activities, no-cancel mode
1025: Wf_Engine_Util.Reset_Activities(itemtype, itemkey, actid, FALSE);
1026: end if;

Line 1023: elsif (rerun = wf_engine.eng_loop) then

1019: return;
1020: elsif (rerun = wf_engine.eng_reset) then
1021: -- Reset activities, cancel mode
1022: Wf_Engine_Util.Reset_Activities(itemtype, itemkey, actid, TRUE);
1023: elsif (rerun = wf_engine.eng_loop) then
1024: -- Reset activities, no-cancel mode
1025: Wf_Engine_Util.Reset_Activities(itemtype, itemkey, actid, FALSE);
1026: end if;
1027: elsif ((status = wf_engine.eng_suspended) AND

Line 1025: Wf_Engine_Util.Reset_Activities(itemtype, itemkey, actid, FALSE);

1021: -- Reset activities, cancel mode
1022: Wf_Engine_Util.Reset_Activities(itemtype, itemkey, actid, TRUE);
1023: elsif (rerun = wf_engine.eng_loop) then
1024: -- Reset activities, no-cancel mode
1025: Wf_Engine_Util.Reset_Activities(itemtype, itemkey, actid, FALSE);
1026: end if;
1027: elsif ((status = wf_engine.eng_suspended) AND
1028: (acttype <> wf_engine.eng_process))then
1029: -- Only the process type of activity can have a 'SUSPENDED' status

Line 1027: elsif ((status = wf_engine.eng_suspended) AND

1023: elsif (rerun = wf_engine.eng_loop) then
1024: -- Reset activities, no-cancel mode
1025: Wf_Engine_Util.Reset_Activities(itemtype, itemkey, actid, FALSE);
1026: end if;
1027: elsif ((status = wf_engine.eng_suspended) AND
1028: (acttype <> wf_engine.eng_process))then
1029: -- Only the process type of activity can have a 'SUSPENDED' status
1030: -- If this is not a process type activity, then THIS IS A PROBLEM
1031: -- CAN NOT DO ANYTHING

Line 1028: (acttype <> wf_engine.eng_process))then

1024: -- Reset activities, no-cancel mode
1025: Wf_Engine_Util.Reset_Activities(itemtype, itemkey, actid, FALSE);
1026: end if;
1027: elsif ((status = wf_engine.eng_suspended) AND
1028: (acttype <> wf_engine.eng_process))then
1029: -- Only the process type of activity can have a 'SUSPENDED' status
1030: -- If this is not a process type activity, then THIS IS A PROBLEM
1031: -- CAN NOT DO ANYTHING
1032: Wf_Core.Token('ITEM_TYPE', itemtype);

Line 1048: if ((itemkey = wf_engine.eng_synch) or

1044: -- (3) this is a waiting activity (including logical_and)
1045: -- (4) this is re-runnable activity and we did a reset already
1046: --
1047: -- SYNCHMODE: Ignore cost, always run process immediately
1048: if ((itemkey = wf_engine.eng_synch) or
1049: (cost is null and act_functype = 'PL/SQL') or
1050: (cost <= nvl(threshold, cost) and act_functype = 'PL/SQL')) then
1051: -- If status is null, we want to create the status
1052: -- If status is not null, we want to update the status back to active

Line 1058: wf_engine.eng_active, null,

1054:
1055: if (status is null ) then
1056: -- Insert this activity as active into the WIAS table
1057: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actid,
1058: wf_engine.eng_active, null,
1059: sysdate, null, newStatus=>TRUE);
1060:
1061: elsif (status <> wf_engine.eng_suspended) then
1062: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actid,

Line 1061: elsif (status <> wf_engine.eng_suspended) then

1057: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actid,
1058: wf_engine.eng_active, null,
1059: sysdate, null, newStatus=>TRUE);
1060:
1061: elsif (status <> wf_engine.eng_suspended) then
1062: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actid,
1063: wf_engine.eng_active, null,
1064: sysdate, null, newStatus=>FALSE);
1065: end if;

Line 1063: wf_engine.eng_active, null,

1059: sysdate, null, newStatus=>TRUE);
1060:
1061: elsif (status <> wf_engine.eng_suspended) then
1062: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actid,
1063: wf_engine.eng_active, null,
1064: sysdate, null, newStatus=>FALSE);
1065: end if;
1066:
1067: if (acttype = wf_engine.eng_process) then

Line 1067: if (acttype = wf_engine.eng_process) then

1063: wf_engine.eng_active, null,
1064: sysdate, null, newStatus=>FALSE);
1065: end if;
1066:
1067: if (acttype = wf_engine.eng_process) then
1068: -- PROCESS activity
1069: -- Add this subprocess to the call stack
1070: Wf_Process_Activity.ActivityName(actid, act_itemtype, act_name);
1071: Wf_Engine_Util.AddProcessStack(itemtype, itemkey, act_itemtype,

Line 1071: Wf_Engine_Util.AddProcessStack(itemtype, itemkey, act_itemtype,

1067: if (acttype = wf_engine.eng_process) then
1068: -- PROCESS activity
1069: -- Add this subprocess to the call stack
1070: Wf_Process_Activity.ActivityName(actid, act_itemtype, act_name);
1071: Wf_Engine_Util.AddProcessStack(itemtype, itemkey, act_itemtype,
1072: act_name, actid, FALSE);
1073:
1074: -- For loop to get all the start activities first.
1075: -- This is to avoid the maximum open cursor problem

Line 1083: if ((itemkey = wf_engine.eng_synch) and (i > 1)) then

1079: end loop;
1080: childarr(i) := '';
1081:
1082: -- SYNCHMODE: Only one starter allowed in synch process
1083: if ((itemkey = wf_engine.eng_synch) and (i > 1)) then
1084: Wf_Core.Token('ACTID', act_name);
1085: Wf_Core.Token('RESULT', 'START');
1086: Wf_Core.Raise('WFENG_SYNCH_BRANCH');
1087: end if;

Line 1092: Wf_Engine_Util.Process_Activity(itemtype, itemkey, childarr(i),

1088:
1089: -- While loop to handle all the start activities
1090: i := 0;
1091: while(childarr(i) is not null) loop
1092: Wf_Engine_Util.Process_Activity(itemtype, itemkey, childarr(i),
1093: threshold);
1094: i := i+1;
1095: end loop;
1096: else

Line 1099: Wf_Engine_Util.Execute_Activity(itemtype, itemkey, actid,

1095: end loop;
1096: else
1097: -- Function/Notification/Event type activities
1098: begin
1099: Wf_Engine_Util.Execute_Activity(itemtype, itemkey, actid,
1100: wf_engine.eng_run);
1101: exception
1102: when trig_savepoint or dist_savepoint then
1103: -- Oops, you forgot to defer your trigger or distributed

Line 1100: wf_engine.eng_run);

1096: else
1097: -- Function/Notification/Event type activities
1098: begin
1099: Wf_Engine_Util.Execute_Activity(itemtype, itemkey, actid,
1100: wf_engine.eng_run);
1101: exception
1102: when trig_savepoint or dist_savepoint then
1103: -- Oops, you forgot to defer your trigger or distributed
1104: -- transaction initiated process! I'll do it for you.

Line 1109: actid, wf_engine.eng_deferred, null,

1105: -- (Note this is only needed here for restarting a
1106: -- process using CompleteActivity, all other will be caught
1107: -- by error handling savepoints before this.)
1108: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey,
1109: actid, wf_engine.eng_deferred, null,
1110: SYSDATE, null, newStatus=>TRUE);
1111: end;
1112: end if;
1113: else

Line 1117: wf_engine.eng_deferred, null,

1113: else
1114: -- Cost is over the threshold or this is a callout function
1115: -- Insert this activity into the WIAS table and mark it as deferred
1116: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actid,
1117: wf_engine.eng_deferred, null,
1118: sysdate, null, newStatus=>TRUE);
1119: end if; -- end if deferred
1120:
1121: return;

Line 1124: Wf_Core.Context('Wf_Engine_Util', 'Process_Activity', itemtype, itemkey,

1120:
1121: return;
1122: exception
1123: when others then
1124: Wf_Core.Context('Wf_Engine_Util', 'Process_Activity', itemtype, itemkey,
1125: to_char(actid), to_char(threshold));
1126: raise;
1127: end process_activity;
1128:

Line 1158: AND C.START_END = wf_engine.eng_start;

1154: AND A.NAME = C.PROCESS_NAME
1155: AND A.ITEM_TYPE = C.PROCESS_ITEM_TYPE
1156: AND actdate >= A.BEGIN_DATE
1157: AND actdate < NVL(A.END_DATE, actdate+1)
1158: AND C.START_END = wf_engine.eng_start;
1159:
1160: -- Select the to activity(ies) by given the from activity and result
1161: cursor to_activities(fromact in pls_integer, fromact_result varchar2) is
1162: SELECT WAT1.FROM_PROCESS_ACTIVITY, WAT1.RESULT_CODE,

Line 1166: AND (WAT1.RESULT_CODE in (fromact_result, wf_engine.eng_trans_any)

1162: SELECT WAT1.FROM_PROCESS_ACTIVITY, WAT1.RESULT_CODE,
1163: WAT1.TO_PROCESS_ACTIVITY
1164: FROM WF_ACTIVITY_TRANSITIONS WAT1
1165: WHERE WAT1.FROM_PROCESS_ACTIVITY = fromact
1166: AND (WAT1.RESULT_CODE in (fromact_result, wf_engine.eng_trans_any)
1167: OR (WAT1.RESULT_CODE = wf_engine.eng_trans_default
1168: AND NOT EXISTS
1169: (SELECT NULL
1170: FROM WF_ACTIVITY_TRANSITIONS WAT2

Line 1167: OR (WAT1.RESULT_CODE = wf_engine.eng_trans_default

1163: WAT1.TO_PROCESS_ACTIVITY
1164: FROM WF_ACTIVITY_TRANSITIONS WAT1
1165: WHERE WAT1.FROM_PROCESS_ACTIVITY = fromact
1166: AND (WAT1.RESULT_CODE in (fromact_result, wf_engine.eng_trans_any)
1167: OR (WAT1.RESULT_CODE = wf_engine.eng_trans_default
1168: AND NOT EXISTS
1169: (SELECT NULL
1170: FROM WF_ACTIVITY_TRANSITIONS WAT2
1171: WHERE WAT2.FROM_PROCESS_ACTIVITY = fromact

Line 1205: if (typ = wf_engine.eng_process) then

1201:
1202: -- Undo the current activity, depending on type
1203: actdate := Wf_Item.Active_Date(itemtype, itemkey);
1204: typ := Wf_Activity.Instance_Type(actid, actdate);
1205: if (typ = wf_engine.eng_process) then
1206: -- For loop to get the starting activities of this process
1207: i := 0;
1208: for child in starter_children(actid) loop
1209: childarr(i) := child.instance_id;

Line 1217: Wf_Engine_Util.Reset_Activities(itemtype, itemkey, childarr(i), cancel);

1213:
1214: -- Reset all starting activities of child process.
1215: i := 0;
1216: while (childarr(i) is not null) loop
1217: Wf_Engine_Util.Reset_Activities(itemtype, itemkey, childarr(i), cancel);
1218: i := i + 1;
1219: end loop;
1220: elsif (typ = wf_engine.eng_notification) then
1221: if (cancel) then

Line 1220: elsif (typ = wf_engine.eng_notification) then

1216: while (childarr(i) is not null) loop
1217: Wf_Engine_Util.Reset_Activities(itemtype, itemkey, childarr(i), cancel);
1218: i := i + 1;
1219: end loop;
1220: elsif (typ = wf_engine.eng_notification) then
1221: if (cancel) then
1222: -- Run post-notification function in cancel mode if there is one.
1223: Wf_Engine_Util.Execute_Post_NTF_Function(itemtype, itemkey, actid,
1224: wf_engine.eng_cancel, pntfstatus, pntfresult);

Line 1223: Wf_Engine_Util.Execute_Post_NTF_Function(itemtype, itemkey, actid,

1219: end loop;
1220: elsif (typ = wf_engine.eng_notification) then
1221: if (cancel) then
1222: -- Run post-notification function in cancel mode if there is one.
1223: Wf_Engine_Util.Execute_Post_NTF_Function(itemtype, itemkey, actid,
1224: wf_engine.eng_cancel, pntfstatus, pntfresult);
1225:
1226: -- Cancel any open notifications sent by this activity
1227: Wf_Item_Activity_Status.Notification_Status(itemtype, itemkey, actid,

Line 1224: wf_engine.eng_cancel, pntfstatus, pntfresult);

1220: elsif (typ = wf_engine.eng_notification) then
1221: if (cancel) then
1222: -- Run post-notification function in cancel mode if there is one.
1223: Wf_Engine_Util.Execute_Post_NTF_Function(itemtype, itemkey, actid,
1224: wf_engine.eng_cancel, pntfstatus, pntfresult);
1225:
1226: -- Cancel any open notifications sent by this activity
1227: Wf_Item_Activity_Status.Notification_Status(itemtype, itemkey, actid,
1228: notid, user);

Line 1238: elsif (typ in (wf_engine.eng_function, wf_engine.eng_event)) then

1234: null; -- Ignore errors in cancelling
1235: end;
1236: end if;
1237: end if;
1238: elsif (typ in (wf_engine.eng_function, wf_engine.eng_event)) then
1239: if (cancel) then
1240: -- Call function in cancel mode
1241: Wf_Engine_Util.Execute_Activity(itemtype, itemkey, actid,
1242: wf_engine.eng_cancel);

Line 1241: Wf_Engine_Util.Execute_Activity(itemtype, itemkey, actid,

1237: end if;
1238: elsif (typ in (wf_engine.eng_function, wf_engine.eng_event)) then
1239: if (cancel) then
1240: -- Call function in cancel mode
1241: Wf_Engine_Util.Execute_Activity(itemtype, itemkey, actid,
1242: wf_engine.eng_cancel);
1243: end if;
1244: end if;
1245:

Line 1242: wf_engine.eng_cancel);

1238: elsif (typ in (wf_engine.eng_function, wf_engine.eng_event)) then
1239: if (cancel) then
1240: -- Call function in cancel mode
1241: Wf_Engine_Util.Execute_Activity(itemtype, itemkey, actid,
1242: wf_engine.eng_cancel);
1243: end if;
1244: end if;
1245:
1246: -- Move the WIAS record to the history table.

Line 1250: Wf_Engine_Util.Move_To_History(itemtype, itemkey, actid);

1246: -- Move the WIAS record to the history table.
1247: -- Note: Do NOT move this call. The move_to_history() must be before any
1248: -- recursive calls to reset_activities() in the current process,
1249: -- or infinite recursion will result.
1250: Wf_Engine_Util.Move_To_History(itemtype, itemkey, actid);
1251:
1252: -- Reset all activities following this one in current process,
1253: -- but only if this activity really completed.
1254: if (status = wf_engine.eng_completed) then

Line 1254: if (status = wf_engine.eng_completed) then

1250: Wf_Engine_Util.Move_To_History(itemtype, itemkey, actid);
1251:
1252: -- Reset all activities following this one in current process,
1253: -- but only if this activity really completed.
1254: if (status = wf_engine.eng_completed) then
1255: --
1256: -- Check WF_CACHE
1257: WF_CACHE.GetActivityTransitions(FromActID=>actid,
1258: result=>result,

Line 1338: Wf_Engine_Util.Reset_Activities(itemtype, itemkey, childarr(i), cancel);

1334: childarr(i) := '';
1335:
1336: i := 0;
1337: while (childarr(i) is not null) loop
1338: Wf_Engine_Util.Reset_Activities(itemtype, itemkey, childarr(i), cancel);
1339: i := i + 1;
1340: end loop;
1341: end if;
1342:

Line 1354: Wf_Core.Context('Wf_Engine_Util', 'Reset_Activities', itemtype, itemkey,

1350: end if;
1351: --
1352: exception
1353: when others then
1354: Wf_Core.Context('Wf_Engine_Util', 'Reset_Activities', itemtype, itemkey,
1355: to_char(actid));
1356: raise;
1357: end reset_activities;
1358:

Line 1404: AND (WAT1.RESULT_CODE in (fromact_result, wf_engine.eng_trans_any)

1400: SELECT WAT1.FROM_PROCESS_ACTIVITY, WAT1.RESULT_CODE,
1401: WAT1.TO_PROCESS_ACTIVITY
1402: FROM WF_ACTIVITY_TRANSITIONS WAT1
1403: WHERE WAT1.FROM_PROCESS_ACTIVITY = fromact
1404: AND (WAT1.RESULT_CODE in (fromact_result, wf_engine.eng_trans_any)
1405: OR (WAT1.RESULT_CODE = wf_engine.eng_trans_default
1406: AND NOT EXISTS
1407: (SELECT NULL
1408: FROM WF_ACTIVITY_TRANSITIONS WAT2

Line 1405: OR (WAT1.RESULT_CODE = wf_engine.eng_trans_default

1401: WAT1.TO_PROCESS_ACTIVITY
1402: FROM WF_ACTIVITY_TRANSITIONS WAT1
1403: WHERE WAT1.FROM_PROCESS_ACTIVITY = fromact
1404: AND (WAT1.RESULT_CODE in (fromact_result, wf_engine.eng_trans_any)
1405: OR (WAT1.RESULT_CODE = wf_engine.eng_trans_default
1406: AND NOT EXISTS
1407: (SELECT NULL
1408: FROM WF_ACTIVITY_TRANSITIONS WAT2
1409: WHERE WAT2.FROM_PROCESS_ACTIVITY = fromact

Line 1431: Wf_Engine_Util.Reset_Activities(itemtype, itemkey, goalid, TRUE);

1427: begin
1428: -- Goal has been found. Reset the activity and all following it on this
1429: -- level, then set status to waiting for possible re-execution.
1430: if (rootid = goalid) then
1431: Wf_Engine_Util.Reset_Activities(itemtype, itemkey, goalid, TRUE);
1432: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, goalid,
1433: wf_engine.eng_active, wf_engine.eng_null, sysdate, null);
1434: return(TRUE);
1435: end if;

Line 1433: wf_engine.eng_active, wf_engine.eng_null, sysdate, null);

1429: -- level, then set status to waiting for possible re-execution.
1430: if (rootid = goalid) then
1431: Wf_Engine_Util.Reset_Activities(itemtype, itemkey, goalid, TRUE);
1432: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, goalid,
1433: wf_engine.eng_active, wf_engine.eng_null, sysdate, null);
1434: return(TRUE);
1435: end if;
1436:
1437: -- Otherwise, loop through children of rootid.

Line 1447: if (Wf_Engine_Util.Reset_Tree(itemtype, itemkey, childarr(i), goalid,

1443:
1444: i := 0;
1445: while (childarr(i) is not null) loop
1446: -- Check if goal is in the subtree rooted at this child
1447: if (Wf_Engine_Util.Reset_Tree(itemtype, itemkey, childarr(i), goalid,
1448: actdate)) then
1449:
1450: -- Goal has been found in a child of this activity.
1451: Wf_Item_Activity_Status.Result(itemtype, itemkey, rootid,

Line 1458: if (status = wf_engine.eng_completed) then

1454: -- Reset any activities FOLLOWING the root.
1455: -- Do not reset the root itself - it is a process and its children
1456: -- were already reset in the recursive call.
1457: -- Likewise, do not reset actual child - it has already been reset.
1458: if (status = wf_engine.eng_completed) then
1459: --
1460: -- Check WF_CACHE
1461: WF_CACHE.GetActivityTransitions(FromActID=>rootid,
1462: result=>result,

Line 1545: Wf_Engine_Util.Reset_Activities(itemtype, itemkey, actarr(j), TRUE);

1541: actarr(j) := '';
1542:
1543: j := 0;
1544: while (actarr(j) is not null) loop
1545: Wf_Engine_Util.Reset_Activities(itemtype, itemkey, actarr(j), TRUE);
1546: j := j + 1;
1547: end loop;
1548: end if;
1549:

Line 1561: if (nvl(status, 'x') <> wf_engine.eng_active) then

1557: end if;
1558: --
1559:
1560: -- Set the root activity status to active if not already
1561: if (nvl(status, 'x') <> wf_engine.eng_active) then
1562: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, rootid,
1563: wf_engine.eng_active, wf_engine.eng_null, sysdate, null);
1564: end if;
1565:

Line 1563: wf_engine.eng_active, wf_engine.eng_null, sysdate, null);

1559:
1560: -- Set the root activity status to active if not already
1561: if (nvl(status, 'x') <> wf_engine.eng_active) then
1562: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, rootid,
1563: wf_engine.eng_active, wf_engine.eng_null, sysdate, null);
1564: end if;
1565:
1566: -- Goal has been found, so exit now
1567: return(TRUE);

Line 1577: Wf_Core.Context('Wf_Engine_Util', 'Reset_Tree', itemtype, itemkey,

1573: -- Goal not found anywhere.
1574: return(FALSE);
1575: exception
1576: when others then
1577: Wf_Core.Context('Wf_Engine_Util', 'Reset_Tree', itemtype, itemkey,
1578: to_char(rootid), to_char(goalid), to_char(actdate));
1579: raise;
1580: end Reset_Tree;
1581:

Line 1620: wf_engine.eng_completed,

1616: ) SELECT
1617: ITEM_TYPE,
1618: ITEM_KEY,
1619: PROCESS_ACTIVITY,
1620: wf_engine.eng_completed,
1621: decode(ACTIVITY_STATUS,
1622: wf_engine.eng_completed, ACTIVITY_RESULT_CODE,
1623: wf_engine.eng_force),
1624: ASSIGNED_USER,

Line 1622: wf_engine.eng_completed, ACTIVITY_RESULT_CODE,

1618: ITEM_KEY,
1619: PROCESS_ACTIVITY,
1620: wf_engine.eng_completed,
1621: decode(ACTIVITY_STATUS,
1622: wf_engine.eng_completed, ACTIVITY_RESULT_CODE,
1623: wf_engine.eng_force),
1624: ASSIGNED_USER,
1625: NOTIFICATION_ID,
1626: OUTBOUND_QUEUE_ID,

Line 1623: wf_engine.eng_force),

1619: PROCESS_ACTIVITY,
1620: wf_engine.eng_completed,
1621: decode(ACTIVITY_STATUS,
1622: wf_engine.eng_completed, ACTIVITY_RESULT_CODE,
1623: wf_engine.eng_force),
1624: ASSIGNED_USER,
1625: NOTIFICATION_ID,
1626: OUTBOUND_QUEUE_ID,
1627: nvl(BEGIN_DATE, sysdate),

Line 1667: -- wf_engine.eng_completed,

1663: --) SELECT
1664: -- ITEM_TYPE,
1665: -- ITEM_KEY,
1666: -- PROCESS_ACTIVITY,
1667: -- wf_engine.eng_completed,
1668: -- decode(ACTIVITY_STATUS,
1669: -- wf_engine.eng_completed, ACTIVITY_RESULT_CODE,
1670: -- wf_engine.eng_force),
1671: -- ASSIGNED_USER,

Line 1669: -- wf_engine.eng_completed, ACTIVITY_RESULT_CODE,

1665: -- ITEM_KEY,
1666: -- PROCESS_ACTIVITY,
1667: -- wf_engine.eng_completed,
1668: -- decode(ACTIVITY_STATUS,
1669: -- wf_engine.eng_completed, ACTIVITY_RESULT_CODE,
1670: -- wf_engine.eng_force),
1671: -- ASSIGNED_USER,
1672: -- NOTIFICATION_ID,
1673: -- OUTBOUND_QUEUE_ID,

Line 1670: -- wf_engine.eng_force),

1666: -- PROCESS_ACTIVITY,
1667: -- wf_engine.eng_completed,
1668: -- decode(ACTIVITY_STATUS,
1669: -- wf_engine.eng_completed, ACTIVITY_RESULT_CODE,
1670: -- wf_engine.eng_force),
1671: -- ASSIGNED_USER,
1672: -- NOTIFICATION_ID,
1673: -- OUTBOUND_QUEUE_ID,
1674: -- nvl(BEGIN_DATE, sysdate),

Line 1689: if (Wf_Engine.Debug) then

1685: --WHERE ITEM_TYPE = itemtype
1686: --AND ITEM_KEY = itemkey
1687: --AND PROCESS_ACTIVITY = actid;
1688:
1689: if (Wf_Engine.Debug) then
1690: commit;
1691: end if;
1692:
1693: Wf_Item_Activity_Status.Delete_Status(itemtype, itemkey, actid);

Line 1697: Wf_Core.Context('Wf_Engine_Util', 'Move_To_History', itemtype, itemkey,

1693: Wf_Item_Activity_Status.Delete_Status(itemtype, itemkey, actid);
1694:
1695: EXCEPTION
1696: when OTHERS then
1697: Wf_Core.Context('Wf_Engine_Util', 'Move_To_History', itemtype, itemkey,
1698: to_char(actid));
1699: raise;
1700:
1701: END move_to_history;

Line 1730: if (acttype = wf_engine.eng_function) then

1726: begin
1727: actdate := Wf_Item.Active_Date(itemtype, itemkey);
1728: acttype := Wf_Activity.Instance_Type(actid, actdate);
1729:
1730: if (acttype = wf_engine.eng_function) then
1731: funcname := Wf_Activity.Activity_Function(itemtype, itemkey, actid);
1732: if (funcname is null) then
1733: Wf_Core.Token('TYPE', itemtype);
1734: Wf_Core.Token('NAME', to_char(actid));

Line 1742: if (acttype = wf_engine.eng_notification) then

1738:
1739: -- Execute the activity function
1740: Wf_Core.Clear;
1741: begin
1742: if (acttype = wf_engine.eng_notification) then
1743: Wf_Engine_Util.Notification(itemtype, itemkey, actid, funmode, result);
1744: elsif (acttype = wf_engine.eng_function) then
1745: Wf_Engine_Util.Function_Call(funcname, itemtype, itemkey, actid,
1746: funmode, result);

Line 1743: Wf_Engine_Util.Notification(itemtype, itemkey, actid, funmode, result);

1739: -- Execute the activity function
1740: Wf_Core.Clear;
1741: begin
1742: if (acttype = wf_engine.eng_notification) then
1743: Wf_Engine_Util.Notification(itemtype, itemkey, actid, funmode, result);
1744: elsif (acttype = wf_engine.eng_function) then
1745: Wf_Engine_Util.Function_Call(funcname, itemtype, itemkey, actid,
1746: funmode, result);
1747: elsif (acttype = wf_engine.eng_event) then

Line 1744: elsif (acttype = wf_engine.eng_function) then

1740: Wf_Core.Clear;
1741: begin
1742: if (acttype = wf_engine.eng_notification) then
1743: Wf_Engine_Util.Notification(itemtype, itemkey, actid, funmode, result);
1744: elsif (acttype = wf_engine.eng_function) then
1745: Wf_Engine_Util.Function_Call(funcname, itemtype, itemkey, actid,
1746: funmode, result);
1747: elsif (acttype = wf_engine.eng_event) then
1748: Wf_Engine_Util.Event_Activity(itemtype, itemkey, actid, funmode, result);

Line 1745: Wf_Engine_Util.Function_Call(funcname, itemtype, itemkey, actid,

1741: begin
1742: if (acttype = wf_engine.eng_notification) then
1743: Wf_Engine_Util.Notification(itemtype, itemkey, actid, funmode, result);
1744: elsif (acttype = wf_engine.eng_function) then
1745: Wf_Engine_Util.Function_Call(funcname, itemtype, itemkey, actid,
1746: funmode, result);
1747: elsif (acttype = wf_engine.eng_event) then
1748: Wf_Engine_Util.Event_Activity(itemtype, itemkey, actid, funmode, result);
1749: else

Line 1747: elsif (acttype = wf_engine.eng_event) then

1743: Wf_Engine_Util.Notification(itemtype, itemkey, actid, funmode, result);
1744: elsif (acttype = wf_engine.eng_function) then
1745: Wf_Engine_Util.Function_Call(funcname, itemtype, itemkey, actid,
1746: funmode, result);
1747: elsif (acttype = wf_engine.eng_event) then
1748: Wf_Engine_Util.Event_Activity(itemtype, itemkey, actid, funmode, result);
1749: else
1750: -- Bad activity type, don't know how to execute.
1751: Wf_Core.Token('ITEM_TYPE', itemtype);

Line 1748: Wf_Engine_Util.Event_Activity(itemtype, itemkey, actid, funmode, result);

1744: elsif (acttype = wf_engine.eng_function) then
1745: Wf_Engine_Util.Function_Call(funcname, itemtype, itemkey, actid,
1746: funmode, result);
1747: elsif (acttype = wf_engine.eng_event) then
1748: Wf_Engine_Util.Event_Activity(itemtype, itemkey, actid, funmode, result);
1749: else
1750: -- Bad activity type, don't know how to execute.
1751: Wf_Core.Token('ITEM_TYPE', itemtype);
1752: Wf_Core.Token('ITEM_KEY', itemkey);

Line 1759: if (itemkey = wf_engine.eng_synch) then

1755: Wf_Core.Raise('WFSQL_INTERNAL');
1756: end if;
1757: exception
1758: when others then
1759: if (itemkey = wf_engine.eng_synch) then
1760: -- SYNCHMODE: No saved errors allowed.
1761: -- Raise exception directly to calling process.
1762: raise;
1763: elsif (funmode <> wf_engine.eng_cancel) then

Line 1763: elsif (funmode <> wf_engine.eng_cancel) then

1759: if (itemkey = wf_engine.eng_synch) then
1760: -- SYNCHMODE: No saved errors allowed.
1761: -- Raise exception directly to calling process.
1762: raise;
1763: elsif (funmode <> wf_engine.eng_cancel) then
1764: -- Set error info columns if activity function raised exception,
1765: -- unless running in cancel mode.
1766: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,
1767: wf_engine.eng_exception, FALSE);

Line 1767: wf_engine.eng_exception, FALSE);

1763: elsif (funmode <> wf_engine.eng_cancel) then
1764: -- Set error info columns if activity function raised exception,
1765: -- unless running in cancel mode.
1766: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,
1767: wf_engine.eng_exception, FALSE);
1768: result := wf_engine.eng_error||':'||wf_engine.eng_exception;
1769: end if;
1770: end;
1771:

Line 1768: result := wf_engine.eng_error||':'||wf_engine.eng_exception;

1764: -- Set error info columns if activity function raised exception,
1765: -- unless running in cancel mode.
1766: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,
1767: wf_engine.eng_exception, FALSE);
1768: result := wf_engine.eng_error||':'||wf_engine.eng_exception;
1769: end if;
1770: end;
1771:
1772: -- The engine does not care about the result when undoing a function

Line 1773: if (funmode = wf_engine.eng_cancel) then

1769: end if;
1770: end;
1771:
1772: -- The engine does not care about the result when undoing a function
1773: if (funmode = wf_engine.eng_cancel) then
1774: return;
1775: end if;
1776:
1777: -- Possible results :

Line 1786: if (substr(result, 1, length(wf_engine.eng_error)) =

1782: -- COMPLETE[:result]
1783: -- result -> this implies COMPLETE:result
1784:
1785: -- Handle different results
1786: if (substr(result, 1, length(wf_engine.eng_error)) =
1787: wf_engine.eng_error) then
1788: -- Get the error code
1789: id := substr(result, length(wf_engine.eng_error)+2, 30);
1790: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actid,

Line 1787: wf_engine.eng_error) then

1783: -- result -> this implies COMPLETE:result
1784:
1785: -- Handle different results
1786: if (substr(result, 1, length(wf_engine.eng_error)) =
1787: wf_engine.eng_error) then
1788: -- Get the error code
1789: id := substr(result, length(wf_engine.eng_error)+2, 30);
1790: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actid,
1791: wf_engine.eng_error, id);

Line 1789: id := substr(result, length(wf_engine.eng_error)+2, 30);

1785: -- Handle different results
1786: if (substr(result, 1, length(wf_engine.eng_error)) =
1787: wf_engine.eng_error) then
1788: -- Get the error code
1789: id := substr(result, length(wf_engine.eng_error)+2, 30);
1790: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actid,
1791: wf_engine.eng_error, id);
1792:
1793: -- Call error_process to execute any error processes.

Line 1791: wf_engine.eng_error, id);

1787: wf_engine.eng_error) then
1788: -- Get the error code
1789: id := substr(result, length(wf_engine.eng_error)+2, 30);
1790: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actid,
1791: wf_engine.eng_error, id);
1792:
1793: -- Call error_process to execute any error processes.
1794: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid, id);
1795:

Line 1794: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid, id);

1790: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actid,
1791: wf_engine.eng_error, id);
1792:
1793: -- Call error_process to execute any error processes.
1794: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid, id);
1795:
1796: elsif (result = wf_engine.eng_waiting) then
1797: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actid,
1798: wf_engine.eng_waiting, '', to_date(NULL), to_date(NULL));

Line 1796: elsif (result = wf_engine.eng_waiting) then

1792:
1793: -- Call error_process to execute any error processes.
1794: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid, id);
1795:
1796: elsif (result = wf_engine.eng_waiting) then
1797: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actid,
1798: wf_engine.eng_waiting, '', to_date(NULL), to_date(NULL));
1799:
1800: elsif (substr(result, 1, length(wf_engine.eng_deferred)) =

Line 1798: wf_engine.eng_waiting, '', to_date(NULL), to_date(NULL));

1794: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid, id);
1795:
1796: elsif (result = wf_engine.eng_waiting) then
1797: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actid,
1798: wf_engine.eng_waiting, '', to_date(NULL), to_date(NULL));
1799:
1800: elsif (substr(result, 1, length(wf_engine.eng_deferred)) =
1801: wf_engine.eng_deferred) then
1802: -- Extract the resume_date if one was returned

Line 1800: elsif (substr(result, 1, length(wf_engine.eng_deferred)) =

1796: elsif (result = wf_engine.eng_waiting) then
1797: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actid,
1798: wf_engine.eng_waiting, '', to_date(NULL), to_date(NULL));
1799:
1800: elsif (substr(result, 1, length(wf_engine.eng_deferred)) =
1801: wf_engine.eng_deferred) then
1802: -- Extract the resume_date if one was returned
1803: col1 := instr(result, ':', 1, 1);
1804: if (col1 <> 0) then

Line 1801: wf_engine.eng_deferred) then

1797: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actid,
1798: wf_engine.eng_waiting, '', to_date(NULL), to_date(NULL));
1799:
1800: elsif (substr(result, 1, length(wf_engine.eng_deferred)) =
1801: wf_engine.eng_deferred) then
1802: -- Extract the resume_date if one was returned
1803: col1 := instr(result, ':', 1, 1);
1804: if (col1 <> 0) then
1805: resume_date := to_date(substr(result, col1+1), wf_engine.date_format);

Line 1805: resume_date := to_date(substr(result, col1+1), wf_engine.date_format);

1801: wf_engine.eng_deferred) then
1802: -- Extract the resume_date if one was returned
1803: col1 := instr(result, ':', 1, 1);
1804: if (col1 <> 0) then
1805: resume_date := to_date(substr(result, col1+1), wf_engine.date_format);
1806: else
1807: resume_date := to_date(NULL);
1808: end if;
1809:

Line 1813: wf_engine.eng_deferred, wf_engine.eng_null, resume_date,

1809:
1810: -- Set the status to 'DEFERRED', and reset the begin_date to the
1811: -- extracted resume_date if there is one.
1812: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actid,
1813: wf_engine.eng_deferred, wf_engine.eng_null, resume_date,
1814: to_date(NULL));
1815:
1816: elsif (substr(result, 1, length(wf_engine.eng_notified)) =
1817: wf_engine.eng_notified) then

Line 1816: elsif (substr(result, 1, length(wf_engine.eng_notified)) =

1812: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actid,
1813: wf_engine.eng_deferred, wf_engine.eng_null, resume_date,
1814: to_date(NULL));
1815:
1816: elsif (substr(result, 1, length(wf_engine.eng_notified)) =
1817: wf_engine.eng_notified) then
1818: -- Get the notification id and user
1819: col1 := instr(result, ':', 1, 1);
1820: col2 := instr(result, ':', 1, 2);

Line 1817: wf_engine.eng_notified) then

1813: wf_engine.eng_deferred, wf_engine.eng_null, resume_date,
1814: to_date(NULL));
1815:
1816: elsif (substr(result, 1, length(wf_engine.eng_notified)) =
1817: wf_engine.eng_notified) then
1818: -- Get the notification id and user
1819: col1 := instr(result, ':', 1, 1);
1820: col2 := instr(result, ':', 1, 2);
1821: if ((col1 <> 0) and (col2 <> 0)) then

Line 1828: if (nvl(id, wf_engine.eng_null) <> wf_engine.eng_null) then

1824:
1825: -- Set notification id and user, but only if not null.
1826: -- This is to allow for pseudo-notifications that are only blocking
1827: -- waiting for external completion.
1828: if (nvl(id, wf_engine.eng_null) <> wf_engine.eng_null) then
1829: Wf_Item_Activity_Status.Update_Notification(itemtype, itemkey, actid,
1830: to_number(id), notuser);
1831: end if;
1832: end if;

Line 1834: if ((nvl(id, wf_engine.eng_null) <> wf_engine.eng_null) and

1830: to_number(id), notuser);
1831: end if;
1832: end if;
1833:
1834: if ((nvl(id, wf_engine.eng_null) <> wf_engine.eng_null) and
1835: not Wf_Notification.OpenNotificationsExist(id)) then
1836: -- Notification has already been closed, presumably by an
1837: -- auto-routing rule that has already submitted the response.
1838: -- If this is the case, the notification has been responded to

Line 1844: result := Wf_Engine.GetItemAttrText(itemtype, itemkey, 'RESULT');

1840: -- completion (see comments in 'complete' processing in CB).
1841: -- Call complete_activity here to continue processing immediately
1842: -- instead of just marking activity as notified.
1843:
1844: result := Wf_Engine.GetItemAttrText(itemtype, itemkey, 'RESULT');
1845: Wf_Engine_Util.Complete_Activity(itemtype, itemkey, actid, result);
1846:
1847: else
1848: -- Notification not auto-routed, or pseudo-notification.

Line 1845: Wf_Engine_Util.Complete_Activity(itemtype, itemkey, actid, result);

1841: -- Call complete_activity here to continue processing immediately
1842: -- instead of just marking activity as notified.
1843:
1844: result := Wf_Engine.GetItemAttrText(itemtype, itemkey, 'RESULT');
1845: Wf_Engine_Util.Complete_Activity(itemtype, itemkey, actid, result);
1846:
1847: else
1848: -- Notification not auto-routed, or pseudo-notification.
1849: -- In either case, mark status NOTIFIED to block execution.

Line 1851: wf_engine.eng_notified, '', to_date(NULL),to_date(NULL));

1847: else
1848: -- Notification not auto-routed, or pseudo-notification.
1849: -- In either case, mark status NOTIFIED to block execution.
1850: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actid,
1851: wf_engine.eng_notified, '', to_date(NULL),to_date(NULL));
1852: end if;
1853:
1854: else -- Assume COMPLETE
1855: -- Strip off optional 'COMPLETE:' tag

Line 1856: if (substr(result, 1, length(wf_engine.eng_completed)+1) =

1852: end if;
1853:
1854: else -- Assume COMPLETE
1855: -- Strip off optional 'COMPLETE:' tag
1856: if (substr(result, 1, length(wf_engine.eng_completed)+1) =
1857: wf_engine.eng_completed||':') then
1858: result := substr(result, length(wf_engine.eng_completed)+2, 30);
1859: else
1860: result := substr(result, 1, 30);

Line 1857: wf_engine.eng_completed||':') then

1853:
1854: else -- Assume COMPLETE
1855: -- Strip off optional 'COMPLETE:' tag
1856: if (substr(result, 1, length(wf_engine.eng_completed)+1) =
1857: wf_engine.eng_completed||':') then
1858: result := substr(result, length(wf_engine.eng_completed)+2, 30);
1859: else
1860: result := substr(result, 1, 30);
1861: end if;

Line 1858: result := substr(result, length(wf_engine.eng_completed)+2, 30);

1854: else -- Assume COMPLETE
1855: -- Strip off optional 'COMPLETE:' tag
1856: if (substr(result, 1, length(wf_engine.eng_completed)+1) =
1857: wf_engine.eng_completed||':') then
1858: result := substr(result, length(wf_engine.eng_completed)+2, 30);
1859: else
1860: result := substr(result, 1, 30);
1861: end if;
1862:

Line 1863: Wf_Engine_Util.Complete_Activity(itemtype, itemkey, actid, result);

1859: else
1860: result := substr(result, 1, 30);
1861: end if;
1862:
1863: Wf_Engine_Util.Complete_Activity(itemtype, itemkey, actid, result);
1864: end if;
1865:
1866: exception
1867: when others then

Line 1868: Wf_Core.Context('Wf_Engine_Util', 'Execute_Activity', itemtype, itemkey,

1864: end if;
1865:
1866: exception
1867: when others then
1868: Wf_Core.Context('Wf_Engine_Util', 'Execute_Activity', itemtype, itemkey,
1869: to_char(actid), funmode);
1870: raise;
1871: end execute_activity;
1872:

Line 1904: result := wf_engine.eng_completed||':'||wf_engine.eng_null;

1900: begin
1901: --<6133861:rwunderl> If this is a no-op, we do not need to perform any
1902: --processing including the selector function.
1903: if ( upper(funname) = 'WF_STANDARD.NOOP') then
1904: result := wf_engine.eng_completed||':'||wf_engine.eng_null;
1905: return;
1906: end if;
1907:
1908: begin

Line 1914: if (Wf_Engine.context_nid is null) then

1910: savepoint do_execute;
1911: -- bug 4307516
1912: -- do not run set context via selector function within a post-
1913: -- notification function
1914: if (Wf_Engine.context_nid is null) then
1915: -- First initialize context if not already done in this session
1916: if (wf_engine.setctx_itemtype is null or
1917: wf_engine.setctx_itemtype <> itemtype or
1918: wf_engine.setctx_itemkey is null or

Line 1916: if (wf_engine.setctx_itemtype is null or

1912: -- do not run set context via selector function within a post-
1913: -- notification function
1914: if (Wf_Engine.context_nid is null) then
1915: -- First initialize context if not already done in this session
1916: if (wf_engine.setctx_itemtype is null or
1917: wf_engine.setctx_itemtype <> itemtype or
1918: wf_engine.setctx_itemkey is null or
1919: wf_engine.setctx_itemkey <> itemkey) then
1920: -- Context is not set, call selector.

Line 1917: wf_engine.setctx_itemtype <> itemtype or

1913: -- notification function
1914: if (Wf_Engine.context_nid is null) then
1915: -- First initialize context if not already done in this session
1916: if (wf_engine.setctx_itemtype is null or
1917: wf_engine.setctx_itemtype <> itemtype or
1918: wf_engine.setctx_itemkey is null or
1919: wf_engine.setctx_itemkey <> itemkey) then
1920: -- Context is not set, call selector.
1921: -- NOTE: Be sure to set setctx globals BEFORE calling

Line 1918: wf_engine.setctx_itemkey is null or

1914: if (Wf_Engine.context_nid is null) then
1915: -- First initialize context if not already done in this session
1916: if (wf_engine.setctx_itemtype is null or
1917: wf_engine.setctx_itemtype <> itemtype or
1918: wf_engine.setctx_itemkey is null or
1919: wf_engine.setctx_itemkey <> itemkey) then
1920: -- Context is not set, call selector.
1921: -- NOTE: Be sure to set setctx globals BEFORE calling
1922: -- execute_selector_function or recursive loop will develop.

Line 1919: wf_engine.setctx_itemkey <> itemkey) then

1915: -- First initialize context if not already done in this session
1916: if (wf_engine.setctx_itemtype is null or
1917: wf_engine.setctx_itemtype <> itemtype or
1918: wf_engine.setctx_itemkey is null or
1919: wf_engine.setctx_itemkey <> itemkey) then
1920: -- Context is not set, call selector.
1921: -- NOTE: Be sure to set setctx globals BEFORE calling
1922: -- execute_selector_function or recursive loop will develop.
1923: wf_engine.setctx_itemtype := itemtype;

Line 1923: wf_engine.setctx_itemtype := itemtype;

1919: wf_engine.setctx_itemkey <> itemkey) then
1920: -- Context is not set, call selector.
1921: -- NOTE: Be sure to set setctx globals BEFORE calling
1922: -- execute_selector_function or recursive loop will develop.
1923: wf_engine.setctx_itemtype := itemtype;
1924: wf_engine.setctx_itemkey := itemkey;
1925:
1926: -- check TEST_CTX
1927: temp := Wf_Engine_Util.Execute_Selector_Function(itemtype, itemkey,

Line 1924: wf_engine.setctx_itemkey := itemkey;

1920: -- Context is not set, call selector.
1921: -- NOTE: Be sure to set setctx globals BEFORE calling
1922: -- execute_selector_function or recursive loop will develop.
1923: wf_engine.setctx_itemtype := itemtype;
1924: wf_engine.setctx_itemkey := itemkey;
1925:
1926: -- check TEST_CTX
1927: temp := Wf_Engine_Util.Execute_Selector_Function(itemtype, itemkey,
1928: wf_engine.eng_testctx);

Line 1927: temp := Wf_Engine_Util.Execute_Selector_Function(itemtype, itemkey,

1923: wf_engine.setctx_itemtype := itemtype;
1924: wf_engine.setctx_itemkey := itemkey;
1925:
1926: -- check TEST_CTX
1927: temp := Wf_Engine_Util.Execute_Selector_Function(itemtype, itemkey,
1928: wf_engine.eng_testctx);
1929: if (nvl(temp, 'TRUE') = 'TRUE' ) then
1930: -- it does not care about the context (null)
1931: -- or the context is already correct ('TRUE')

Line 1928: wf_engine.eng_testctx);

1924: wf_engine.setctx_itemkey := itemkey;
1925:
1926: -- check TEST_CTX
1927: temp := Wf_Engine_Util.Execute_Selector_Function(itemtype, itemkey,
1928: wf_engine.eng_testctx);
1929: if (nvl(temp, 'TRUE') = 'TRUE' ) then
1930: -- it does not care about the context (null)
1931: -- or the context is already correct ('TRUE')
1932: -- do nothing in either case

Line 1935: if (wf_engine.preserved_context) then

1931: -- or the context is already correct ('TRUE')
1932: -- do nothing in either case
1933: null;
1934: elsif (temp = 'FALSE') then
1935: if (wf_engine.preserved_context) then
1936: defer_mode := true;
1937: -- Unset the itemType/itemKey context since we
1938: --are deferring this item to the background engine and the
1939: --selector has not really been called in set_ctx mode.

Line 1940: wf_engine.setctx_itemtype := null;

1936: defer_mode := true;
1937: -- Unset the itemType/itemKey context since we
1938: --are deferring this item to the background engine and the
1939: --selector has not really been called in set_ctx mode.
1940: wf_engine.setctx_itemtype := null;
1941: wf_engine.setctx_itemkey := null;
1942:
1943: else
1944: setctx_mode := true;

Line 1941: wf_engine.setctx_itemkey := null;

1937: -- Unset the itemType/itemKey context since we
1938: --are deferring this item to the background engine and the
1939: --selector has not really been called in set_ctx mode.
1940: wf_engine.setctx_itemtype := null;
1941: wf_engine.setctx_itemkey := null;
1942:
1943: else
1944: setctx_mode := true;
1945: end if;

Line 1954: result := wf_engine.eng_deferred;

1950:
1951: if (defer_mode) then
1952: -- defer to background engine means return a result of 'DEFERRED'
1953: -- do not run the actual function, return right away.
1954: result := wf_engine.eng_deferred;
1955: return;
1956: end if;
1957:
1958: if (setctx_mode) then

Line 1959: temp := Wf_Engine_Util.Execute_Selector_Function(itemtype, itemkey,

1955: return;
1956: end if;
1957:
1958: if (setctx_mode) then
1959: temp := Wf_Engine_Util.Execute_Selector_Function(itemtype, itemkey,
1960: wf_engine.eng_setctx);
1961: end if;
1962: end if;
1963:

Line 1960: wf_engine.eng_setctx);

1956: end if;
1957:
1958: if (setctx_mode) then
1959: temp := Wf_Engine_Util.Execute_Selector_Function(itemtype, itemkey,
1960: wf_engine.eng_setctx);
1961: end if;
1962: end if;
1963:
1964: Wf_Core.Clear;

Line 1971: 'wf.plsql.wf_engine_util.function_call.actfunc_callout',

1967: '012345678901234567890123456789012345678901234567890123456789';
1968:
1969: if (wf_log_pkg.level_statement >= fnd_log.g_current_runtime_level) then
1970: wf_log_pkg.string2(wf_log_pkg.level_statement,
1971: 'wf.plsql.wf_engine_util.function_call.actfunc_callout',
1972: 'Start executing PLSQL procedure - '||funname, true);
1973: end if;
1974:
1975: Wf_Function_Call.Execute(funname, itemtype, itemkey, actid, funmode,

Line 1995: 'wf.plsql.wf_engine_util.function_call.actfunc_callout',

1991: end if;
1992:
1993: if (wf_log_pkg.level_statement >= fnd_log.g_current_runtime_level) then
1994: wf_log_pkg.string2(wf_log_pkg.level_statement,
1995: 'wf.plsql.wf_engine_util.function_call.actfunc_callout',
1996: 'End executing PLSQL procedure - '||funname, false);
1997: end if;
1998:
1999: -- Check for no return value error.

Line 2018: -- if (acttype = wf_engine.eng_notification) then

2014: make Resultout optional */
2015: -- actdate := Wf_Item.Active_Date(itemtype, itemkey);
2016: -- acttype := Wf_Activity.Instance_Type(actid, actdate);
2017:
2018: -- if (acttype = wf_engine.eng_notification) then
2019: if (Wf_Engine.context_nid is not null) then
2020: temp := null;
2021: else
2022: -- This is a real function. Set an error.

Line 2019: if (Wf_Engine.context_nid is not null) then

2015: -- actdate := Wf_Item.Active_Date(itemtype, itemkey);
2016: -- acttype := Wf_Activity.Instance_Type(actid, actdate);
2017:
2018: -- if (acttype = wf_engine.eng_notification) then
2019: if (Wf_Engine.context_nid is not null) then
2020: temp := null;
2021: else
2022: -- This is a real function. Set an error.
2023: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,

Line 2024: wf_engine.eng_noresult, FALSE);

2020: temp := null;
2021: else
2022: -- This is a real function. Set an error.
2023: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,
2024: wf_engine.eng_noresult, FALSE);
2025: temp := wf_engine.eng_error||':'||wf_engine.eng_noresult;
2026: end if;
2027:
2028: end if;

Line 2025: temp := wf_engine.eng_error||':'||wf_engine.eng_noresult;

2021: else
2022: -- This is a real function. Set an error.
2023: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,
2024: wf_engine.eng_noresult, FALSE);
2025: temp := wf_engine.eng_error||':'||wf_engine.eng_noresult;
2026: end if;
2027:
2028: end if;
2029: end if;

Line 2031: if (substr(temp, 1, 5) = wf_engine.eng_error) then

2027:
2028: end if;
2029: end if;
2030:
2031: if (substr(temp, 1, 5) = wf_engine.eng_error) then
2032: rollback to do_execute;
2033: end if;
2034:
2035: result := temp;

Line 2045: Wf_Core.Token('ACTIVITY', Wf_Engine.GetActivityLabel(actid));

2041: end;
2042: exception
2043: when NO_SAVEPOINT then
2044: Wf_Core.Token('FUNCTION', funname);
2045: Wf_Core.Token('ACTIVITY', Wf_Engine.GetActivityLabel(actid));
2046: Wf_Core.Raise('WFENG_COMMIT_INSIDE');
2047: end;
2048:
2049: exception

Line 2051: wf_engine.setctx_itemtype := '';

2047: end;
2048:
2049: exception
2050: when OTHERS then
2051: wf_engine.setctx_itemtype := '';
2052: wf_engine.setctx_itemkey := '';
2053: result := wf_engine.eng_error;
2054: Wf_Core.Context('Wf_Engine_Util', 'Function_Call', funname, itemtype,
2055: itemkey, to_char(actid), funmode);

Line 2052: wf_engine.setctx_itemkey := '';

2048:
2049: exception
2050: when OTHERS then
2051: wf_engine.setctx_itemtype := '';
2052: wf_engine.setctx_itemkey := '';
2053: result := wf_engine.eng_error;
2054: Wf_Core.Context('Wf_Engine_Util', 'Function_Call', funname, itemtype,
2055: itemkey, to_char(actid), funmode);
2056: raise;

Line 2053: result := wf_engine.eng_error;

2049: exception
2050: when OTHERS then
2051: wf_engine.setctx_itemtype := '';
2052: wf_engine.setctx_itemkey := '';
2053: result := wf_engine.eng_error;
2054: Wf_Core.Context('Wf_Engine_Util', 'Function_Call', funname, itemtype,
2055: itemkey, to_char(actid), funmode);
2056: raise;
2057: end function_call;

Line 2054: Wf_Core.Context('Wf_Engine_Util', 'Function_Call', funname, itemtype,

2050: when OTHERS then
2051: wf_engine.setctx_itemtype := '';
2052: wf_engine.setctx_itemkey := '';
2053: result := wf_engine.eng_error;
2054: Wf_Core.Context('Wf_Engine_Util', 'Function_Call', funname, itemtype,
2055: itemkey, to_char(actid), funmode);
2056: raise;
2057: end function_call;
2058:

Line 2108: Wf_Engine_Util.Function_Call(WF_CACHE.ItemTypes(witIND).WF_SELECTOR,

2104: end if;
2105:
2106: -- Call selector function
2107: begin
2108: Wf_Engine_Util.Function_Call(WF_CACHE.ItemTypes(witIND).WF_SELECTOR,
2109: itemtype, itemkey, null, runmode, result);
2110: exception
2111: when others then
2112: -- If this is setctx call and the function failed, unset the setctx

Line 2118: if (runmode = wf_engine.eng_setctx) then

2114: -- This is so repeated calls can be made in the same session when
2115: -- debugging selector functions.
2116: -- NOTE: Do NOT unset the flag inside function_call itself or
2117: -- recursive loop might develop.
2118: if (runmode = wf_engine.eng_setctx) then
2119: wf_engine.setctx_itemtype := '';
2120: wf_engine.setctx_itemkey := '';
2121: end if;
2122: raise;

Line 2119: wf_engine.setctx_itemtype := '';

2115: -- debugging selector functions.
2116: -- NOTE: Do NOT unset the flag inside function_call itself or
2117: -- recursive loop might develop.
2118: if (runmode = wf_engine.eng_setctx) then
2119: wf_engine.setctx_itemtype := '';
2120: wf_engine.setctx_itemkey := '';
2121: end if;
2122: raise;
2123: end;

Line 2120: wf_engine.setctx_itemkey := '';

2116: -- NOTE: Do NOT unset the flag inside function_call itself or
2117: -- recursive loop might develop.
2118: if (runmode = wf_engine.eng_setctx) then
2119: wf_engine.setctx_itemtype := '';
2120: wf_engine.setctx_itemkey := '';
2121: end if;
2122: raise;
2123: end;
2124:

Line 2126: if (runmode <> wf_engine.eng_setctx) then

2122: raise;
2123: end;
2124:
2125: -- Return result unless set mode
2126: if (runmode <> wf_engine.eng_setctx) then
2127: return(result);
2128: else
2129: return(null);
2130: end if;

Line 2133: Wf_Core.Context('Wf_Engine_Util', 'Execute_Selector_Function',

2129: return(null);
2130: end if;
2131: exception
2132: when others then
2133: Wf_Core.Context('Wf_Engine_Util', 'Execute_Selector_Function',
2134: itemtype, itemkey, runmode);
2135: raise;
2136: end Execute_Selector_Function;
2137:

Line 2163: root := Wf_Engine_Util.Execute_Selector_Function(itemtype, itemkey,

2159: process varchar2(30); -- Start activity parent process
2160: label varchar2(30); -- Start activity instance label
2161: begin
2162: -- Look for selector function to execute
2163: root := Wf_Engine_Util.Execute_Selector_Function(itemtype, itemkey,
2164: wf_engine.eng_run);
2165:
2166: -- Return root function if one found
2167: if (root is not null) then

Line 2164: wf_engine.eng_run);

2160: label varchar2(30); -- Start activity instance label
2161: begin
2162: -- Look for selector function to execute
2163: root := Wf_Engine_Util.Execute_Selector_Function(itemtype, itemkey,
2164: wf_engine.eng_run);
2165:
2166: -- Return root function if one found
2167: if (root is not null) then
2168: return(root);

Line 2224: and WPAC.START_END = wf_engine.eng_start;

2220: and WPAC.PROCESS_NAME = WAC.NAME
2221: and WPAC.PROCESS_VERSION = WAC.VERSION
2222: and WPAC.PROCESS_NAME = nvl(get_root_process.process, WPAC.PROCESS_NAME)
2223: and WPAC.INSTANCE_LABEL = get_root_process.label
2224: and WPAC.START_END = wf_engine.eng_start;
2225: exception
2226: when too_many_rows then
2227: -- Multiple processes use this start activity.
2228: -- No way to distinguish which one to use - error.

Line 2238: Wf_Core.Context('Wf_Engine_Util', 'Get_Root_Process', itemtype, itemkey,

2234:
2235: return(root);
2236: exception
2237: when others then
2238: Wf_Core.Context('Wf_Engine_Util', 'Get_Root_Process', itemtype, itemkey,
2239: activity);
2240: raise;
2241: end Get_Root_Process;
2242:

Line 2287: wf_engine.abortprocess(child_curs.item_type,child_curs.item_key);

2283:
2284: begin
2285: --Now open each cursor and call abort for each
2286: for child_curs in child_proc(itemtype , itemkey) loop
2287: wf_engine.abortprocess(child_curs.item_type,child_curs.item_key);
2288: end loop;
2289:
2290: --We only kill child process for this as master
2291: --Now master

Line 2294: wf_engine.abortprocess(master_curs.item_type,master_curs.item_key);

2290: --We only kill child process for this as master
2291: --Now master
2292: /*
2293: for master_curs in master_proc(itemtype , itemkey) loop
2294: wf_engine.abortprocess(master_curs.item_type,master_curs.item_key);
2295: end loop;
2296: */
2297: exception
2298: when others then

Line 2299: Wf_Core.Context('Wf_Engine_Util', 'Process_kill_childprocess', itemtype, itemkey);

2295: end loop;
2296: */
2297: exception
2298: when others then
2299: Wf_Core.Context('Wf_Engine_Util', 'Process_kill_childprocess', itemtype, itemkey);
2300: raise;
2301: end Process_kill_childprocess;
2302:
2303: --

Line 2353: if (itemkey = wf_engine.eng_synch) then

2349: -- SYNCHMODE: Do nothing here.
2350: -- Synchmode processes must be straight-line, no branching, no
2351: -- blocking, so there can't be anything left to kill (and if there
2352: -- was, we couldn't know about it anyway because nothing is saved).
2353: if (itemkey = wf_engine.eng_synch) then
2354: return;
2355: end if;
2356:
2357: -- Get the active date of the item to use for process versions.

Line 2374: wf_engine.eng_process) then

2370: while (childarr(i) is not null) loop
2371: childid := childarr(i);
2372:
2373: if (Wf_Activity.Instance_Type(childid, actdate) =
2374: wf_engine.eng_process) then
2375: -- If child is a process then recursively kill its children
2376: Wf_Engine_Util.Process_Kill_Children(itemtype, itemkey, childid);
2377: else
2378: -- Cancel any open notifications sent by this activity

Line 2376: Wf_Engine_Util.Process_Kill_Children(itemtype, itemkey, childid);

2372:
2373: if (Wf_Activity.Instance_Type(childid, actdate) =
2374: wf_engine.eng_process) then
2375: -- If child is a process then recursively kill its children
2376: Wf_Engine_Util.Process_Kill_Children(itemtype, itemkey, childid);
2377: else
2378: -- Cancel any open notifications sent by this activity
2379: Wf_Item_Activity_Status.Notification_Status(itemtype, itemkey,
2380: childid, notid, user);

Line 2394: if statusarr(i) = wf_engine.eng_deferred then

2390:
2391: -- If activity is defered then remove it from the deferred queue
2392: -- if you dont remove it then the background engine will remove
2393: -- it when it processes and finds it doesnt correspond.
2394: if statusarr(i) = wf_engine.eng_deferred then
2395: wf_queue.PurgeEvent(wf_queue.DeferredQueue,
2396: wf_queue.GetMessageHandle(wf_queue.DeferredQueue,
2397: itemtype , itemkey, childid));
2398: end if;

Line 2402: wf_engine.eng_completed, wf_engine.eng_force, to_date(NULL),

2398: end if;
2399:
2400: -- Complete the activity with the force result
2401: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, childid,
2402: wf_engine.eng_completed, wf_engine.eng_force, to_date(NULL),
2403: SYSDATE);
2404:
2405: -- No needs to check null type because this is internal function
2406: i := i + 1;

Line 2411: Wf_Core.Context('Wf_Engine_Util', 'Process_Kill_Children', itemtype,

2407: end loop;
2408:
2409: exception
2410: when others then
2411: Wf_Core.Context('Wf_Engine_Util', 'Process_Kill_Children', itemtype,
2412: itemkey, to_char(processid));
2413: raise;
2414:
2415: end process_kill_children;

Line 2449: AND WA2.TYPE = wf_engine.eng_process

2445: AND WPA2.ACTIVITY_ITEM_TYPE = WA2.ITEM_TYPE
2446: AND WPA2.ACTIVITY_NAME = WA2.NAME
2447: AND actdate >= WA2.BEGIN_DATE
2448: AND actdate < NVL(WA2.END_DATE, actdate+1)
2449: AND WA2.TYPE = wf_engine.eng_process
2450: AND WPA2.INSTANCE_ID = WIAS.PROCESS_ACTIVITY
2451: AND WIAS.ITEM_TYPE = itemtype
2452: AND WIAS.ITEM_KEY = itemkey
2453: AND WIAS.ACTIVITY_STATUS = 'ACTIVE'; --use literal to force index

Line 2473: wf_engine.eng_suspended, null, to_date(NULL), SYSDATE);

2469: -- While loop to handle all the children processes
2470: i := 0;
2471: while (childarr(i) is not null) loop
2472: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, childarr(i),
2473: wf_engine.eng_suspended, null, to_date(NULL), SYSDATE);
2474: suspend_child_processes(itemtype, itemkey, childarr(i));
2475: i := i + 1;
2476: end loop;
2477:

Line 2480: Wf_Core.Context('Wf_Engine_Util', 'Suspend_Child_Processes', itemtype,

2476: end loop;
2477:
2478: exception
2479: when others then
2480: Wf_Core.Context('Wf_Engine_Util', 'Suspend_Child_Processes', itemtype,
2481: itemkey, to_char(processid));
2482: raise;
2483: end suspend_child_processes;
2484:

Line 2537: wf_engine.eng_active, null, null, SYSDATE);

2533: -- While loop to handle all the children processes
2534: i := 0;
2535: while (childarr(i) is not null) loop
2536: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, childarr(i),
2537: wf_engine.eng_active, null, null, SYSDATE);
2538: resume_child_processes(itemtype, itemkey, childarr(i));
2539: i := i + 1;
2540: end loop;
2541:

Line 2544: Wf_Core.Context('Wf_Engine_Util', 'Resume_Child_Processes', itemtype,

2540: end loop;
2541:
2542: exception
2543: when others then
2544: Wf_Core.Context('Wf_Engine_Util', 'Resume_Child_Processes', itemtype,
2545: itemkey, to_char(processid));
2546: raise;
2547: end resume_child_processes;
2548:

Line 2574: if (itemkey = wf_engine.eng_synch) then

2570: prole varchar2(320);
2571: expand_role varchar2(1);
2572: begin
2573: -- SYNCHMODE: Not allowed
2574: if (itemkey = wf_engine.eng_synch) then
2575: Wf_Core.Token('OPERATION', 'Wf_Engine.Notification');
2576: Wf_Core.Raise('WFENG_SYNCH_DISABLED');
2577: end if;
2578:

Line 2575: Wf_Core.Token('OPERATION', 'Wf_Engine.Notification');

2571: expand_role varchar2(1);
2572: begin
2573: -- SYNCHMODE: Not allowed
2574: if (itemkey = wf_engine.eng_synch) then
2575: Wf_Core.Token('OPERATION', 'Wf_Engine.Notification');
2576: Wf_Core.Raise('WFENG_SYNCH_DISABLED');
2577: end if;
2578:
2579: -- Get the message, perform role, and timeout

Line 2585: Wf_Engine_Util.Notification_Send(itemtype, itemkey, actid, msg, msgtype,

2581: Wf_Activity.Notification_Info(itemtype, itemkey, actid, msg, msgtype,
2582: expand_role);
2583: prole := Wf_Activity.Perform_Role(itemtype, itemkey, actid);
2584:
2585: Wf_Engine_Util.Notification_Send(itemtype, itemkey, actid, msg, msgtype,
2586: prole, expand_role, result);
2587:
2588: exception
2589: when others then

Line 2590: wf_core.context('Wf_Engine_Util', 'Notification', itemtype, itemkey,

2586: prole, expand_role, result);
2587:
2588: exception
2589: when others then
2590: wf_core.context('Wf_Engine_Util', 'Notification', itemtype, itemkey,
2591: to_char(actid), funcmode);
2592: raise;
2593: end Notification;
2594:

Line 2640: wf_engine.g_nid := '';

2636: end if;
2637:
2638: /* Bug 2156047 */
2639: -- clear global variables to store context info
2640: wf_engine.g_nid := '';
2641: wf_engine.g_text := '';
2642:
2643: -- Construct context as itemtype:key:actid
2644: ctx := itemtype||':'||itemkey||':'||to_char(actid);

Line 2641: wf_engine.g_text := '';

2637:
2638: /* Bug 2156047 */
2639: -- clear global variables to store context info
2640: wf_engine.g_nid := '';
2641: wf_engine.g_text := '';
2642:
2643: -- Construct context as itemtype:key:actid
2644: ctx := itemtype||':'||itemkey||':'||to_char(actid);
2645:

Line 2652: priority := Wf_Engine.GetActivityAttrNumber(itemtype, itemkey, actid,

2648:
2649: -- Check for #PRIORITY activity attribute to override default
2650: -- priority of this notification
2651: begin
2652: priority := Wf_Engine.GetActivityAttrNumber(itemtype, itemkey, actid,
2653: wf_engine.eng_priority, ignore_notfound=>TRUE);
2654: exception
2655: when others then
2656: if (wf_core.error_name = 'WFENG_ACTIVITY_ATTR') then

Line 2653: wf_engine.eng_priority, ignore_notfound=>TRUE);

2649: -- Check for #PRIORITY activity attribute to override default
2650: -- priority of this notification
2651: begin
2652: priority := Wf_Engine.GetActivityAttrNumber(itemtype, itemkey, actid,
2653: wf_engine.eng_priority, ignore_notfound=>TRUE);
2654: exception
2655: when others then
2656: if (wf_core.error_name = 'WFENG_ACTIVITY_ATTR') then
2657: -- If no priority attr default to null

Line 2669: 'WF_ENGINE.CB', ctx, '', priority);

2665: -- Send notification, either to expanded role or singly
2666: -- depending on expand_role flag.
2667: if (expand_role = 'Y') then
2668: notid := Wf_Notification.SendGroup(prole, msgtype, msg, duedate,
2669: 'WF_ENGINE.CB', ctx, '', priority);
2670: else
2671: notid := Wf_Notification.Send(prole, msgtype, msg, duedate,
2672: 'WF_ENGINE.CB', ctx, '', priority);
2673: end if;

Line 2672: 'WF_ENGINE.CB', ctx, '', priority);

2668: notid := Wf_Notification.SendGroup(prole, msgtype, msg, duedate,
2669: 'WF_ENGINE.CB', ctx, '', priority);
2670: else
2671: notid := Wf_Notification.Send(prole, msgtype, msg, duedate,
2672: 'WF_ENGINE.CB', ctx, '', priority);
2673: end if;
2674:
2675: -- Check for a change in the performer. If the notification
2676: -- was automatically routed by Send, the assigned_user might have

Line 2697: result := Wf_Engine.Eng_Notified||':'||to_char(notid)||':'||performer;

2693: AND SUBTYPE = 'RESPOND');
2694:
2695: -- Response is expected.
2696: -- Return result of 'NOTIFIED:notid:role'.
2697: result := Wf_Engine.Eng_Notified||':'||to_char(notid)||':'||performer;
2698:
2699: exception
2700: when no_data_found then
2701: -- No respond attributes.

Line 2705: result := Wf_Engine.Eng_Null;

2701: -- No respond attributes.
2702: -- Set notification id, then complete immediately.
2703: Wf_Item_Activity_Status.Update_Notification(itemtype, itemkey, actid,
2704: notid, performer);
2705: result := Wf_Engine.Eng_Null;
2706: end;
2707:
2708: /* Bug 2156047 */
2709: -- Need to cache the Notification id and Performer role for

Line 2712: Wf_Engine.g_nid := notid;

2708: /* Bug 2156047 */
2709: -- Need to cache the Notification id and Performer role for
2710: -- executing Post Notification function
2711:
2712: Wf_Engine.g_nid := notid;
2713: Wf_Engine.g_text := performer;
2714:
2715: exception
2716: when others then

Line 2713: Wf_Engine.g_text := performer;

2709: -- Need to cache the Notification id and Performer role for
2710: -- executing Post Notification function
2711:
2712: Wf_Engine.g_nid := notid;
2713: Wf_Engine.g_text := performer;
2714:
2715: exception
2716: when others then
2717: Wf_Core.Context('Wf_Engine_Util', 'Notification_Send', itemtype, itemkey,

Line 2717: Wf_Core.Context('Wf_Engine_Util', 'Notification_Send', itemtype, itemkey,

2713: Wf_Engine.g_text := performer;
2714:
2715: exception
2716: when others then
2717: Wf_Core.Context('Wf_Engine_Util', 'Notification_Send', itemtype, itemkey,
2718: to_char(actid), msgtype||':'||msg);
2719: raise;
2720: end Notification_Send;
2721:

Line 2850: Wf_Core.Context('Wf_Engine_Util', 'Notification_Copy');

2846: nid:=gid;
2847:
2848: exception
2849: when others then
2850: Wf_Core.Context('Wf_Engine_Util', 'Notification_Copy');
2851: raise;
2852: end notification_copy;
2853:
2854: --Notification_refresh (PRIVATE)

Line 2902: attr_nvalue := wf_engine.GetItemAttrNumber(itemtype, itemkey, message_attr_row.TEXT_DEFAULT);

2898: attr_nvalue := '';
2899: attr_dvalue := '';
2900:
2901: if (message_attr_row.type = 'NUMBER') then
2902: attr_nvalue := wf_engine.GetItemAttrNumber(itemtype, itemkey, message_attr_row.TEXT_DEFAULT);
2903: elsif (message_attr_row.type = 'DATE') then
2904: attr_dvalue := wf_engine.GetItemAttrDate(itemtype, itemkey, message_attr_row.TEXT_DEFAULT);
2905: else
2906: attr_tvalue := wf_engine.GetItemAttrText(itemtype, itemkey, message_attr_row.TEXT_DEFAULT);

Line 2904: attr_dvalue := wf_engine.GetItemAttrDate(itemtype, itemkey, message_attr_row.TEXT_DEFAULT);

2900:
2901: if (message_attr_row.type = 'NUMBER') then
2902: attr_nvalue := wf_engine.GetItemAttrNumber(itemtype, itemkey, message_attr_row.TEXT_DEFAULT);
2903: elsif (message_attr_row.type = 'DATE') then
2904: attr_dvalue := wf_engine.GetItemAttrDate(itemtype, itemkey, message_attr_row.TEXT_DEFAULT);
2905: else
2906: attr_tvalue := wf_engine.GetItemAttrText(itemtype, itemkey, message_attr_row.TEXT_DEFAULT);
2907: end if;
2908:

Line 2906: attr_tvalue := wf_engine.GetItemAttrText(itemtype, itemkey, message_attr_row.TEXT_DEFAULT);

2902: attr_nvalue := wf_engine.GetItemAttrNumber(itemtype, itemkey, message_attr_row.TEXT_DEFAULT);
2903: elsif (message_attr_row.type = 'DATE') then
2904: attr_dvalue := wf_engine.GetItemAttrDate(itemtype, itemkey, message_attr_row.TEXT_DEFAULT);
2905: else
2906: attr_tvalue := wf_engine.GetItemAttrText(itemtype, itemkey, message_attr_row.TEXT_DEFAULT);
2907: end if;
2908:
2909: --
2910: -- Update the notification attribute

Line 2923: Wf_Core.Context('Wf_Engine_Util', 'Notification_refresh');

2919:
2920:
2921: exception
2922: when others then
2923: Wf_Core.Context('Wf_Engine_Util', 'Notification_refresh');
2924: raise;
2925: end notification_refresh;
2926:
2927:

Line 2984: erractid := Wf_Engine_Util.Activity_Parent_Process(itemtype, itemkey,

2980:
2981: Wf_Activity.Error_Process(erractid, actdate, errortype, errorprocess);
2982:
2983: while ((errorprocess is null) and (erractid <> rootid)) loop
2984: erractid := Wf_Engine_Util.Activity_Parent_Process(itemtype, itemkey,
2985: erractid);
2986: Wf_Activity.Error_Process(erractid, actdate, errortype, errorprocess);
2987: end loop;
2988:

Line 3021: Wf_Engine.CreateProcess(errortype, errkey, errorprocess);

3017: from SYS.DUAL;
3018:
3019: -- Create process and set item parent columns with ids of
3020: -- activity initiating error.
3021: Wf_Engine.CreateProcess(errortype, errkey, errorprocess);
3022: wf_engine.SetItemParent(errortype, errkey, itemtype, itemkey,
3023: to_char(actid));
3024:
3025: -- Select and set pre-defined error attributes.

Line 3022: wf_engine.SetItemParent(errortype, errkey, itemtype, itemkey,

3018:
3019: -- Create process and set item parent columns with ids of
3020: -- activity initiating error.
3021: Wf_Engine.CreateProcess(errortype, errkey, errorprocess);
3022: wf_engine.SetItemParent(errortype, errkey, itemtype, itemkey,
3023: to_char(actid));
3024:
3025: -- Select and set pre-defined error attributes.
3026: wf_item_activity_status.notification_status(itemtype, itemkey, actid,

Line 3028: label := Wf_Engine.GetActivityLabel(actid);

3024:
3025: -- Select and set pre-defined error attributes.
3026: wf_item_activity_status.notification_status(itemtype, itemkey, actid,
3027: notid, user);
3028: label := Wf_Engine.GetActivityLabel(actid);
3029:
3030: wf_item_activity_status.error_info(itemtype, itemkey, actid,
3031: errname, errmsg, errstack);
3032:

Line 3040: err_userkey := Wf_Engine.GetItemUserKey(itemtype, itemkey);

3036: x_item_type => itemtype,
3037: x_item_key => itemkey,
3038: x_admin_mode => 'YES');
3039: -- look up the user key
3040: err_userkey := Wf_Engine.GetItemUserKey(itemtype, itemkey);
3041:
3042: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',
3043: 'ERROR_ITEM_TYPE', itemtype);
3044: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',

Line 3042: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',

3038: x_admin_mode => 'YES');
3039: -- look up the user key
3040: err_userkey := Wf_Engine.GetItemUserKey(itemtype, itemkey);
3041:
3042: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',
3043: 'ERROR_ITEM_TYPE', itemtype);
3044: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',
3045: 'ERROR_ITEM_KEY', itemkey);
3046: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',

Line 3044: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',

3040: err_userkey := Wf_Engine.GetItemUserKey(itemtype, itemkey);
3041:
3042: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',
3043: 'ERROR_ITEM_TYPE', itemtype);
3044: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',
3045: 'ERROR_ITEM_KEY', itemkey);
3046: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',
3047: 'ERROR_ACTIVITY_LABEL', label);
3048: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'NUMBER',

Line 3046: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',

3042: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',
3043: 'ERROR_ITEM_TYPE', itemtype);
3044: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',
3045: 'ERROR_ITEM_KEY', itemkey);
3046: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',
3047: 'ERROR_ACTIVITY_LABEL', label);
3048: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'NUMBER',
3049: 'ERROR_ACTIVITY_ID', actid);
3050: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',

Line 3048: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'NUMBER',

3044: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',
3045: 'ERROR_ITEM_KEY', itemkey);
3046: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',
3047: 'ERROR_ACTIVITY_LABEL', label);
3048: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'NUMBER',
3049: 'ERROR_ACTIVITY_ID', actid);
3050: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',
3051: 'ERROR_RESULT_CODE', result);
3052: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'NUMBER',

Line 3050: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',

3046: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',
3047: 'ERROR_ACTIVITY_LABEL', label);
3048: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'NUMBER',
3049: 'ERROR_ACTIVITY_ID', actid);
3050: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',
3051: 'ERROR_RESULT_CODE', result);
3052: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'NUMBER',
3053: 'ERROR_NOTIFICATION_ID', to_char(notid));
3054: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',

Line 3052: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'NUMBER',

3048: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'NUMBER',
3049: 'ERROR_ACTIVITY_ID', actid);
3050: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',
3051: 'ERROR_RESULT_CODE', result);
3052: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'NUMBER',
3053: 'ERROR_NOTIFICATION_ID', to_char(notid));
3054: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',
3055: 'ERROR_ASSIGNED_USER', user);
3056: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',

Line 3054: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',

3050: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',
3051: 'ERROR_RESULT_CODE', result);
3052: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'NUMBER',
3053: 'ERROR_NOTIFICATION_ID', to_char(notid));
3054: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',
3055: 'ERROR_ASSIGNED_USER', user);
3056: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',
3057: 'ERROR_NAME', errname);
3058: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',

Line 3056: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',

3052: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'NUMBER',
3053: 'ERROR_NOTIFICATION_ID', to_char(notid));
3054: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',
3055: 'ERROR_ASSIGNED_USER', user);
3056: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',
3057: 'ERROR_NAME', errname);
3058: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',
3059: 'ERROR_MESSAGE', errmsg);
3060: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',

Line 3058: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',

3054: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',
3055: 'ERROR_ASSIGNED_USER', user);
3056: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',
3057: 'ERROR_NAME', errname);
3058: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',
3059: 'ERROR_MESSAGE', errmsg);
3060: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',
3061: 'ERROR_STACK', errstack);
3062: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',

Line 3060: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',

3056: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',
3057: 'ERROR_NAME', errname);
3058: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',
3059: 'ERROR_MESSAGE', errmsg);
3060: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',
3061: 'ERROR_STACK', errstack);
3062: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',
3063: 'ERROR_MONITOR_URL', err_url);
3064: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',

Line 3062: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',

3058: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',
3059: 'ERROR_MESSAGE', errmsg);
3060: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',
3061: 'ERROR_STACK', errstack);
3062: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',
3063: 'ERROR_MONITOR_URL', err_url);
3064: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',
3065: 'ERROR_USER_KEY', err_userkey);
3066:

Line 3064: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',

3060: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',
3061: 'ERROR_STACK', errstack);
3062: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',
3063: 'ERROR_MONITOR_URL', err_url);
3064: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',
3065: 'ERROR_USER_KEY', err_userkey);
3066:
3067: -- Run the error process.
3068: Wf_Engine.StartProcess(errortype, errkey);

Line 3068: Wf_Engine.StartProcess(errortype, errkey);

3064: Wf_Engine_Util.SetErrorItemAttr(errortype, errkey, 'TEXT',
3065: 'ERROR_USER_KEY', err_userkey);
3066:
3067: -- Run the error process.
3068: Wf_Engine.StartProcess(errortype, errkey);
3069:
3070: exception
3071: when others then
3072: -- If an error is raised in error process, do NOT raise another exception.

Line 3098: Wf_Engine.SetItemAttrText(error_type, error_key, item_attr, avalue);

3094: avalue in varchar2)
3095: is
3096: begin
3097: if (attrtype = 'TEXT') then
3098: Wf_Engine.SetItemAttrText(error_type, error_key, item_attr, avalue);
3099: else
3100: Wf_Engine.SetItemAttrNumber(error_type, error_key, item_attr, to_number(avalue));
3101: end if;
3102: exception

Line 3100: Wf_Engine.SetItemAttrNumber(error_type, error_key, item_attr, to_number(avalue));

3096: begin
3097: if (attrtype = 'TEXT') then
3098: Wf_Engine.SetItemAttrText(error_type, error_key, item_attr, avalue);
3099: else
3100: Wf_Engine.SetItemAttrNumber(error_type, error_key, item_attr, to_number(avalue));
3101: end if;
3102: exception
3103: when others then
3104: if (wf_core.error_name = 'WFENG_ITEM_ATTR') then

Line 3106: Wf_Engine.AddItemAttr(error_type, error_key, item_attr, avalue);

3102: exception
3103: when others then
3104: if (wf_core.error_name = 'WFENG_ITEM_ATTR') then
3105: if (attrtype = 'TEXT') then
3106: Wf_Engine.AddItemAttr(error_type, error_key, item_attr, avalue);
3107: WF_CORE.Clear;
3108: else
3109: Wf_Engine.AddItemAttr(error_type, error_key, item_attr, '',
3110: to_number(avalue));

Line 3109: Wf_Engine.AddItemAttr(error_type, error_key, item_attr, '',

3105: if (attrtype = 'TEXT') then
3106: Wf_Engine.AddItemAttr(error_type, error_key, item_attr, avalue);
3107: WF_CORE.Clear;
3108: else
3109: Wf_Engine.AddItemAttr(error_type, error_key, item_attr, '',
3110: to_number(avalue));
3111: WF_CORE.Clear;
3112: end if;
3113: else

Line 3168: Wf_Engine.context_nid := l_notid;

3164: -- This is context information for use by post ntf function
3165: -- when executing in modes RUN, RESPOND, TRANSFER etc.
3166: Wf_Item_Activity_Status.Notification_Status(itemtype, itemkey, actid,
3167: l_notid, l_responder);
3168: Wf_Engine.context_nid := l_notid;
3169: Wf_Engine.context_text := l_responder;
3170:
3171:
3172: -- There is a post-notification function. Execute it.

Line 3169: Wf_Engine.context_text := l_responder;

3165: -- when executing in modes RUN, RESPOND, TRANSFER etc.
3166: Wf_Item_Activity_Status.Notification_Status(itemtype, itemkey, actid,
3167: l_notid, l_responder);
3168: Wf_Engine.context_nid := l_notid;
3169: Wf_Engine.context_text := l_responder;
3170:
3171:
3172: -- There is a post-notification function. Execute it.
3173: begin

Line 3174: Wf_Engine_Util.Function_Call(funcname, itemtype, itemkey, actid, funmode,

3170:
3171:
3172: -- There is a post-notification function. Execute it.
3173: begin
3174: Wf_Engine_Util.Function_Call(funcname, itemtype, itemkey, actid, funmode,
3175: result);
3176: exception
3177: -- Set error info columns if post-notification function raised exception,
3178: -- unless running in cancel mode.

Line 3180: if (funmode <> wf_engine.eng_cancel) then

3176: exception
3177: -- Set error info columns if post-notification function raised exception,
3178: -- unless running in cancel mode.
3179: when others then
3180: if (funmode <> wf_engine.eng_cancel) then
3181: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,
3182: wf_engine.eng_exception, FALSE);
3183: result := wf_engine.eng_error||':'||wf_engine.eng_exception;
3184: end if;

Line 3182: wf_engine.eng_exception, FALSE);

3178: -- unless running in cancel mode.
3179: when others then
3180: if (funmode <> wf_engine.eng_cancel) then
3181: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,
3182: wf_engine.eng_exception, FALSE);
3183: result := wf_engine.eng_error||':'||wf_engine.eng_exception;
3184: end if;
3185: end;
3186:

Line 3183: result := wf_engine.eng_error||':'||wf_engine.eng_exception;

3179: when others then
3180: if (funmode <> wf_engine.eng_cancel) then
3181: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,
3182: wf_engine.eng_exception, FALSE);
3183: result := wf_engine.eng_error||':'||wf_engine.eng_exception;
3184: end if;
3185: end;
3186:
3187: /* Bug 2156047 */

Line 3189: Wf_Engine.context_nid := '';

3185: end;
3186:
3187: /* Bug 2156047 */
3188: -- clear context values
3189: Wf_Engine.context_nid := '';
3190: Wf_Engine.context_text := '';
3191:
3192: -- The engine does not care about the result when undoing a function
3193: if (funmode = wf_engine.eng_cancel) then

Line 3190: Wf_Engine.context_text := '';

3186:
3187: /* Bug 2156047 */
3188: -- clear context values
3189: Wf_Engine.context_nid := '';
3190: Wf_Engine.context_text := '';
3191:
3192: -- The engine does not care about the result when undoing a function
3193: if (funmode = wf_engine.eng_cancel) then
3194: return;

Line 3193: if (funmode = wf_engine.eng_cancel) then

3189: Wf_Engine.context_nid := '';
3190: Wf_Engine.context_text := '';
3191:
3192: -- The engine does not care about the result when undoing a function
3193: if (funmode = wf_engine.eng_cancel) then
3194: return;
3195: end if;
3196:
3197:

Line 3199: if ((result is null) or (result = wf_engine.eng_null)) then

3195: end if;
3196:
3197:
3198: -- Handle different results
3199: if ((result is null) or (result = wf_engine.eng_null)) then
3200: -- Assume a null result means post-notification function is not
3201: -- implemented.
3202: pntfstatus := null;
3203: pntfresult := null;

Line 3204: elsif (substr(result, 1, length(wf_engine.eng_error)) =

3200: -- Assume a null result means post-notification function is not
3201: -- implemented.
3202: pntfstatus := null;
3203: pntfresult := null;
3204: elsif (substr(result, 1, length(wf_engine.eng_error)) =
3205: wf_engine.eng_error) then
3206: -- Get the error code
3207: errcode := substr(result, length(wf_engine.eng_error)+2, 30);
3208: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actid,

Line 3205: wf_engine.eng_error) then

3201: -- implemented.
3202: pntfstatus := null;
3203: pntfresult := null;
3204: elsif (substr(result, 1, length(wf_engine.eng_error)) =
3205: wf_engine.eng_error) then
3206: -- Get the error code
3207: errcode := substr(result, length(wf_engine.eng_error)+2, 30);
3208: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actid,
3209: wf_engine.eng_error, errcode);

Line 3207: errcode := substr(result, length(wf_engine.eng_error)+2, 30);

3203: pntfresult := null;
3204: elsif (substr(result, 1, length(wf_engine.eng_error)) =
3205: wf_engine.eng_error) then
3206: -- Get the error code
3207: errcode := substr(result, length(wf_engine.eng_error)+2, 30);
3208: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actid,
3209: wf_engine.eng_error, errcode);
3210:
3211: -- Call error_process to execute any error processes.

Line 3209: wf_engine.eng_error, errcode);

3205: wf_engine.eng_error) then
3206: -- Get the error code
3207: errcode := substr(result, length(wf_engine.eng_error)+2, 30);
3208: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actid,
3209: wf_engine.eng_error, errcode);
3210:
3211: -- Call error_process to execute any error processes.
3212: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid, errcode);
3213:

Line 3212: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid, errcode);

3208: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actid,
3209: wf_engine.eng_error, errcode);
3210:
3211: -- Call error_process to execute any error processes.
3212: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid, errcode);
3213:
3214: -- Return status waiting to prevent activity from completing.
3215: pntfstatus := wf_engine.eng_waiting;
3216: pntfresult := null;

Line 3215: pntfstatus := wf_engine.eng_waiting;

3211: -- Call error_process to execute any error processes.
3212: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid, errcode);
3213:
3214: -- Return status waiting to prevent activity from completing.
3215: pntfstatus := wf_engine.eng_waiting;
3216: pntfresult := null;
3217: elsif (result = wf_engine.eng_waiting) then
3218: -- Post-notification function is not yet completed.
3219: -- Return status waiting to prevent activity from completing.

Line 3217: elsif (result = wf_engine.eng_waiting) then

3213:
3214: -- Return status waiting to prevent activity from completing.
3215: pntfstatus := wf_engine.eng_waiting;
3216: pntfresult := null;
3217: elsif (result = wf_engine.eng_waiting) then
3218: -- Post-notification function is not yet completed.
3219: -- Return status waiting to prevent activity from completing.
3220: pntfstatus := wf_engine.eng_waiting;
3221: pntfresult := null;

Line 3220: pntfstatus := wf_engine.eng_waiting;

3216: pntfresult := null;
3217: elsif (result = wf_engine.eng_waiting) then
3218: -- Post-notification function is not yet completed.
3219: -- Return status waiting to prevent activity from completing.
3220: pntfstatus := wf_engine.eng_waiting;
3221: pntfresult := null;
3222: else
3223: -- Result must be COMPLETE. Other statuses are not allowed for
3224: -- post-notification functions.

Line 3227: if (substr(result, 1, length(wf_engine.eng_completed)+1) =

3223: -- Result must be COMPLETE. Other statuses are not allowed for
3224: -- post-notification functions.
3225:
3226: -- Strip off optional 'COMPLETE:' tag from result
3227: if (substr(result, 1, length(wf_engine.eng_completed)+1) =
3228: wf_engine.eng_completed||':') then
3229: result := substr(result, length(wf_engine.eng_completed)+2, 30);
3230: end if;
3231:

Line 3228: wf_engine.eng_completed||':') then

3224: -- post-notification functions.
3225:
3226: -- Strip off optional 'COMPLETE:' tag from result
3227: if (substr(result, 1, length(wf_engine.eng_completed)+1) =
3228: wf_engine.eng_completed||':') then
3229: result := substr(result, length(wf_engine.eng_completed)+2, 30);
3230: end if;
3231:
3232: -- Return complete status and result.

Line 3229: result := substr(result, length(wf_engine.eng_completed)+2, 30);

3225:
3226: -- Strip off optional 'COMPLETE:' tag from result
3227: if (substr(result, 1, length(wf_engine.eng_completed)+1) =
3228: wf_engine.eng_completed||':') then
3229: result := substr(result, length(wf_engine.eng_completed)+2, 30);
3230: end if;
3231:
3232: -- Return complete status and result.
3233: pntfstatus := wf_engine.eng_completed;

Line 3233: pntfstatus := wf_engine.eng_completed;

3229: result := substr(result, length(wf_engine.eng_completed)+2, 30);
3230: end if;
3231:
3232: -- Return complete status and result.
3233: pntfstatus := wf_engine.eng_completed;
3234: pntfresult := result;
3235: end if;
3236: return;
3237: exception

Line 3239: Wf_Core.Context('Wf_Engine_Util', 'Execute_Post_NTF_Function', itemtype,

3235: end if;
3236: return;
3237: exception
3238: when others then
3239: Wf_Core.Context('Wf_Engine_Util', 'Execute_Post_NTF_Function', itemtype,
3240: itemkey, to_char(actid), funmode);
3241: raise;
3242: end Execute_Post_NTF_Function;
3243:

Line 3280: Wf_Engine.context_nid := ctx_nid;

3276:
3277: -- Set global context areas.
3278: -- This is context information for use by callback function while
3279: -- running.
3280: Wf_Engine.context_nid := ctx_nid;
3281: Wf_Engine.context_text := ctx_text;
3282:
3283: -- Bug 3065814
3284: -- Set all context information for the post-notification function

Line 3281: Wf_Engine.context_text := ctx_text;

3277: -- Set global context areas.
3278: -- This is context information for use by callback function while
3279: -- running.
3280: Wf_Engine.context_nid := ctx_nid;
3281: Wf_Engine.context_text := ctx_text;
3282:
3283: -- Bug 3065814
3284: -- Set all context information for the post-notification function
3285: wf_engine.context_user := wf_notification.g_context_user;

Line 3285: wf_engine.context_user := wf_notification.g_context_user;

3281: Wf_Engine.context_text := ctx_text;
3282:
3283: -- Bug 3065814
3284: -- Set all context information for the post-notification function
3285: wf_engine.context_user := wf_notification.g_context_user;
3286: wf_engine.context_user_comment := wf_notification.g_context_user_comment ;
3287: wf_engine.context_recipient_role := wf_notification.g_context_recipient_role ;
3288: wf_engine.context_original_recipient:= wf_notification.g_context_original_recipient;
3289: wf_engine.context_from_role := wf_notification.g_context_from_role ;

Line 3286: wf_engine.context_user_comment := wf_notification.g_context_user_comment ;

3282:
3283: -- Bug 3065814
3284: -- Set all context information for the post-notification function
3285: wf_engine.context_user := wf_notification.g_context_user;
3286: wf_engine.context_user_comment := wf_notification.g_context_user_comment ;
3287: wf_engine.context_recipient_role := wf_notification.g_context_recipient_role ;
3288: wf_engine.context_original_recipient:= wf_notification.g_context_original_recipient;
3289: wf_engine.context_from_role := wf_notification.g_context_from_role ;
3290: wf_engine.context_new_role := wf_notification.g_context_new_role ;

Line 3287: wf_engine.context_recipient_role := wf_notification.g_context_recipient_role ;

3283: -- Bug 3065814
3284: -- Set all context information for the post-notification function
3285: wf_engine.context_user := wf_notification.g_context_user;
3286: wf_engine.context_user_comment := wf_notification.g_context_user_comment ;
3287: wf_engine.context_recipient_role := wf_notification.g_context_recipient_role ;
3288: wf_engine.context_original_recipient:= wf_notification.g_context_original_recipient;
3289: wf_engine.context_from_role := wf_notification.g_context_from_role ;
3290: wf_engine.context_new_role := wf_notification.g_context_new_role ;
3291: wf_engine.context_more_info_role := wf_notification.g_context_more_info_role ;

Line 3288: wf_engine.context_original_recipient:= wf_notification.g_context_original_recipient;

3284: -- Set all context information for the post-notification function
3285: wf_engine.context_user := wf_notification.g_context_user;
3286: wf_engine.context_user_comment := wf_notification.g_context_user_comment ;
3287: wf_engine.context_recipient_role := wf_notification.g_context_recipient_role ;
3288: wf_engine.context_original_recipient:= wf_notification.g_context_original_recipient;
3289: wf_engine.context_from_role := wf_notification.g_context_from_role ;
3290: wf_engine.context_new_role := wf_notification.g_context_new_role ;
3291: wf_engine.context_more_info_role := wf_notification.g_context_more_info_role ;
3292: wf_engine.context_proxy := wf_notification.g_context_proxy;

Line 3289: wf_engine.context_from_role := wf_notification.g_context_from_role ;

3285: wf_engine.context_user := wf_notification.g_context_user;
3286: wf_engine.context_user_comment := wf_notification.g_context_user_comment ;
3287: wf_engine.context_recipient_role := wf_notification.g_context_recipient_role ;
3288: wf_engine.context_original_recipient:= wf_notification.g_context_original_recipient;
3289: wf_engine.context_from_role := wf_notification.g_context_from_role ;
3290: wf_engine.context_new_role := wf_notification.g_context_new_role ;
3291: wf_engine.context_more_info_role := wf_notification.g_context_more_info_role ;
3292: wf_engine.context_proxy := wf_notification.g_context_proxy;
3293:

Line 3290: wf_engine.context_new_role := wf_notification.g_context_new_role ;

3286: wf_engine.context_user_comment := wf_notification.g_context_user_comment ;
3287: wf_engine.context_recipient_role := wf_notification.g_context_recipient_role ;
3288: wf_engine.context_original_recipient:= wf_notification.g_context_original_recipient;
3289: wf_engine.context_from_role := wf_notification.g_context_from_role ;
3290: wf_engine.context_new_role := wf_notification.g_context_new_role ;
3291: wf_engine.context_more_info_role := wf_notification.g_context_more_info_role ;
3292: wf_engine.context_proxy := wf_notification.g_context_proxy;
3293:
3294: wf_engine.context_user_key := wf_engine.GetItemUserKey(itemtype, itemkey);

Line 3291: wf_engine.context_more_info_role := wf_notification.g_context_more_info_role ;

3287: wf_engine.context_recipient_role := wf_notification.g_context_recipient_role ;
3288: wf_engine.context_original_recipient:= wf_notification.g_context_original_recipient;
3289: wf_engine.context_from_role := wf_notification.g_context_from_role ;
3290: wf_engine.context_new_role := wf_notification.g_context_new_role ;
3291: wf_engine.context_more_info_role := wf_notification.g_context_more_info_role ;
3292: wf_engine.context_proxy := wf_notification.g_context_proxy;
3293:
3294: wf_engine.context_user_key := wf_engine.GetItemUserKey(itemtype, itemkey);
3295:

Line 3292: wf_engine.context_proxy := wf_notification.g_context_proxy;

3288: wf_engine.context_original_recipient:= wf_notification.g_context_original_recipient;
3289: wf_engine.context_from_role := wf_notification.g_context_from_role ;
3290: wf_engine.context_new_role := wf_notification.g_context_new_role ;
3291: wf_engine.context_more_info_role := wf_notification.g_context_more_info_role ;
3292: wf_engine.context_proxy := wf_notification.g_context_proxy;
3293:
3294: wf_engine.context_user_key := wf_engine.GetItemUserKey(itemtype, itemkey);
3295:
3296: -- Call function in requested mode

Line 3294: wf_engine.context_user_key := wf_engine.GetItemUserKey(itemtype, itemkey);

3290: wf_engine.context_new_role := wf_notification.g_context_new_role ;
3291: wf_engine.context_more_info_role := wf_notification.g_context_more_info_role ;
3292: wf_engine.context_proxy := wf_notification.g_context_proxy;
3293:
3294: wf_engine.context_user_key := wf_engine.GetItemUserKey(itemtype, itemkey);
3295:
3296: -- Call function in requested mode
3297: Wf_Engine_Util.Function_Call(funcname, itemtype, itemkey, actid,
3298: funcmode, result);

Line 3297: Wf_Engine_Util.Function_Call(funcname, itemtype, itemkey, actid,

3293:
3294: wf_engine.context_user_key := wf_engine.GetItemUserKey(itemtype, itemkey);
3295:
3296: -- Call function in requested mode
3297: Wf_Engine_Util.Function_Call(funcname, itemtype, itemkey, actid,
3298: funcmode, result);
3299:
3300: -- Error handling...
3301: -- 1. If function raises its own exception, let it trickle up.

Line 3305: if (substr(result, 1, length(wf_engine.eng_error)) =

3301: -- 1. If function raises its own exception, let it trickle up.
3302: -- 2. If function returned a result of 'ERROR:...', convert it
3303: -- to a generic exception and let that trickle up so that
3304: -- the originating function will fail.
3305: if (substr(result, 1, length(wf_engine.eng_error)) =
3306: wf_engine.eng_error) then
3307: errcode := substr(result, length(wf_engine.eng_error)+2, 2000);
3308: Wf_Core.Token('ERRCODE', errcode);
3309: Wf_Core.Raise('WFENG_NOTIFICATION_FUNCTION');

Line 3306: wf_engine.eng_error) then

3302: -- 2. If function returned a result of 'ERROR:...', convert it
3303: -- to a generic exception and let that trickle up so that
3304: -- the originating function will fail.
3305: if (substr(result, 1, length(wf_engine.eng_error)) =
3306: wf_engine.eng_error) then
3307: errcode := substr(result, length(wf_engine.eng_error)+2, 2000);
3308: Wf_Core.Token('ERRCODE', errcode);
3309: Wf_Core.Raise('WFENG_NOTIFICATION_FUNCTION');
3310: end if;

Line 3307: errcode := substr(result, length(wf_engine.eng_error)+2, 2000);

3303: -- to a generic exception and let that trickle up so that
3304: -- the originating function will fail.
3305: if (substr(result, 1, length(wf_engine.eng_error)) =
3306: wf_engine.eng_error) then
3307: errcode := substr(result, length(wf_engine.eng_error)+2, 2000);
3308: Wf_Core.Token('ERRCODE', errcode);
3309: Wf_Core.Raise('WFENG_NOTIFICATION_FUNCTION');
3310: end if;
3311:

Line 3313: Wf_Engine.context_nid := '';

3309: Wf_Core.Raise('WFENG_NOTIFICATION_FUNCTION');
3310: end if;
3311:
3312: -- Clear global context areas
3313: Wf_Engine.context_nid := '';
3314: Wf_Engine.context_text := '';
3315:
3316: --Bug 3065814
3317: wf_engine.context_user := '';

Line 3314: Wf_Engine.context_text := '';

3310: end if;
3311:
3312: -- Clear global context areas
3313: Wf_Engine.context_nid := '';
3314: Wf_Engine.context_text := '';
3315:
3316: --Bug 3065814
3317: wf_engine.context_user := '';
3318: wf_engine.context_user_comment := '';

Line 3317: wf_engine.context_user := '';

3313: Wf_Engine.context_nid := '';
3314: Wf_Engine.context_text := '';
3315:
3316: --Bug 3065814
3317: wf_engine.context_user := '';
3318: wf_engine.context_user_comment := '';
3319: wf_engine.context_recipient_role := '';
3320: wf_engine.context_original_recipient:='';
3321: wf_engine.context_from_role :='';

Line 3318: wf_engine.context_user_comment := '';

3314: Wf_Engine.context_text := '';
3315:
3316: --Bug 3065814
3317: wf_engine.context_user := '';
3318: wf_engine.context_user_comment := '';
3319: wf_engine.context_recipient_role := '';
3320: wf_engine.context_original_recipient:='';
3321: wf_engine.context_from_role :='';
3322: wf_engine.context_new_role :='';

Line 3319: wf_engine.context_recipient_role := '';

3315:
3316: --Bug 3065814
3317: wf_engine.context_user := '';
3318: wf_engine.context_user_comment := '';
3319: wf_engine.context_recipient_role := '';
3320: wf_engine.context_original_recipient:='';
3321: wf_engine.context_from_role :='';
3322: wf_engine.context_new_role :='';
3323: wf_engine.context_more_info_role := '';

Line 3320: wf_engine.context_original_recipient:='';

3316: --Bug 3065814
3317: wf_engine.context_user := '';
3318: wf_engine.context_user_comment := '';
3319: wf_engine.context_recipient_role := '';
3320: wf_engine.context_original_recipient:='';
3321: wf_engine.context_from_role :='';
3322: wf_engine.context_new_role :='';
3323: wf_engine.context_more_info_role := '';
3324: wf_engine.context_user_key := '';

Line 3321: wf_engine.context_from_role :='';

3317: wf_engine.context_user := '';
3318: wf_engine.context_user_comment := '';
3319: wf_engine.context_recipient_role := '';
3320: wf_engine.context_original_recipient:='';
3321: wf_engine.context_from_role :='';
3322: wf_engine.context_new_role :='';
3323: wf_engine.context_more_info_role := '';
3324: wf_engine.context_user_key := '';
3325: wf_engine.context_proxy := '';

Line 3322: wf_engine.context_new_role :='';

3318: wf_engine.context_user_comment := '';
3319: wf_engine.context_recipient_role := '';
3320: wf_engine.context_original_recipient:='';
3321: wf_engine.context_from_role :='';
3322: wf_engine.context_new_role :='';
3323: wf_engine.context_more_info_role := '';
3324: wf_engine.context_user_key := '';
3325: wf_engine.context_proxy := '';
3326:

Line 3323: wf_engine.context_more_info_role := '';

3319: wf_engine.context_recipient_role := '';
3320: wf_engine.context_original_recipient:='';
3321: wf_engine.context_from_role :='';
3322: wf_engine.context_new_role :='';
3323: wf_engine.context_more_info_role := '';
3324: wf_engine.context_user_key := '';
3325: wf_engine.context_proxy := '';
3326:
3327: exception

Line 3324: wf_engine.context_user_key := '';

3320: wf_engine.context_original_recipient:='';
3321: wf_engine.context_from_role :='';
3322: wf_engine.context_new_role :='';
3323: wf_engine.context_more_info_role := '';
3324: wf_engine.context_user_key := '';
3325: wf_engine.context_proxy := '';
3326:
3327: exception
3328: when others then

Line 3325: wf_engine.context_proxy := '';

3321: wf_engine.context_from_role :='';
3322: wf_engine.context_new_role :='';
3323: wf_engine.context_more_info_role := '';
3324: wf_engine.context_user_key := '';
3325: wf_engine.context_proxy := '';
3326:
3327: exception
3328: when others then
3329: -- Clear global context, just in case

Line 3330: Wf_Engine.context_nid := '';

3326:
3327: exception
3328: when others then
3329: -- Clear global context, just in case
3330: Wf_Engine.context_nid := '';
3331: Wf_Engine.context_text := '';
3332: -- Bug 3065814
3333: wf_engine.context_user := '';
3334: wf_engine.context_user_comment := '';

Line 3331: Wf_Engine.context_text := '';

3327: exception
3328: when others then
3329: -- Clear global context, just in case
3330: Wf_Engine.context_nid := '';
3331: Wf_Engine.context_text := '';
3332: -- Bug 3065814
3333: wf_engine.context_user := '';
3334: wf_engine.context_user_comment := '';
3335: wf_engine.context_recipient_role := '';

Line 3333: wf_engine.context_user := '';

3329: -- Clear global context, just in case
3330: Wf_Engine.context_nid := '';
3331: Wf_Engine.context_text := '';
3332: -- Bug 3065814
3333: wf_engine.context_user := '';
3334: wf_engine.context_user_comment := '';
3335: wf_engine.context_recipient_role := '';
3336: wf_engine.context_original_recipient:='';
3337: wf_engine.context_from_role :='';

Line 3334: wf_engine.context_user_comment := '';

3330: Wf_Engine.context_nid := '';
3331: Wf_Engine.context_text := '';
3332: -- Bug 3065814
3333: wf_engine.context_user := '';
3334: wf_engine.context_user_comment := '';
3335: wf_engine.context_recipient_role := '';
3336: wf_engine.context_original_recipient:='';
3337: wf_engine.context_from_role :='';
3338: wf_engine.context_new_role :='';

Line 3335: wf_engine.context_recipient_role := '';

3331: Wf_Engine.context_text := '';
3332: -- Bug 3065814
3333: wf_engine.context_user := '';
3334: wf_engine.context_user_comment := '';
3335: wf_engine.context_recipient_role := '';
3336: wf_engine.context_original_recipient:='';
3337: wf_engine.context_from_role :='';
3338: wf_engine.context_new_role :='';
3339: wf_engine.context_more_info_role := '';

Line 3336: wf_engine.context_original_recipient:='';

3332: -- Bug 3065814
3333: wf_engine.context_user := '';
3334: wf_engine.context_user_comment := '';
3335: wf_engine.context_recipient_role := '';
3336: wf_engine.context_original_recipient:='';
3337: wf_engine.context_from_role :='';
3338: wf_engine.context_new_role :='';
3339: wf_engine.context_more_info_role := '';
3340: wf_engine.context_user_key := '';

Line 3337: wf_engine.context_from_role :='';

3333: wf_engine.context_user := '';
3334: wf_engine.context_user_comment := '';
3335: wf_engine.context_recipient_role := '';
3336: wf_engine.context_original_recipient:='';
3337: wf_engine.context_from_role :='';
3338: wf_engine.context_new_role :='';
3339: wf_engine.context_more_info_role := '';
3340: wf_engine.context_user_key := '';
3341: wf_engine.context_proxy := '';

Line 3338: wf_engine.context_new_role :='';

3334: wf_engine.context_user_comment := '';
3335: wf_engine.context_recipient_role := '';
3336: wf_engine.context_original_recipient:='';
3337: wf_engine.context_from_role :='';
3338: wf_engine.context_new_role :='';
3339: wf_engine.context_more_info_role := '';
3340: wf_engine.context_user_key := '';
3341: wf_engine.context_proxy := '';
3342:

Line 3339: wf_engine.context_more_info_role := '';

3335: wf_engine.context_recipient_role := '';
3336: wf_engine.context_original_recipient:='';
3337: wf_engine.context_from_role :='';
3338: wf_engine.context_new_role :='';
3339: wf_engine.context_more_info_role := '';
3340: wf_engine.context_user_key := '';
3341: wf_engine.context_proxy := '';
3342:
3343: Wf_Core.Context('Wf_Engine_Util', 'Execute_Notification_Callback',

Line 3340: wf_engine.context_user_key := '';

3336: wf_engine.context_original_recipient:='';
3337: wf_engine.context_from_role :='';
3338: wf_engine.context_new_role :='';
3339: wf_engine.context_more_info_role := '';
3340: wf_engine.context_user_key := '';
3341: wf_engine.context_proxy := '';
3342:
3343: Wf_Core.Context('Wf_Engine_Util', 'Execute_Notification_Callback',
3344: funcmode, itemtype, itemkey, to_char(actid),

Line 3341: wf_engine.context_proxy := '';

3337: wf_engine.context_from_role :='';
3338: wf_engine.context_new_role :='';
3339: wf_engine.context_more_info_role := '';
3340: wf_engine.context_user_key := '';
3341: wf_engine.context_proxy := '';
3342:
3343: Wf_Core.Context('Wf_Engine_Util', 'Execute_Notification_Callback',
3344: funcmode, itemtype, itemkey, to_char(actid),
3345: to_char(ctx_nid)||':'||ctx_text);

Line 3343: Wf_Core.Context('Wf_Engine_Util', 'Execute_Notification_Callback',

3339: wf_engine.context_more_info_role := '';
3340: wf_engine.context_user_key := '';
3341: wf_engine.context_proxy := '';
3342:
3343: Wf_Core.Context('Wf_Engine_Util', 'Execute_Notification_Callback',
3344: funcmode, itemtype, itemkey, to_char(actid),
3345: to_char(ctx_nid)||':'||ctx_text);
3346: raise;
3347: end Execute_Notification_Callback;

Line 3472: if (funcmode <> wf_engine.eng_run) then

3468: l_fresh_parameterlist boolean;
3469:
3470: begin
3471: -- Do nothing in cancel or timeout mode
3472: if (funcmode <> wf_engine.eng_run) then
3473: result := wf_engine.eng_null;
3474: return;
3475: end if;
3476:

Line 3473: result := wf_engine.eng_null;

3469:
3470: begin
3471: -- Do nothing in cancel or timeout mode
3472: if (funcmode <> wf_engine.eng_run) then
3473: result := wf_engine.eng_null;
3474: return;
3475: end if;
3476:
3477: -- Get event name and direction

Line 3481: if (direction = wf_engine.eng_receive) then

3477: -- Get event name and direction
3478: Wf_Activity.Event_Info(itemtype, itemkey, actid, event_name,
3479: direction);
3480:
3481: if (direction = wf_engine.eng_receive) then
3482: -- RECEIVE event
3483: -- Block and wait for event to be received.
3484: result := wf_engine.eng_notified||':'||wf_engine.eng_null||
3485: ':'||wf_engine.eng_null;

Line 3484: result := wf_engine.eng_notified||':'||wf_engine.eng_null||

3480:
3481: if (direction = wf_engine.eng_receive) then
3482: -- RECEIVE event
3483: -- Block and wait for event to be received.
3484: result := wf_engine.eng_notified||':'||wf_engine.eng_null||
3485: ':'||wf_engine.eng_null;
3486: return;
3487:
3488: elsif (direction = wf_engine.eng_raise) then

Line 3485: ':'||wf_engine.eng_null;

3481: if (direction = wf_engine.eng_receive) then
3482: -- RECEIVE event
3483: -- Block and wait for event to be received.
3484: result := wf_engine.eng_notified||':'||wf_engine.eng_null||
3485: ':'||wf_engine.eng_null;
3486: return;
3487:
3488: elsif (direction = wf_engine.eng_raise) then
3489: -- RAISE event

Line 3488: elsif (direction = wf_engine.eng_raise) then

3484: result := wf_engine.eng_notified||':'||wf_engine.eng_null||
3485: ':'||wf_engine.eng_null;
3486: return;
3487:
3488: elsif (direction = wf_engine.eng_raise) then
3489: -- RAISE event
3490: -- Retrieve applicable attrs
3491: -- #EVENTNAME
3492: evtname := Wf_Engine.GetActivityAttrText(itemtype, itemkey, actid,

Line 3492: evtname := Wf_Engine.GetActivityAttrText(itemtype, itemkey, actid,

3488: elsif (direction = wf_engine.eng_raise) then
3489: -- RAISE event
3490: -- Retrieve applicable attrs
3491: -- #EVENTNAME
3492: evtname := Wf_Engine.GetActivityAttrText(itemtype, itemkey, actid,
3493: wf_engine.eng_eventname);
3494: if (evtname is null) then
3495: Wf_Core.Token('#EVENTNAME', '');
3496: Wf_Core.Raise('WFSQL_ARGS');

Line 3493: wf_engine.eng_eventname);

3489: -- RAISE event
3490: -- Retrieve applicable attrs
3491: -- #EVENTNAME
3492: evtname := Wf_Engine.GetActivityAttrText(itemtype, itemkey, actid,
3493: wf_engine.eng_eventname);
3494: if (evtname is null) then
3495: Wf_Core.Token('#EVENTNAME', '');
3496: Wf_Core.Raise('WFSQL_ARGS');
3497: end if;

Line 3499: evtkey := Wf_Engine.GetActivityAttrText(itemtype, itemkey, actid,

3495: Wf_Core.Token('#EVENTNAME', '');
3496: Wf_Core.Raise('WFSQL_ARGS');
3497: end if;
3498: -- #EVENTKEY
3499: evtkey := Wf_Engine.GetActivityAttrText(itemtype, itemkey, actid,
3500: wf_engine.eng_eventkey);
3501: if (evtkey is null) then
3502: Wf_Core.Token('#EVENTKEY', '');
3503: Wf_Core.Raise('WFSQL_ARGS');

Line 3500: wf_engine.eng_eventkey);

3496: Wf_Core.Raise('WFSQL_ARGS');
3497: end if;
3498: -- #EVENTKEY
3499: evtkey := Wf_Engine.GetActivityAttrText(itemtype, itemkey, actid,
3500: wf_engine.eng_eventkey);
3501: if (evtkey is null) then
3502: Wf_Core.Token('#EVENTKEY', '');
3503: Wf_Core.Raise('WFSQL_ARGS');
3504: end if;

Line 3507: msgdata := Wf_Engine.GetActivityAttrClob(itemtype, itemkey, actid,

3503: Wf_Core.Raise('WFSQL_ARGS');
3504: end if;
3505:
3506: -- #EVENTMESSAGE (may be null)
3507: msgdata := Wf_Engine.GetActivityAttrClob(itemtype, itemkey, actid,
3508: Wf_Engine.eng_eventmessage);
3509:
3510: --Bug #2761887
3511: --Now verify if we have the reserved activity attribute

Line 3508: Wf_Engine.eng_eventmessage);

3504: end if;
3505:
3506: -- #EVENTMESSAGE (may be null)
3507: msgdata := Wf_Engine.GetActivityAttrClob(itemtype, itemkey, actid,
3508: Wf_Engine.eng_eventmessage);
3509:
3510: --Bug #2761887
3511: --Now verify if we have the reserved activity attribute
3512: --#EVENTMESSAGE2 is set

Line 3514: evtmsg := Wf_Engine.getActivityAttrEvent(itemtype, itemkey,

3510: --Bug #2761887
3511: --Now verify if we have the reserved activity attribute
3512: --#EVENTMESSAGE2 is set
3513: begin
3514: evtmsg := Wf_Engine.getActivityAttrEvent(itemtype, itemkey,
3515: actid, wf_engine.eng_defaultevent);
3516:
3517: exception
3518: when others then

Line 3515: actid, wf_engine.eng_defaultevent);

3511: --Now verify if we have the reserved activity attribute
3512: --#EVENTMESSAGE2 is set
3513: begin
3514: evtmsg := Wf_Engine.getActivityAttrEvent(itemtype, itemkey,
3515: actid, wf_engine.eng_defaultevent);
3516:
3517: exception
3518: when others then
3519: --If this atrribute does not exist the exception is

Line 3556: wf_engine.GetItemAttrInfo(itemtype, attr.text_value, atype,

3552: -- not be the same name as the activity attribute.
3553:
3554: -- Get the activity attribute type
3555: if attr.value_type = 'ITEMATTR' then
3556: wf_engine.GetItemAttrInfo(itemtype, attr.text_value, atype,
3557: asubtype, aformat);
3558: else
3559: wf_engine.GetActivityAttrInfo(itemtype, itemkey, actid, attr.name,
3560: atype, asubtype, aformat);

Line 3559: wf_engine.GetActivityAttrInfo(itemtype, itemkey, actid, attr.name,

3555: if attr.value_type = 'ITEMATTR' then
3556: wf_engine.GetItemAttrInfo(itemtype, attr.text_value, atype,
3557: asubtype, aformat);
3558: else
3559: wf_engine.GetActivityAttrInfo(itemtype, itemkey, actid, attr.name,
3560: atype, asubtype, aformat);
3561: end if;
3562:
3563: -- NUMBER Value

Line 3565: avalue:= to_char(wf_engine.GetActivityAttrNumber(itemtype,itemkey,

3561: end if;
3562:
3563: -- NUMBER Value
3564: if (atype = 'NUMBER') then
3565: avalue:= to_char(wf_engine.GetActivityAttrNumber(itemtype,itemkey,
3566: actid, attr.name),wf_core.canonical_number_mask);
3567:
3568: -- DATE Value
3569: elsif (atype = 'DATE') then

Line 3570: avalue:=to_char(wf_engine.GetActivityAttrDate(itemtype,itemkey,

3566: actid, attr.name),wf_core.canonical_number_mask);
3567:
3568: -- DATE Value
3569: elsif (atype = 'DATE') then
3570: avalue:=to_char(wf_engine.GetActivityAttrDate(itemtype,itemkey,
3571: actid, attr.name),nvl(aformat,wf_core.canonical_date_mask));
3572:
3573: -- TEXT/LOOKUP/ROLE/ATTR etc Value
3574: else

Line 3575: avalue:=substr(wf_engine.GetActivityAttrText(itemtype,itemkey,

3571: actid, attr.name),nvl(aformat,wf_core.canonical_date_mask));
3572:
3573: -- TEXT/LOOKUP/ROLE/ATTR etc Value
3574: else
3575: avalue:=substr(wf_engine.GetActivityAttrText(itemtype,itemkey,
3576: actid, attr.name),1,2000);
3577: end if;
3578:
3579: --Set the Value into the Parameter List

Line 3607: elsif (direction = wf_engine.eng_send) then

3603: p_event_key => evtkey,
3604: p_event_data => msgdata,
3605: p_parameters => parameterlist);
3606:
3607: elsif (direction = wf_engine.eng_send) then
3608: -- SEND event
3609:
3610: -- Get base event struct to send
3611: -- #EVENTMESSAGE

Line 3612: evtmsg := Wf_Engine.GetActivityAttrEvent(itemtype, itemkey, actid,

3608: -- SEND event
3609:
3610: -- Get base event struct to send
3611: -- #EVENTMESSAGE
3612: evtmsg := Wf_Engine.GetActivityAttrEvent(itemtype, itemkey, actid,
3613: Wf_Engine.eng_eventmessage);
3614: if (evtmsg is null) then
3615: Wf_Core.Token('#EVENTMESSAGE', '');
3616: Wf_Core.Raise('WFSQL_ARGS');

Line 3613: Wf_Engine.eng_eventmessage);

3609:
3610: -- Get base event struct to send
3611: -- #EVENTMESSAGE
3612: evtmsg := Wf_Engine.GetActivityAttrEvent(itemtype, itemkey, actid,
3613: Wf_Engine.eng_eventmessage);
3614: if (evtmsg is null) then
3615: Wf_Core.Token('#EVENTMESSAGE', '');
3616: Wf_Core.Raise('WFSQL_ARGS');
3617: end if;

Line 3630: attr := Wf_Engine.GetActivityAttrText(itemtype, itemkey, actid,

3626: -- Other attributes are treated as over-rides to values in the
3627: -- event message struct retrieved above.
3628: -- Use them to reset values if present.
3629: -- #EVENTNAME
3630: attr := Wf_Engine.GetActivityAttrText(itemtype, itemkey, actid,
3631: wf_engine.eng_eventname);
3632: if (attr is not null) then
3633: evtmsg.SetEventName(attr);
3634: end if;

Line 3631: wf_engine.eng_eventname);

3627: -- event message struct retrieved above.
3628: -- Use them to reset values if present.
3629: -- #EVENTNAME
3630: attr := Wf_Engine.GetActivityAttrText(itemtype, itemkey, actid,
3631: wf_engine.eng_eventname);
3632: if (attr is not null) then
3633: evtmsg.SetEventName(attr);
3634: end if;
3635:

Line 3637: attr := Wf_Engine.GetActivityAttrText(itemtype, itemkey, actid,

3633: evtmsg.SetEventName(attr);
3634: end if;
3635:
3636: -- #EVENTKEY
3637: attr := Wf_Engine.GetActivityAttrText(itemtype, itemkey, actid,
3638: wf_engine.eng_eventkey);
3639: if (attr is not null) then
3640: evtmsg.SetEventKey(attr);
3641: end if;

Line 3638: wf_engine.eng_eventkey);

3634: end if;
3635:
3636: -- #EVENTKEY
3637: attr := Wf_Engine.GetActivityAttrText(itemtype, itemkey, actid,
3638: wf_engine.eng_eventkey);
3639: if (attr is not null) then
3640: evtmsg.SetEventKey(attr);
3641: end if;
3642:

Line 3644: attr := Wf_Engine.GetActivityAttrText(itemtype, itemkey, actid,

3640: evtmsg.SetEventKey(attr);
3641: end if;
3642:
3643: -- #EVENTOUTAGENT
3644: attr := Wf_Engine.GetActivityAttrText(itemtype, itemkey, actid,
3645: Wf_Engine.eng_eventoutagent);
3646: if (attr is not null) then
3647: -- Value must be in format @
3648: atsign := instr(attr, '@');

Line 3645: Wf_Engine.eng_eventoutagent);

3641: end if;
3642:
3643: -- #EVENTOUTAGENT
3644: attr := Wf_Engine.GetActivityAttrText(itemtype, itemkey, actid,
3645: Wf_Engine.eng_eventoutagent);
3646: if (attr is not null) then
3647: -- Value must be in format @
3648: atsign := instr(attr, '@');
3649: if (atsign is null) then

Line 3659: attr := Wf_Engine.GetActivityAttrText(itemtype, itemkey, actid,

3655: evtmsg.SetFromAgent(outagent);
3656: end if;
3657:
3658: -- #EVENTTOAGENT
3659: attr := Wf_Engine.GetActivityAttrText(itemtype, itemkey, actid,
3660: Wf_Engine.eng_eventtoagent);
3661: if (attr is not null) then
3662: -- Value must be in format @
3663: atsign := instr(attr, '@');

Line 3660: Wf_Engine.eng_eventtoagent);

3656: end if;
3657:
3658: -- #EVENTTOAGENT
3659: attr := Wf_Engine.GetActivityAttrText(itemtype, itemkey, actid,
3660: Wf_Engine.eng_eventtoagent);
3661: if (attr is not null) then
3662: -- Value must be in format @
3663: atsign := instr(attr, '@');
3664: if (atsign is null) then

Line 3675: priority := Wf_Engine.GetActivityAttrNumber(itemtype, itemkey, actid,

3671: end if;
3672:
3673: -- #PRIORITY
3674: begin
3675: priority := Wf_Engine.GetActivityAttrNumber(itemtype, itemkey, actid,
3676: wf_engine.eng_priority);
3677: if (priority is not null) then
3678: evtmsg.SetPriority(priority);
3679: end if;

Line 3676: wf_engine.eng_priority);

3672:
3673: -- #PRIORITY
3674: begin
3675: priority := Wf_Engine.GetActivityAttrNumber(itemtype, itemkey, actid,
3676: wf_engine.eng_priority);
3677: if (priority is not null) then
3678: evtmsg.SetPriority(priority);
3679: end if;
3680: exception

Line 3733: wf_engine.GetActivityAttrInfo(itemtype, itemkey, actid,

3729:
3730: for attr in curs_actattrs loop
3731: avalue :=null;
3732:
3733: wf_engine.GetActivityAttrInfo(itemtype, itemkey, actid,
3734: attr.name, atype, asubtype, aformat);
3735:
3736: if (atype = 'NUMBER') then
3737: avalue := to_char(wf_engine.GetActivityAttrNumber(

Line 3737: avalue := to_char(wf_engine.GetActivityAttrNumber(

3733: wf_engine.GetActivityAttrInfo(itemtype, itemkey, actid,
3734: attr.name, atype, asubtype, aformat);
3735:
3736: if (atype = 'NUMBER') then
3737: avalue := to_char(wf_engine.GetActivityAttrNumber(
3738: itemtype,itemkey,actid, attr.name),
3739: wf_core.canonical_number_mask);
3740:
3741: elsif (atype = 'DATE') then

Line 3742: avalue := to_char(wf_engine.GetActivityAttrDate(

3738: itemtype,itemkey,actid, attr.name),
3739: wf_core.canonical_number_mask);
3740:
3741: elsif (atype = 'DATE') then
3742: avalue := to_char(wf_engine.GetActivityAttrDate(
3743: itemtype,itemkey,actid, attr.name),
3744: nvl(aformat,wf_core.canonical_date_mask));
3745:
3746: else

Line 3747: avalue := substr(wf_engine.GetActivityAttrText(

3743: itemtype,itemkey,actid, attr.name),
3744: nvl(aformat,wf_core.canonical_date_mask));
3745:
3746: else
3747: avalue := substr(wf_engine.GetActivityAttrText(
3748: itemtype,itemkey,actid, attr.name),1,2000);
3749: end if;
3750:
3751: if (l_fresh_parameterlist) then

Line 3773: block_mode := wf_engine.GetActivityAttrText(itemtype, itemkey, actid,

3769: -- add activity id to event parameter list
3770: evtmsg.addParameterToList('ACTIVITY_ID',actid);
3771:
3772: -- get block mode and add to event parameterlist
3773: block_mode := wf_engine.GetActivityAttrText(itemtype, itemkey, actid,
3774: wf_engine.eng_block_mode, true);
3775: if (block_mode is not null) then
3776: evtmsg.addParameterToList(wf_engine.eng_block_mode, block_mode);
3777: end if;

Line 3774: wf_engine.eng_block_mode, true);

3770: evtmsg.addParameterToList('ACTIVITY_ID',actid);
3771:
3772: -- get block mode and add to event parameterlist
3773: block_mode := wf_engine.GetActivityAttrText(itemtype, itemkey, actid,
3774: wf_engine.eng_block_mode, true);
3775: if (block_mode is not null) then
3776: evtmsg.addParameterToList(wf_engine.eng_block_mode, block_mode);
3777: end if;
3778:

Line 3776: evtmsg.addParameterToList(wf_engine.eng_block_mode, block_mode);

3772: -- get block mode and add to event parameterlist
3773: block_mode := wf_engine.GetActivityAttrText(itemtype, itemkey, actid,
3774: wf_engine.eng_block_mode, true);
3775: if (block_mode is not null) then
3776: evtmsg.addParameterToList(wf_engine.eng_block_mode, block_mode);
3777: end if;
3778:
3779: -- get cb event name and add to event parameterlist
3780: cb_event_name := wf_engine.GetActivityAttrText(itemtype, itemkey, actid,

Line 3780: cb_event_name := wf_engine.GetActivityAttrText(itemtype, itemkey, actid,

3776: evtmsg.addParameterToList(wf_engine.eng_block_mode, block_mode);
3777: end if;
3778:
3779: -- get cb event name and add to event parameterlist
3780: cb_event_name := wf_engine.GetActivityAttrText(itemtype, itemkey, actid,
3781: wf_engine.eng_cb_event_name, true);
3782: if (cb_event_name is not null) then
3783: evtmsg.addParameterToList(wf_engine.eng_cb_event_name, cb_event_name);
3784: end if;

Line 3781: wf_engine.eng_cb_event_name, true);

3777: end if;
3778:
3779: -- get cb event name and add to event parameterlist
3780: cb_event_name := wf_engine.GetActivityAttrText(itemtype, itemkey, actid,
3781: wf_engine.eng_cb_event_name, true);
3782: if (cb_event_name is not null) then
3783: evtmsg.addParameterToList(wf_engine.eng_cb_event_name, cb_event_name);
3784: end if;
3785:

Line 3783: evtmsg.addParameterToList(wf_engine.eng_cb_event_name, cb_event_name);

3779: -- get cb event name and add to event parameterlist
3780: cb_event_name := wf_engine.GetActivityAttrText(itemtype, itemkey, actid,
3781: wf_engine.eng_cb_event_name, true);
3782: if (cb_event_name is not null) then
3783: evtmsg.addParameterToList(wf_engine.eng_cb_event_name, cb_event_name);
3784: end if;
3785:
3786: -- get cb event key and add to event parameterlist
3787: cb_event_key := wf_engine.GetActivityAttrText(itemtype, itemkey, actid,

Line 3787: cb_event_key := wf_engine.GetActivityAttrText(itemtype, itemkey, actid,

3783: evtmsg.addParameterToList(wf_engine.eng_cb_event_name, cb_event_name);
3784: end if;
3785:
3786: -- get cb event key and add to event parameterlist
3787: cb_event_key := wf_engine.GetActivityAttrText(itemtype, itemkey, actid,
3788: wf_engine.eng_cb_event_key, true);
3789: if (cb_event_key is not null) then
3790: evtmsg.addParameterToList(wf_engine.eng_cb_event_key, cb_event_key);
3791: end if;

Line 3788: wf_engine.eng_cb_event_key, true);

3784: end if;
3785:
3786: -- get cb event key and add to event parameterlist
3787: cb_event_key := wf_engine.GetActivityAttrText(itemtype, itemkey, actid,
3788: wf_engine.eng_cb_event_key, true);
3789: if (cb_event_key is not null) then
3790: evtmsg.addParameterToList(wf_engine.eng_cb_event_key, cb_event_key);
3791: end if;
3792: -- End 2294745

Line 3790: evtmsg.addParameterToList(wf_engine.eng_cb_event_key, cb_event_key);

3786: -- get cb event key and add to event parameterlist
3787: cb_event_key := wf_engine.GetActivityAttrText(itemtype, itemkey, actid,
3788: wf_engine.eng_cb_event_key, true);
3789: if (cb_event_key is not null) then
3790: evtmsg.addParameterToList(wf_engine.eng_cb_event_key, cb_event_key);
3791: end if;
3792: -- End 2294745
3793:
3794: -- Send event

Line 3803: WF_ENGINE.SetItemAttrText(itemtype, itemkey,

3799: end if;
3800:
3801: -- Checking for reserved attribute to store msgid.
3802: begin
3803: WF_ENGINE.SetItemAttrText(itemtype, itemkey,
3804: WF_ENGINE.GetActivityAttrText(itemtype, itemkey, actid,
3805: '#WF_EVT_MSGID'),
3806: rawtohex(WF_EVENT.g_msgID));
3807:

Line 3804: WF_ENGINE.GetActivityAttrText(itemtype, itemkey, actid,

3800:
3801: -- Checking for reserved attribute to store msgid.
3802: begin
3803: WF_ENGINE.SetItemAttrText(itemtype, itemkey,
3804: WF_ENGINE.GetActivityAttrText(itemtype, itemkey, actid,
3805: '#WF_EVT_MSGID'),
3806: rawtohex(WF_EVENT.g_msgID));
3807:
3808: exception

Line 3832: result := wf_engine.eng_notified||':'||wf_engine.eng_null||':'

3828:
3829: --If block mode is set to 'Y'then the activity status is
3830: --set to NOTIFIED.
3831: if (block_mode = 'Y') then
3832: result := wf_engine.eng_notified||':'||wf_engine.eng_null||':'
3833: ||wf_engine.eng_null;
3834: else
3835: -- when block_mode is null or is not 'Y'
3836: result := 'COMPLETE:#NULL';

Line 3833: ||wf_engine.eng_null;

3829: --If block mode is set to 'Y'then the activity status is
3830: --set to NOTIFIED.
3831: if (block_mode = 'Y') then
3832: result := wf_engine.eng_notified||':'||wf_engine.eng_null||':'
3833: ||wf_engine.eng_null;
3834: else
3835: -- when block_mode is null or is not 'Y'
3836: result := 'COMPLETE:#NULL';
3837: end if;

Line 3841: Wf_Core.Context('Wf_Engine_Util', 'Event_Activity', itemtype,

3837: end if;
3838:
3839: exception
3840: when others then
3841: Wf_Core.Context('Wf_Engine_Util', 'Event_Activity', itemtype,
3842: itemkey, to_char(actid), funcmode);
3843: raise;
3844: end Event_Activity;
3845:

Line 3846: end Wf_Engine_Util;

3842: itemkey, to_char(actid), funcmode);
3843: raise;
3844: end Event_Activity;
3845:
3846: end Wf_Engine_Util;