DBA Data[Home] [Help]

APPS.WF_ENGINE dependencies on WF_ITEM_ACTIVITY_STATUS

Line 3261: Wf_Item_Activity_Status.Status(itemtype, itemkey,

3257: -- itself has finished. In this case, do NOT actually complete
3258: -- the activity and continue processing. Exit silently and let
3259: -- execute_activity() pick up the execution when the activity
3260: -- owning this notification is actually completed.
3261: Wf_Item_Activity_Status.Status(itemtype, itemkey,
3262: actid, status);
3263: if (status = wf_engine.eng_active) then
3264: -- Do nothing!!!
3265: return;

Line 3300: Wf_Item_Activity_Status.Set_Error(itemtype,

3296: --The rollback will be done in the when others block
3297: Wf_Core.Context('Wf_Engine', 'CB', command, context, attr_name,
3298: attr_type, ':'||text_value||':'||to_char(number_value)||':'||
3299: to_char(date_value)||':');
3300: Wf_Item_Activity_Status.Set_Error(itemtype,
3301: itemkey, actid, wf_engine.eng_exception, FALSE);
3302: Wf_Engine_Util.Execute_Error_Process(itemtype,
3303: itemkey, actid, wf_engine.eng_exception);
3304: Wf_Core.Clear;

Line 3309: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,

3305: end;
3306: elsif (upper(command) = wf_engine.eng_error) then
3307:
3308: -- Set the error status
3309: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,
3310: wf_engine.eng_mail, FALSE);
3311: -- Run any error process for the activity
3312: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid,
3313: wf_engine.eng_mail);

Line 3347: Wf_Item_Activity_Status.Update_Notification(itemtype, itemkey, actid,

3343: if (command = 'TRANSFER') then
3344: Wf_Activity.Notification_Info(itemtype, itemkey, actid,
3345: message, msgtype, expand_role);
3346: if (expand_role = 'N') then
3347: Wf_Item_Activity_Status.Update_Notification(itemtype, itemkey, actid,
3348: number_value, text_value);
3349: end if;
3350: end if;
3351: else

Line 3485: from WF_ITEM_ACTIVITY_STATUSES S

3481: -- avoid "not in" which disables index in RBO
3482: cursor curs_itype is
3483: select
3484: S.ROWID ROW_ID
3485: from WF_ITEM_ACTIVITY_STATUSES S
3486: where S.DUE_DATE < SYSDATE
3487: and S.ACTIVITY_STATUS in ('ACTIVE','WAITING','NOTIFIED',
3488: 'SUSPEND','DEFERRED')
3489: and S.ITEM_TYPE = itemtype;

Line 3494: from WF_ITEM_ACTIVITY_STATUSES S

3490:
3491: cursor curs_noitype is
3492: select
3493: S.ROWID ROW_ID
3494: from WF_ITEM_ACTIVITY_STATUSES S
3495: where S.DUE_DATE < SYSDATE
3496: and S.ACTIVITY_STATUS in ('ACTIVE','WAITING','NOTIFIED',
3497: 'SUSPEND','DEFERRED');
3498:

Line 3533: from WF_ITEM_ACTIVITY_STATUSES S , WF_ITEMS WI

3529: begin
3530: select
3531: S.ITEM_TYPE, S.ITEM_KEY, S.PROCESS_ACTIVITY
3532: into l_itemtype, l_itemkey, l_actid
3533: from WF_ITEM_ACTIVITY_STATUSES S , WF_ITEMS WI
3534: where S.DUE_DATE < SYSDATE
3535: and S.ACTIVITY_STATUS in ('WAITING','NOTIFIED','SUSPEND',
3536: 'DEFERRED','ACTIVE')
3537: and S.ROWID = idarr(i)

Line 3561: Wf_Item_Activity_Status.Create_Status(l_itemtype, l_itemkey, l_actid,

3557: end;
3558:
3559: if (eligible) then
3560: -- Set the status to COMPLETE:#TIMEOUT.
3561: Wf_Item_Activity_Status.Create_Status(l_itemtype, l_itemkey, l_actid,
3562: wf_engine.eng_completed, wf_engine.eng_timedout);
3563:
3564: begin
3565: begin

Line 3609: Wf_Item_Activity_Status.Set_Error(l_itemtype, l_itemkey, l_actid,

3605: -- 3. execute the error process (if any)
3606: -- 4. clear the error to continue with next activity
3607: Wf_Core.Context('Wf_Engine', 'ProcessTimeout', l_itemkey, l_itemtype,
3608: to_char(l_actid));
3609: Wf_Item_Activity_Status.Set_Error(l_itemtype, l_itemkey, l_actid,
3610: wf_engine.eng_exception, FALSE);
3611: Wf_Engine_Util.Execute_Error_Process(l_itemtype, l_itemkey,
3612: l_actid, wf_engine.eng_exception);
3613: Wf_Core.Clear;

Line 3661: INDEX (WIASP WF_ITEM_ACTIVITY_STATUSES_N1) */

3657: -- cases to get better execution plans.
3658:
3659: cursor curs_itype is
3660: select /*+ ORDERED USE_NL (WIASP WI WPAP WAP)
3661: INDEX (WIASP WF_ITEM_ACTIVITY_STATUSES_N1) */
3662: WIASP.ROWID ROW_ID
3663: from WF_ITEM_ACTIVITY_STATUSES WIASP,
3664: WF_ITEMS WI,
3665: WF_PROCESS_ACTIVITIES WPAP,

Line 3663: from WF_ITEM_ACTIVITY_STATUSES WIASP,

3659: cursor curs_itype is
3660: select /*+ ORDERED USE_NL (WIASP WI WPAP WAP)
3661: INDEX (WIASP WF_ITEM_ACTIVITY_STATUSES_N1) */
3662: WIASP.ROWID ROW_ID
3663: from WF_ITEM_ACTIVITY_STATUSES WIASP,
3664: WF_ITEMS WI,
3665: WF_PROCESS_ACTIVITIES WPAP,
3666: WF_ACTIVITIES WAP
3667: where WIASP.ITEM_TYPE = itemtype

Line 3679: from WF_ITEM_ACTIVITY_STATUSES WIASC,

3675: and WAP.TYPE = wf_engine.eng_process
3676: and WIASP.ACTIVITY_STATUS = 'ACTIVE' --use literal to force index
3677: and not exists
3678: (select null
3679: from WF_ITEM_ACTIVITY_STATUSES WIASC,
3680: WF_PROCESS_ACTIVITIES WPAC
3681: where WAP.ITEM_TYPE = WPAC.PROCESS_ITEM_TYPE
3682: and WAP.NAME = WPAC.PROCESS_NAME
3683: and WAP.VERSION = WPAC.PROCESS_VERSION

Line 3692: INDEX (WIASP WF_ITEM_ACTIVITY_STATUSES_N1) */

3688: 'DEFERRED','ERROR'));
3689:
3690: cursor curs_noitype is
3691: select /*+ ORDERED USE_NL (WIASP WI WPAP WAP)
3692: INDEX (WIASP WF_ITEM_ACTIVITY_STATUSES_N1) */
3693: WIASP.ROWID ROW_ID
3694: from WF_ITEM_ACTIVITY_STATUSES WIASP,
3695: WF_ITEMS WI,
3696: WF_PROCESS_ACTIVITIES WPAP,

Line 3694: from WF_ITEM_ACTIVITY_STATUSES WIASP,

3690: cursor curs_noitype is
3691: select /*+ ORDERED USE_NL (WIASP WI WPAP WAP)
3692: INDEX (WIASP WF_ITEM_ACTIVITY_STATUSES_N1) */
3693: WIASP.ROWID ROW_ID
3694: from WF_ITEM_ACTIVITY_STATUSES WIASP,
3695: WF_ITEMS WI,
3696: WF_PROCESS_ACTIVITIES WPAP,
3697: WF_ACTIVITIES WAP
3698: where WIASP.PROCESS_ACTIVITY = WPAP.INSTANCE_ID

Line 3709: from WF_ITEM_ACTIVITY_STATUSES WIASC,

3705: and WAP.TYPE = 'PROCESS'
3706: and WIASP.ACTIVITY_STATUS = 'ACTIVE' --use literal to force index
3707: and not exists
3708: (select null
3709: from WF_ITEM_ACTIVITY_STATUSES WIASC,
3710: WF_PROCESS_ACTIVITIES WPAC
3711: where WAP.ITEM_TYPE = WPAC.PROCESS_ITEM_TYPE
3712: and WAP.NAME = WPAC.PROCESS_NAME
3713: and WAP.VERSION = WPAC.PROCESS_VERSION

Line 3758: from WF_ITEM_ACTIVITY_STATUSES WIASP,

3754: begin
3755: select
3756: WIASP.ITEM_TYPE, WIASP.ITEM_KEY, WIASP.PROCESS_ACTIVITY
3757: into l_itemtype, l_itemkey, l_actid
3758: from WF_ITEM_ACTIVITY_STATUSES WIASP,
3759: WF_PROCESS_ACTIVITIES WPAP,
3760: WF_ACTIVITIES WAP,
3761: WF_ITEMS WI
3762: where WIASP.PROCESS_ACTIVITY = WPAP.INSTANCE_ID

Line 3773: from WF_ITEM_ACTIVITY_STATUSES WIASC,

3769: and WAP.TYPE = wf_engine.eng_process
3770: and WIASP.ACTIVITY_STATUS = 'ACTIVE' --use literal to force index
3771: and not exists
3772: (select null
3773: from WF_ITEM_ACTIVITY_STATUSES WIASC,
3774: WF_PROCESS_ACTIVITIES WPAC
3775: where WAP.ITEM_TYPE = WPAC.PROCESS_ITEM_TYPE
3776: and WAP.NAME = WPAC.PROCESS_NAME
3777: and WAP.VERSION = WPAC.PROCESS_VERSION

Line 3796: Wf_Item_Activity_Status.Create_Status(l_itemtype, l_itemkey, l_actid,

3792: end;
3793:
3794: if (eligible) then
3795: -- Set the status to ERROR:#STUCK
3796: Wf_Item_Activity_Status.Create_Status(l_itemtype, l_itemkey, l_actid,
3797: wf_engine.eng_error, wf_engine.eng_stuck);
3798:
3799: -- Execute the error process for stuck process
3800: begin

Line 3829: Wf_Item_Activity_Status.Set_Error(l_itemtype, l_itemkey, l_actid,

3825: -- 3. execute the error process (if any)
3826: -- 4. clear the error to continue with next activity
3827: Wf_Core.Context('Wf_Engine', 'ProcessStuckProcess', l_itemkey,
3828: l_itemtype, to_char(l_actid));
3829: Wf_Item_Activity_Status.Set_Error(l_itemtype, l_itemkey, l_actid,
3830: wf_engine.eng_exception, FALSE);
3831: Wf_Engine_Util.Execute_Error_Process(l_itemtype, l_itemkey,
3832: l_actid, wf_engine.eng_exception);
3833: Wf_Core.Clear;

Line 4107: Wf_Item_Activity_Status.Status(itemtype, itemkey, rootid, status);

4103: begin
4104: Wf_Item.Root_Process(itemtype, itemkey, root, version);
4105: rootid := Wf_Process_Activity.RootInstanceId(itemtype,
4106: itemkey, root);
4107: Wf_Item_Activity_Status.Status(itemtype, itemkey, rootid, status);
4108: exception
4109: when others then
4110: status := 'x'; -- Treat errors like incomplete process
4111: end;

Line 4308: from WF_ITEM_ACTIVITY_STATUSES

4304:
4305: -- Cursor to select deferred activities to remove from background queue
4306: cursor defact is
4307: select PROCESS_ACTIVITY, BEGIN_DATE
4308: from WF_ITEM_ACTIVITY_STATUSES
4309: where ITEM_TYPE = itemtype
4310: and ITEM_KEY = itemkey
4311: and ACTIVITY_STATUS = wf_engine.eng_deferred;
4312:

Line 4380: Wf_Item_Activity_Status.ClearCache;

4376: -- Always clear the cache first
4377: -- AbortProcess, SuspendProcess and ResumeProcess should be rarely called
4378: -- from the background engine, so it should be safe to force reading from
4379: -- the database.
4380: Wf_Item_Activity_Status.ClearCache;
4381:
4382: -- Check if the process is active
4383: Wf_Item_Activity_Status.Status(itemtype, itemkey, procid, status);
4384:

Line 4383: Wf_Item_Activity_Status.Status(itemtype, itemkey, procid, status);

4379: -- the database.
4380: Wf_Item_Activity_Status.ClearCache;
4381:
4382: -- Check if the process is active
4383: Wf_Item_Activity_Status.Status(itemtype, itemkey, procid, status);
4384:
4385: if (status is null) then
4386: -- This process has not been run yet. Create a pre-suspended
4387: -- status row so engine does not run process later

Line 4388: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, procid,

4384:
4385: if (status is null) then
4386: -- This process has not been run yet. Create a pre-suspended
4387: -- status row so engine does not run process later
4388: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, procid,
4389: wf_engine.eng_suspended, wf_engine.eng_null, null, null,
4390: newStatus=>TRUE);
4391: elsif (status = wf_engine.eng_deferred) then
4392: -- Change status from 'deferred' to 'suspended'

Line 4394: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, procid,

4390: newStatus=>TRUE);
4391: elsif (status = wf_engine.eng_deferred) then
4392: -- Change status from 'deferred' to 'suspended'
4393: -- Doing this prevents the background processor from picking it up.
4394: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, procid,
4395: wf_engine.eng_suspended, null,
4396: null, null);
4397: elsif (status = wf_engine.eng_active) then
4398: -- Mark process as 'suspended', 'null' in WIAS table

Line 4400: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, procid,

4396: null, null);
4397: elsif (status = wf_engine.eng_active) then
4398: -- Mark process as 'suspended', 'null' in WIAS table
4399: -- Doing this stops the engine from going through the rest of the flow
4400: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, procid,
4401: wf_engine.eng_suspended, null,
4402: null, null);
4403:
4404: -- Suspend all the children processes

Line 4460: FROM wf_notifications wn, WF_ITEM_ACTIVITY_STATUSES ias

4456:
4457: l_lock boolean;
4458: cursor openNotifications is -- <7513983>
4459: SELECT wn.notification_id
4460: FROM wf_notifications wn, WF_ITEM_ACTIVITY_STATUSES ias
4461: WHERE ias.item_type = itemtype
4462: AND ias.item_key = itemkey
4463: AND ias.notification_id is not null
4464: AND ias.notification_id = wn.group_id

Line 4468: FROM wf_notifications wn, WF_ITEM_ACTIVITY_STATUSES_H iash

4464: AND ias.notification_id = wn.group_id
4465: AND wn.status = 'OPEN'
4466: UNION
4467: SELECT wn.notification_id
4468: FROM wf_notifications wn, WF_ITEM_ACTIVITY_STATUSES_H iash
4469: WHERE iash.item_type = itemtype
4470: AND iash.item_key = itemkey
4471: AND iash.notification_id is not null
4472: AND iash.notification_id = wn.notification_id

Line 4543: Wf_Item_Activity_Status.ClearCache;

4539: end if;
4540: end if;
4541:
4542: -- Always clear the cache first
4543: Wf_Item_Activity_Status.ClearCache;
4544:
4545: -- Check the process is not already complete
4546: Wf_Item_Activity_Status.Status(itemtype, itemkey, procid, status);
4547:

Line 4546: Wf_Item_Activity_Status.Status(itemtype, itemkey, procid, status);

4542: -- Always clear the cache first
4543: Wf_Item_Activity_Status.ClearCache;
4544:
4545: -- Check the process is not already complete
4546: Wf_Item_Activity_Status.Status(itemtype, itemkey, procid, status);
4547:
4548: if (status is null) then
4549: if (WF_ITEM.SetEndDate(itemtype, itemkey) = 1) then
4550: Wf_Core.Token('TYPE', itemtype);

Line 4564: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, procid,

4560: Wf_Core.Raise('WFENG_ITEM_PROCESS_ACTIVE');
4561: else
4562: -- Mark process as 'COMPLETE', 'result' in WIAS table
4563: -- Doing this stops the engine from going through the rest of the flow
4564: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, procid,
4565: wf_engine.eng_completed, result,
4566: null, SYSDATE);
4567:
4568: -- Kill child activities recursively

Line 4634: from WF_ITEM_ACTIVITY_STATUSES

4630: -- Cursor to select deferred activities to restart.
4631: cursor defact is
4632: select
4633: PROCESS_ACTIVITY, BEGIN_DATE
4634: from WF_ITEM_ACTIVITY_STATUSES
4635: where ITEM_TYPE = itemtype
4636: and ITEM_KEY = itemkey
4637: and ACTIVITY_STATUS = wf_engine.eng_deferred;
4638:

Line 4715: Wf_Item_Activity_Status.ClearCache;

4711: end if;
4712: end if;
4713:
4714: -- Always clear the cache first
4715: Wf_Item_Activity_Status.ClearCache;
4716:
4717: -- Check if the process is suspended
4718: Wf_Item_Activity_Status.Status(itemtype, itemkey, procid, status);
4719: if (status is null) then

Line 4718: Wf_Item_Activity_Status.Status(itemtype, itemkey, procid, status);

4714: -- Always clear the cache first
4715: Wf_Item_Activity_Status.ClearCache;
4716:
4717: -- Check if the process is suspended
4718: Wf_Item_Activity_Status.Status(itemtype, itemkey, procid, status);
4719: if (status is null) then
4720: Wf_Core.Token('TYPE', itemtype);
4721: Wf_Core.Token('KEY', itemkey);
4722: Wf_Core.Token('NAME', proc);

Line 4732: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, procid,

4728: Wf_Core.Raise('WFENG_ITEM_PROCESS_SUSPENDED');
4729: else
4730: -- If we came here, that means the process is currently suspended.
4731: -- Mark process as eng_active 'active', 'null' in WIAS table
4732: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, procid,
4733: wf_engine.eng_active, null, null, null);
4734:
4735: -- Mark any sub-processes as active again
4736: Wf_Engine_Util.Resume_Child_Processes(itemtype, itemkey, procid);

Line 4766: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actidarr(i),

4762: --of the activity or to sysdate if begin_date is null
4763: --Also set the status to active only if begin_date <= sysdate
4764:
4765: if (nvl(act_begin_date(i),sysdate) <= sysdate) then
4766: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actidarr(i),
4767: wf_engine.eng_active, null, sysdate, null);
4768: begin
4769: savepoint wf_savepoint;
4770: Wf_Engine_Util.Process_Activity(itemtype, itemkey, actidarr(i),

Line 4776: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey,

4772: exception
4773: when trig_savepoint or dist_savepoint then
4774: -- Can't restart process here, re-defer for the
4775: -- background process to pick up.
4776: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey,
4777: actidarr(i),wf_engine.eng_deferred, null, sysdate, null);
4778: when others then
4779: -- If anything in this process raises an exception:
4780: -- 1. rollback any work in this process thread

Line 4787: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actidarr(i),

4783: -- 4. clear the error to continue with next activity
4784: rollback to wf_savepoint;
4785: Wf_Core.Context('Wf_Engine', 'ResumeProcess', itemtype, itemkey,
4786: process);
4787: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actidarr(i),
4788: wf_engine.eng_exception, FALSE);
4789: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actidarr(i),
4790: wf_engine.eng_exception);
4791:

Line 4888: FROM wf_item_activity_statuses wias

4884: p_process in varchar2) is
4885:
4886: cursor suspended_items(p_itemType in varchar2) is
4887: SELECT distinct wias.item_key
4888: FROM wf_item_activity_statuses wias
4889: WHERE wias.item_type = p_itemType
4890: AND wias.activity_status = wf_engine.eng_suspended;
4891:
4892: cursor all_suspended_items is

Line 4894: FROM wf_item_activity_statuses wias

4890: AND wias.activity_status = wf_engine.eng_suspended;
4891:
4892: cursor all_suspended_items is
4893: SELECT distinct wias.item_type, wias.item_key
4894: FROM wf_item_activity_statuses wias
4895: WHERE wias.activity_status = wf_engine.eng_suspended;
4896:
4897: begin
4898:

Line 5186: from wf_item_activity_statuses

5182: ASSIGNED_USER, NOTIFICATION_ID,
5183: BEGIN_DATE, END_DATE, EXECUTION_TIME,
5184: ERROR_NAME, ERROR_MESSAGE, ERROR_STACK,
5185: OUTBOUND_QUEUE_ID, DUE_DATE
5186: from wf_item_activity_statuses
5187: where item_type = itemtype
5188: and item_key = copy_itemkey;
5189:
5190: cursor all_activities_hist is

Line 5197: from wf_item_activity_statuses_h

5193: ASSIGNED_USER, NOTIFICATION_ID,
5194: BEGIN_DATE, END_DATE, EXECUTION_TIME,
5195: ERROR_NAME, ERROR_MESSAGE, ERROR_STACK,
5196: OUTBOUND_QUEUE_ID, DUE_DATE
5197: from wf_item_activity_statuses_h
5198: where item_type = itemtype
5199: and item_key = copy_itemkey;
5200:
5201:

Line 5210: from wf_item_activity_statuses

5206: ASSIGNED_USER, NOTIFICATION_ID,
5207: BEGIN_DATE, END_DATE, EXECUTION_TIME,
5208: ERROR_NAME, ERROR_MESSAGE, ERROR_STACK,
5209: OUTBOUND_QUEUE_ID, DUE_DATE
5210: from wf_item_activity_statuses
5211: where item_type = itemtype
5212: and item_key = copy_itemkey
5213: and notification_id is not null
5214: and activity_status = 'NOTIFIED'

Line 5389: insert into wf_item_activity_statuses

5385:
5386: end if;
5387:
5388: -- now insert the status
5389: insert into wf_item_activity_statuses
5390: (ITEM_TYPE, ITEM_KEY, PROCESS_ACTIVITY,
5391: ACTIVITY_STATUS, ACTIVITY_RESULT_CODE,
5392: ASSIGNED_USER, NOTIFICATION_ID,
5393: BEGIN_DATE, END_DATE, EXECUTION_TIME,

Line 5416: insert into wf_item_activity_statuses_h

5412: hist.item_key, itemkey, nid);
5413: end if;
5414:
5415: -- now insert the status
5416: insert into wf_item_activity_statuses_h
5417: (ITEM_TYPE, ITEM_KEY, PROCESS_ACTIVITY,
5418: ACTIVITY_STATUS, ACTIVITY_RESULT_CODE,
5419: ASSIGNED_USER, NOTIFICATION_ID,
5420: BEGIN_DATE, END_DATE, EXECUTION_TIME,

Line 5434: update wf_item_activity_statuses ias

5430: end loop;
5431:
5432: -- update any active functions to notified state
5433: begin
5434: update wf_item_activity_statuses ias
5435: set activity_status = wf_engine.eng_notified
5436: where item_type = itemtype
5437: and item_key = itemkey
5438: and activity_status = 'ACTIVE'

Line 5651: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actid,

5647: actid := Wf_Process_Activity.StartInstanceId(itemtype, root, version,
5648: activity);
5649:
5650: -- Create a status row for new activity
5651: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actid,
5652: wf_engine.eng_active, wf_engine.eng_null, sysdate, null, newStatus=>TRUE);
5653: else
5654:
5655: --Bug 2607770

Line 5683: Wf_Item_Activity_Status.Notification_Status(itemtype, itemkey, actid,

5679: l_lock := wf_item.acquire_lock(itemtype,itemkey,true);
5680: end if;
5681:
5682: -- Get notification id
5683: Wf_Item_Activity_Status.Notification_Status(itemtype, itemkey, actid,
5684: notid, user);
5685:
5686: -- Close any open notifications associated with this activity.
5687: -- Note: if notifications are not closed here, they will be cancelled

Line 5734: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,

5730: raise;
5731: else
5732: Wf_Core.Context('Wf_Engine', 'CompleteActivity', itemtype, itemkey,
5733: activity, result);
5734: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,
5735: wf_engine.eng_exception, FALSE);
5736: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid,
5737: wf_engine.eng_exception);
5738: Wf_Core.Clear;

Line 5816: from WF_ITEM_ACTIVITY_STATUSES WIAS, WF_PROCESS_ACTIVITIES WPA

5812: -- Look up activity instance label
5813: begin
5814: select WPA.PROCESS_NAME, WPA.INSTANCE_LABEL
5815: into process, label
5816: from WF_ITEM_ACTIVITY_STATUSES WIAS, WF_PROCESS_ACTIVITIES WPA
5817: where WIAS.ITEM_TYPE = itemtype
5818: and WIAS.ITEM_KEY = itemkey
5819: and WIAS.ACTIVITY_STATUS = wf_engine.eng_notified
5820: and WIAS.PROCESS_ACTIVITY = WPA.INSTANCE_ID

Line 5929: Wf_Item_Activity_Status.Status(itemtype, itemkey, actid, status);

5925: Wf_Core.Raise('WFENG_NOTIFICATION_NAME');
5926: end if;
5927:
5928: -- Check if the activity is active
5929: Wf_Item_Activity_Status.Status(itemtype, itemkey, actid, status);
5930:
5931: if (status is null) then
5932: -- Insert one row with the performer
5933: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actid,

Line 5933: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actid,

5929: Wf_Item_Activity_Status.Status(itemtype, itemkey, actid, status);
5930:
5931: if (status is null) then
5932: -- Insert one row with the performer
5933: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actid,
5934: wf_engine.eng_waiting, '', null, null, newStatus=>TRUE);
5935: Wf_Item_Activity_Status.Update_Notification(itemtype, itemkey, actid,
5936: '', performer);
5937: elsif (status = wf_engine.eng_waiting) then

Line 5935: Wf_Item_Activity_Status.Update_Notification(itemtype, itemkey, actid,

5931: if (status is null) then
5932: -- Insert one row with the performer
5933: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actid,
5934: wf_engine.eng_waiting, '', null, null, newStatus=>TRUE);
5935: Wf_Item_Activity_Status.Update_Notification(itemtype, itemkey, actid,
5936: '', performer);
5937: elsif (status = wf_engine.eng_waiting) then
5938: Wf_Item_Activity_Status.Update_Notification(itemtype, itemkey, actid,
5939: '', performer);

Line 5938: Wf_Item_Activity_Status.Update_Notification(itemtype, itemkey, actid,

5934: wf_engine.eng_waiting, '', null, null, newStatus=>TRUE);
5935: Wf_Item_Activity_Status.Update_Notification(itemtype, itemkey, actid,
5936: '', performer);
5937: elsif (status = wf_engine.eng_waiting) then
5938: Wf_Item_Activity_Status.Update_Notification(itemtype, itemkey, actid,
5939: '', performer);
5940: elsif (status in (wf_engine.eng_notified, wf_engine.eng_error)) then
5941: -- Check this is not a voting activity.
5942: -- Voting activities cannot be re-assigned.

Line 5951: Wf_Item_Activity_Status.Notification_Status(itemtype, itemkey, actid,

5947: Wf_Core.Raise('WFENG_VOTE_REASSIGN');
5948: end if;
5949:
5950: -- Get notification id
5951: Wf_Item_Activity_Status.Notification_Status(itemtype, itemkey, actid,
5952: notid, user);
5953: -- Update the assigned user column in WIAS
5954: Wf_Item_Activity_Status.Update_Notification(itemtype, itemkey, actid,
5955: notid, performer);

Line 5954: Wf_Item_Activity_Status.Update_Notification(itemtype, itemkey, actid,

5950: -- Get notification id
5951: Wf_Item_Activity_Status.Notification_Status(itemtype, itemkey, actid,
5952: notid, user);
5953: -- Update the assigned user column in WIAS
5954: Wf_Item_Activity_Status.Update_Notification(itemtype, itemkey, actid,
5955: notid, performer);
5956:
5957: if (notid is not null) then
5958: -- 16-DEC-03 shanjgik bug fix 2722369 check for reassignType added

Line 6089: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,

6085: -- 4. clear the error to continue with next activity
6086: rollback to wf_savepoint;
6087: Wf_Core.Context('Wf_Engine', 'HandleErrorInternal', itemtype, itemkey,
6088: activity, command, result);
6089: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,
6090: wf_engine.eng_exception, FALSE);
6091: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid,
6092: wf_engine.eng_exception);
6093: Wf_Core.Clear;

Line 6114: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey,

6110: when trig_savepoint or dist_savepoint then
6111: -- You must be in a restricted environment,
6112: -- no fancy error processing for you!
6113: -- Immediately defer activity to background engine.
6114: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey,
6115: actid, wf_engine.eng_deferred, wf_engine.eng_null,
6116: SYSDATE, null);
6117: when others then
6118: -- If anything in this process raises an exception:

Line 6126: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,

6122: -- 4. clear the error to continue with next activity
6123: rollback to wf_savepoint;
6124: Wf_Core.Context('Wf_Engine', 'HandleErrorInternal',itemtype,itemkey,
6125: activity, command, result);
6126: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,
6127: wf_engine.eng_exception, FALSE);
6128: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid,
6129: wf_engine.eng_exception);
6130: Wf_Core.Clear;

Line 6137: Wf_Item_Activity_Status.Audit(itemtype, itemkey, actid, upper(command), null);

6133: event_name := 'oracle.apps.wf.engine.retry';
6134: end if;
6135:
6136: -- Store the info for Audit (Bug 5903106 - moved from HandleError to here)
6137: Wf_Item_Activity_Status.Audit(itemtype, itemkey, actid, upper(command), null);
6138:
6139: --Pass the signature of the handle error API in the
6140: --parameter list
6141: wf_event.AddParameterToList('ITMETYPE', itemtype, l_parameterlist);

Line 6290: from WF_ITEM_ACTIVITY_STATUSES ias,

6286: cursor actc(x_itemtype varchar2, x_itemkey varchar2, x_activity varchar2) is
6287: select ias.ITEM_KEY,
6288: pa.INSTANCE_LABEL activity,
6289: pa.INSTANCE_ID actid
6290: from WF_ITEM_ACTIVITY_STATUSES ias,
6291: WF_PROCESS_ACTIVITIES pa
6292: where ias.ITEM_TYPE = x_itemtype
6293: and (x_itemkey is null or ias.ITEM_KEY = x_itemkey)
6294: and (x_activity is null or pa.INSTANCE_LABEL = x_activity)

Line 6396: -- This is a public cover for WF_ITEM_ACTIVITY_STATUS.ROOT_STATUS

6392: end HandleErrorAll;
6393:
6394: --
6395: -- ItemStatus (Public)
6396: -- This is a public cover for WF_ITEM_ACTIVITY_STATUS.ROOT_STATUS
6397: -- Returns the status and result for the root process of this item.
6398: -- If the item does not exist an exception will be raised.
6399: -- IN
6400: -- itemtype - Activity item type.

Line 6419: wf_item_activity_status.root_status(itemtype,itemkey,status,result);

6415: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
6416: Wf_Core.Raise('WFSQL_ARGS');
6417: end if;
6418:
6419: wf_item_activity_status.root_status(itemtype,itemkey,status,result);
6420: exception
6421: when others then
6422: Wf_Core.Context('Wf_Engine', 'ItemStatus', itemtype, itemkey);
6423: raise;

Line 6464: from wf_item_activity_statuses ias,

6460: ias.assigned_user,
6461: ias.notification_id NID,
6462: ntf.status,
6463: ias.performed_by
6464: from wf_item_activity_statuses ias,
6465: wf_process_activities pa,
6466: wf_activities ac,
6467: wf_activities ap,
6468: wf_items i,

Line 6510: from wf_item_activity_statuses

6506: (
6507: select process_activity,
6508: activity_status,
6509: activity_result_code
6510: from wf_item_activity_statuses
6511: where item_type = itemtype
6512: and item_key = itemkey
6513: and activity_status <> wf_engine.eng_completed
6514: order by decode(activity_status, 'ERROR',1, 'NOTIFIED',2, 'DEFERRED',3,

Line 6523: wf_item_activity_status.Error_Info(itemtype,itemkey,l_instance_id,errname,errmsg,errstack);

6519:
6520: --Now lets start getting all details out of the last activity
6521: if l_status = 'ERROR' then
6522: --Populate the error stack
6523: wf_item_activity_status.Error_Info(itemtype,itemkey,l_instance_id,errname,errmsg,errstack);
6524: end if;
6525:
6526: status := l_status;
6527: result := l_result;

Line 6734: FROM WF_ITEM_ACTIVITY_STATUSES WIAS, WF_PROCESS_ACTIVITIES WPA,

6730:
6731: -- Blocked activities waiting for event (if existing process)
6732: cursor evtacts is
6733: SELECT WIAS.PROCESS_ACTIVITY actid
6734: FROM WF_ITEM_ACTIVITY_STATUSES WIAS, WF_PROCESS_ACTIVITIES WPA,
6735: WF_ACTIVITIES WA
6736: WHERE WIAS.ITEM_TYPE = event.itemtype
6737: AND WIAS.ITEM_KEY = event.itemkey
6738: AND WIAS.ACTIVITY_STATUS = 'NOTIFIED'

Line 6829: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, act.actid,

6825: --Select the activities waiting to receive this event
6826: actdate := WF_Item.Active_Date(itemtype, itemkey);
6827: for act in evtacts loop
6828: actarr(i) := act.actid;
6829: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, act.actid,
6830: wf_engine.eng_notified, wf_engine.eng_null, sysdate, null);
6831: i := i + 1;
6832: end loop;
6833: actarr(i) := '';

Line 6936: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actarr(i),

6932: -- 4. clear the error to continue with next activity
6933: rollback to wf_savepoint;
6934: Wf_Core.Context('Wf_Engine', 'Event', itemtype, itemkey,
6935: process_name, event_name);
6936: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actarr(i),
6937: wf_engine.eng_exception, FALSE);
6938: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actarr(i),
6939: wf_engine.eng_exception);
6940: Wf_Core.Clear;

Line 6974: FROM WF_ITEM_ACTIVITY_STATUSES WIAS,

6970:
6971: -- Blocked activities waiting for event (if existing process)
6972: cursor evtacts is
6973: SELECT /*+ LEADING(WA) */ WIAS.ITEM_TYPE, WIAS.ITEM_KEY, WIAS.PROCESS_ACTIVITY ACTID
6974: FROM WF_ITEM_ACTIVITY_STATUSES WIAS,
6975: WF_PROCESS_ACTIVITIES WPA,
6976: (
6977: SELECT /*+ NO_MERGE */ WA.*
6978: FROM WF_ACTIVITIES WA

Line 7138: Wf_Item_Activity_Status.Set_Error(evtacts_rec.item_type,

7134: -- 4. clear the error to continue with next activity
7135: rollback to wf_savepoint;
7136: Wf_Core.Context('Wf_Engine', 'Event2', evtacts_rec.item_type,
7137: evtacts_rec.item_key, event_name);
7138: Wf_Item_Activity_Status.Set_Error(evtacts_rec.item_type,
7139: evtacts_rec.item_key,
7140: evtacts_rec.actid,
7141: wf_engine.eng_exception, FALSE);
7142: Wf_Engine_Util.Execute_Error_Process(evtacts_rec.item_type,

Line 7307: FROM wf_item_activity_statuses wias,

7303: IS
7304: SELECT wias.item_key,
7305: wpa.process_name,
7306: wpa.instance_label activity
7307: FROM wf_item_activity_statuses wias,
7308: wf_process_activities wpa
7309: WHERE wias.item_type = x_item_type
7310: AND (x_item_key IS NULL OR wias.item_key = x_item_key)
7311: AND (x_process IS NULL OR wpa.process_name = x_process)

Line 7319: FROM wf_item_activity_statuses_h wiash

7315: AND wias.process_activity = wpa.instance_id
7316: AND wias.activity_status = 'ERROR'
7317: AND x_max_retry >=
7318: (SELECT count(1)
7319: FROM wf_item_activity_statuses_h wiash
7320: WHERE wiash.item_type = wias.item_type
7321: AND wiash.item_key = wias.item_key
7322: AND wiash.process_activity = wias.process_activity
7323: AND wiash.action = 'RETRY');