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 3658: INDEX (WIASP WF_ITEM_ACTIVITY_STATUSES_N1) */

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

Line 3660: from WF_ITEM_ACTIVITY_STATUSES WIASP,

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

Line 3676: from WF_ITEM_ACTIVITY_STATUSES WIASC,

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

Line 3689: INDEX (WIASP WF_ITEM_ACTIVITY_STATUSES_N1) */

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

Line 3691: from WF_ITEM_ACTIVITY_STATUSES WIASP,

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

Line 3706: from WF_ITEM_ACTIVITY_STATUSES WIASC,

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

Line 3755: from WF_ITEM_ACTIVITY_STATUSES WIASP,

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

Line 3770: from WF_ITEM_ACTIVITY_STATUSES WIASC,

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

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

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

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

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

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

4056: begin
4057: Wf_Item.Root_Process(itemtype, itemkey, root, version);
4058: rootid := Wf_Process_Activity.RootInstanceId(itemtype,
4059: itemkey, root);
4060: Wf_Item_Activity_Status.Status(itemtype, itemkey, rootid, status);
4061: exception
4062: when others then
4063: status := 'x'; -- Treat errors like incomplete process
4064: end;

Line 4259: from WF_ITEM_ACTIVITY_STATUSES

4255:
4256: -- Cursor to select deferred activities to remove from background queue
4257: cursor defact is
4258: select PROCESS_ACTIVITY, BEGIN_DATE
4259: from WF_ITEM_ACTIVITY_STATUSES
4260: where ITEM_TYPE = itemtype
4261: and ITEM_KEY = itemkey
4262: and ACTIVITY_STATUS = wf_engine.eng_deferred;
4263:

Line 4331: Wf_Item_Activity_Status.ClearCache;

4327: -- Always clear the cache first
4328: -- AbortProcess, SuspendProcess and ResumeProcess should be rarely called
4329: -- from the background engine, so it should be safe to force reading from
4330: -- the database.
4331: Wf_Item_Activity_Status.ClearCache;
4332:
4333: -- Check if the process is active
4334: Wf_Item_Activity_Status.Status(itemtype, itemkey, procid, status);
4335:

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

4330: -- the database.
4331: Wf_Item_Activity_Status.ClearCache;
4332:
4333: -- Check if the process is active
4334: Wf_Item_Activity_Status.Status(itemtype, itemkey, procid, status);
4335:
4336: if (status is null) then
4337: -- This process has not been run yet. Create a pre-suspended
4338: -- status row so engine does not run process later

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

4335:
4336: if (status is null) then
4337: -- This process has not been run yet. Create a pre-suspended
4338: -- status row so engine does not run process later
4339: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, procid,
4340: wf_engine.eng_suspended, wf_engine.eng_null, null, null,
4341: newStatus=>TRUE);
4342: elsif (status = wf_engine.eng_deferred) then
4343: -- Change status from 'deferred' to 'suspended'

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

4341: newStatus=>TRUE);
4342: elsif (status = wf_engine.eng_deferred) then
4343: -- Change status from 'deferred' to 'suspended'
4344: -- Doing this prevents the background processor from picking it up.
4345: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, procid,
4346: wf_engine.eng_suspended, null,
4347: null, null);
4348: elsif (status = wf_engine.eng_active) then
4349: -- Mark process as 'suspended', 'null' in WIAS table

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

4347: null, null);
4348: elsif (status = wf_engine.eng_active) then
4349: -- Mark process as 'suspended', 'null' in WIAS table
4350: -- Doing this stops the engine from going through the rest of the flow
4351: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, procid,
4352: wf_engine.eng_suspended, null,
4353: null, null);
4354:
4355: -- Suspend all the children processes

Line 4411: FROM wf_notifications wn, WF_ITEM_ACTIVITY_STATUSES ias

4407:
4408: l_lock boolean;
4409: cursor openNotifications is -- <7513983>
4410: SELECT wn.notification_id
4411: FROM wf_notifications wn, WF_ITEM_ACTIVITY_STATUSES ias
4412: WHERE ias.item_type = itemtype
4413: AND ias.item_key = itemkey
4414: AND ias.notification_id is not null
4415: AND ias.notification_id = wn.group_id

Line 4419: FROM wf_notifications wn, WF_ITEM_ACTIVITY_STATUSES_H iash

4415: AND ias.notification_id = wn.group_id
4416: AND wn.status = 'OPEN'
4417: UNION
4418: SELECT wn.notification_id
4419: FROM wf_notifications wn, WF_ITEM_ACTIVITY_STATUSES_H iash
4420: WHERE iash.item_type = itemtype
4421: AND iash.item_key = itemkey
4422: AND iash.notification_id is not null
4423: AND iash.notification_id = wn.notification_id

Line 4494: Wf_Item_Activity_Status.ClearCache;

4490: end if;
4491: end if;
4492:
4493: -- Always clear the cache first
4494: Wf_Item_Activity_Status.ClearCache;
4495:
4496: -- Check the process is not already complete
4497: Wf_Item_Activity_Status.Status(itemtype, itemkey, procid, status);
4498:

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

4493: -- Always clear the cache first
4494: Wf_Item_Activity_Status.ClearCache;
4495:
4496: -- Check the process is not already complete
4497: Wf_Item_Activity_Status.Status(itemtype, itemkey, procid, status);
4498:
4499: if (status is null) then
4500: if (WF_ITEM.SetEndDate(itemtype, itemkey) = 1) then
4501: Wf_Core.Token('TYPE', itemtype);

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

4511: Wf_Core.Raise('WFENG_ITEM_PROCESS_ACTIVE');
4512: else
4513: -- Mark process as 'COMPLETE', 'result' in WIAS table
4514: -- Doing this stops the engine from going through the rest of the flow
4515: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, procid,
4516: wf_engine.eng_completed, result,
4517: null, SYSDATE);
4518:
4519: -- Kill child activities recursively

Line 4585: from WF_ITEM_ACTIVITY_STATUSES

4581: -- Cursor to select deferred activities to restart.
4582: cursor defact is
4583: select
4584: PROCESS_ACTIVITY, BEGIN_DATE
4585: from WF_ITEM_ACTIVITY_STATUSES
4586: where ITEM_TYPE = itemtype
4587: and ITEM_KEY = itemkey
4588: and ACTIVITY_STATUS = wf_engine.eng_deferred;
4589:

Line 4664: Wf_Item_Activity_Status.ClearCache;

4660: end if;
4661: end if;
4662:
4663: -- Always clear the cache first
4664: Wf_Item_Activity_Status.ClearCache;
4665:
4666: -- Check if the process is suspended
4667: Wf_Item_Activity_Status.Status(itemtype, itemkey, procid, status);
4668: if (status is null) then

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

4663: -- Always clear the cache first
4664: Wf_Item_Activity_Status.ClearCache;
4665:
4666: -- Check if the process is suspended
4667: Wf_Item_Activity_Status.Status(itemtype, itemkey, procid, status);
4668: if (status is null) then
4669: Wf_Core.Token('TYPE', itemtype);
4670: Wf_Core.Token('KEY', itemkey);
4671: Wf_Core.Token('NAME', proc);

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

4677: Wf_Core.Raise('WFENG_ITEM_PROCESS_SUSPENDED');
4678: else
4679: -- If we came here, that means the process is currently suspended.
4680: -- Mark process as eng_active 'active', 'null' in WIAS table
4681: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, procid,
4682: wf_engine.eng_active, null, null, null);
4683:
4684: -- Mark any sub-processes as active again
4685: Wf_Engine_Util.Resume_Child_Processes(itemtype, itemkey, procid);

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

4711: --of the activity or to sysdate if begin_date is null
4712: --Also set the status to active only if begin_date <= sysdate
4713:
4714: if (nvl(act_begin_date(i),sysdate) <= sysdate) then
4715: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actidarr(i),
4716: wf_engine.eng_active, null, sysdate, null);
4717: begin
4718: savepoint wf_savepoint;
4719: Wf_Engine_Util.Process_Activity(itemtype, itemkey, actidarr(i),

Line 4725: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey,

4721: exception
4722: when trig_savepoint or dist_savepoint then
4723: -- Can't restart process here, re-defer for the
4724: -- background process to pick up.
4725: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey,
4726: actidarr(i),wf_engine.eng_deferred, null, sysdate, null);
4727: when others then
4728: -- If anything in this process raises an exception:
4729: -- 1. rollback any work in this process thread

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

4732: -- 4. clear the error to continue with next activity
4733: rollback to wf_savepoint;
4734: Wf_Core.Context('Wf_Engine', 'ResumeProcess', itemtype, itemkey,
4735: process);
4736: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actidarr(i),
4737: wf_engine.eng_exception, FALSE);
4738: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actidarr(i),
4739: wf_engine.eng_exception);
4740:

Line 4837: FROM wf_item_activity_statuses wias

4833: p_process in varchar2) is
4834:
4835: cursor suspended_items(p_itemType in varchar2) is
4836: SELECT distinct wias.item_key
4837: FROM wf_item_activity_statuses wias
4838: WHERE wias.item_type = p_itemType
4839: AND wias.activity_status = wf_engine.eng_suspended;
4840:
4841: cursor all_suspended_items is

Line 4843: FROM wf_item_activity_statuses wias

4839: AND wias.activity_status = wf_engine.eng_suspended;
4840:
4841: cursor all_suspended_items is
4842: SELECT distinct wias.item_type, wias.item_key
4843: FROM wf_item_activity_statuses wias
4844: WHERE wias.activity_status = wf_engine.eng_suspended;
4845:
4846: begin
4847:

Line 5132: from wf_item_activity_statuses

5128: ASSIGNED_USER, NOTIFICATION_ID,
5129: BEGIN_DATE, END_DATE, EXECUTION_TIME,
5130: ERROR_NAME, ERROR_MESSAGE, ERROR_STACK,
5131: OUTBOUND_QUEUE_ID, DUE_DATE
5132: from wf_item_activity_statuses
5133: where item_type = itemtype
5134: and item_key = copy_itemkey;
5135:
5136: cursor all_activities_hist is

Line 5143: from wf_item_activity_statuses_h

5139: ASSIGNED_USER, NOTIFICATION_ID,
5140: BEGIN_DATE, END_DATE, EXECUTION_TIME,
5141: ERROR_NAME, ERROR_MESSAGE, ERROR_STACK,
5142: OUTBOUND_QUEUE_ID, DUE_DATE
5143: from wf_item_activity_statuses_h
5144: where item_type = itemtype
5145: and item_key = copy_itemkey;
5146:
5147:

Line 5156: from wf_item_activity_statuses

5152: ASSIGNED_USER, NOTIFICATION_ID,
5153: BEGIN_DATE, END_DATE, EXECUTION_TIME,
5154: ERROR_NAME, ERROR_MESSAGE, ERROR_STACK,
5155: OUTBOUND_QUEUE_ID, DUE_DATE
5156: from wf_item_activity_statuses
5157: where item_type = itemtype
5158: and item_key = copy_itemkey
5159: and notification_id is not null
5160: and activity_status = 'NOTIFIED'

Line 5335: insert into wf_item_activity_statuses

5331:
5332: end if;
5333:
5334: -- now insert the status
5335: insert into wf_item_activity_statuses
5336: (ITEM_TYPE, ITEM_KEY, PROCESS_ACTIVITY,
5337: ACTIVITY_STATUS, ACTIVITY_RESULT_CODE,
5338: ASSIGNED_USER, NOTIFICATION_ID,
5339: BEGIN_DATE, END_DATE, EXECUTION_TIME,

Line 5362: insert into wf_item_activity_statuses_h

5358: hist.item_key, itemkey, nid);
5359: end if;
5360:
5361: -- now insert the status
5362: insert into wf_item_activity_statuses_h
5363: (ITEM_TYPE, ITEM_KEY, PROCESS_ACTIVITY,
5364: ACTIVITY_STATUS, ACTIVITY_RESULT_CODE,
5365: ASSIGNED_USER, NOTIFICATION_ID,
5366: BEGIN_DATE, END_DATE, EXECUTION_TIME,

Line 5380: update wf_item_activity_statuses ias

5376: end loop;
5377:
5378: -- update any active functions to notified state
5379: begin
5380: update wf_item_activity_statuses ias
5381: set activity_status = wf_engine.eng_notified
5382: where item_type = itemtype
5383: and item_key = itemkey
5384: and activity_status = 'ACTIVE'

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

5591: actid := Wf_Process_Activity.StartInstanceId(itemtype, root, version,
5592: activity);
5593:
5594: -- Create a status row for new activity
5595: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actid,
5596: wf_engine.eng_active, wf_engine.eng_null, sysdate, null, newStatus=>TRUE);
5597: else
5598:
5599: --Bug 2607770

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

5623: l_lock := wf_item.acquire_lock(itemtype,itemkey,true);
5624: end if;
5625:
5626: -- Get notification id
5627: Wf_Item_Activity_Status.Notification_Status(itemtype, itemkey, actid,
5628: notid, user);
5629:
5630: -- Close any open notifications associated with this activity.
5631: -- Note: if notifications are not closed here, they will be cancelled

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

5668: -- 4. clear the error to continue with next activity
5669: rollback to wf_savepoint;
5670: Wf_Core.Context('Wf_Engine', 'CompleteActivity', itemtype, itemkey,
5671: activity, result);
5672: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,
5673: wf_engine.eng_exception, FALSE);
5674: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid,
5675: wf_engine.eng_exception);
5676: Wf_Core.Clear;

Line 5751: from WF_ITEM_ACTIVITY_STATUSES WIAS, WF_PROCESS_ACTIVITIES WPA

5747: -- Look up activity instance label
5748: begin
5749: select WPA.PROCESS_NAME, WPA.INSTANCE_LABEL
5750: into process, label
5751: from WF_ITEM_ACTIVITY_STATUSES WIAS, WF_PROCESS_ACTIVITIES WPA
5752: where WIAS.ITEM_TYPE = itemtype
5753: and WIAS.ITEM_KEY = itemkey
5754: and WIAS.ACTIVITY_STATUS = wf_engine.eng_notified
5755: and WIAS.PROCESS_ACTIVITY = WPA.INSTANCE_ID

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

5860: Wf_Core.Raise('WFENG_NOTIFICATION_NAME');
5861: end if;
5862:
5863: -- Check if the activity is active
5864: Wf_Item_Activity_Status.Status(itemtype, itemkey, actid, status);
5865:
5866: if (status is null) then
5867: -- Insert one row with the performer
5868: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actid,

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

5864: Wf_Item_Activity_Status.Status(itemtype, itemkey, actid, status);
5865:
5866: if (status is null) then
5867: -- Insert one row with the performer
5868: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actid,
5869: wf_engine.eng_waiting, '', null, null, newStatus=>TRUE);
5870: Wf_Item_Activity_Status.Update_Notification(itemtype, itemkey, actid,
5871: '', performer);
5872: elsif (status = wf_engine.eng_waiting) then

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

5866: if (status is null) then
5867: -- Insert one row with the performer
5868: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, actid,
5869: wf_engine.eng_waiting, '', null, null, newStatus=>TRUE);
5870: Wf_Item_Activity_Status.Update_Notification(itemtype, itemkey, actid,
5871: '', performer);
5872: elsif (status = wf_engine.eng_waiting) then
5873: Wf_Item_Activity_Status.Update_Notification(itemtype, itemkey, actid,
5874: '', performer);

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

5869: wf_engine.eng_waiting, '', null, null, newStatus=>TRUE);
5870: Wf_Item_Activity_Status.Update_Notification(itemtype, itemkey, actid,
5871: '', performer);
5872: elsif (status = wf_engine.eng_waiting) then
5873: Wf_Item_Activity_Status.Update_Notification(itemtype, itemkey, actid,
5874: '', performer);
5875: elsif (status in (wf_engine.eng_notified, wf_engine.eng_error)) then
5876: -- Check this is not a voting activity.
5877: -- Voting activities cannot be re-assigned.

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

5882: Wf_Core.Raise('WFENG_VOTE_REASSIGN');
5883: end if;
5884:
5885: -- Get notification id
5886: Wf_Item_Activity_Status.Notification_Status(itemtype, itemkey, actid,
5887: notid, user);
5888: -- Update the assigned user column in WIAS
5889: Wf_Item_Activity_Status.Update_Notification(itemtype, itemkey, actid,
5890: notid, performer);

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

5885: -- Get notification id
5886: Wf_Item_Activity_Status.Notification_Status(itemtype, itemkey, actid,
5887: notid, user);
5888: -- Update the assigned user column in WIAS
5889: Wf_Item_Activity_Status.Update_Notification(itemtype, itemkey, actid,
5890: notid, performer);
5891:
5892: if (notid is not null) then
5893: -- 16-DEC-03 shanjgik bug fix 2722369 check for reassignType added

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

6019: -- 4. clear the error to continue with next activity
6020: rollback to wf_savepoint;
6021: Wf_Core.Context('Wf_Engine', 'HandleErrorInternal', itemtype, itemkey,
6022: activity, command, result);
6023: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,
6024: wf_engine.eng_exception, FALSE);
6025: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid,
6026: wf_engine.eng_exception);
6027: Wf_Core.Clear;

Line 6048: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey,

6044: when trig_savepoint or dist_savepoint then
6045: -- You must be in a restricted environment,
6046: -- no fancy error processing for you!
6047: -- Immediately defer activity to background engine.
6048: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey,
6049: actid, wf_engine.eng_deferred, wf_engine.eng_null,
6050: SYSDATE, null);
6051: when others then
6052: -- If anything in this process raises an exception:

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

6056: -- 4. clear the error to continue with next activity
6057: rollback to wf_savepoint;
6058: Wf_Core.Context('Wf_Engine', 'HandleErrorInternal',itemtype,itemkey,
6059: activity, command, result);
6060: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actid,
6061: wf_engine.eng_exception, FALSE);
6062: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actid,
6063: wf_engine.eng_exception);
6064: Wf_Core.Clear;

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

6067: event_name := 'oracle.apps.wf.engine.retry';
6068: end if;
6069:
6070: -- Store the info for Audit (Bug 5903106 - moved from HandleError to here)
6071: Wf_Item_Activity_Status.Audit(itemtype, itemkey, actid, upper(command), null);
6072:
6073: --Pass the signature of the handle error API in the
6074: --parameter list
6075: wf_event.AddParameterToList('ITMETYPE', itemtype, l_parameterlist);

Line 6221: from WF_ITEM_ACTIVITY_STATUSES ias,

6217: cursor actc(x_itemtype varchar2, x_itemkey varchar2, x_activity varchar2) is
6218: select ias.ITEM_KEY,
6219: pa.INSTANCE_LABEL activity,
6220: pa.INSTANCE_ID actid
6221: from WF_ITEM_ACTIVITY_STATUSES ias,
6222: WF_PROCESS_ACTIVITIES pa
6223: where ias.ITEM_TYPE = x_itemtype
6224: and (x_itemkey is null or ias.ITEM_KEY = x_itemkey)
6225: and (x_activity is null or pa.INSTANCE_LABEL = x_activity)

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

6323: end HandleErrorAll;
6324:
6325: --
6326: -- ItemStatus (Public)
6327: -- This is a public cover for WF_ITEM_ACTIVITY_STATUS.ROOT_STATUS
6328: -- Returns the status and result for the root process of this item.
6329: -- If the item does not exist an exception will be raised.
6330: -- IN
6331: -- itemtype - Activity item type.

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

6346: Wf_Core.Token('ITEMKEY', nvl(itemkey, 'NULL'));
6347: Wf_Core.Raise('WFSQL_ARGS');
6348: end if;
6349:
6350: wf_item_activity_status.root_status(itemtype,itemkey,status,result);
6351: exception
6352: when others then
6353: Wf_Core.Context('Wf_Engine', 'ItemStatus', itemtype, itemkey);
6354: raise;

Line 6395: from wf_item_activity_statuses ias,

6391: ias.assigned_user,
6392: ias.notification_id NID,
6393: ntf.status,
6394: ias.performed_by
6395: from wf_item_activity_statuses ias,
6396: wf_process_activities pa,
6397: wf_activities ac,
6398: wf_activities ap,
6399: wf_items i,

Line 6441: from wf_item_activity_statuses

6437: (
6438: select process_activity,
6439: activity_status,
6440: activity_result_code
6441: from wf_item_activity_statuses
6442: where item_type = itemtype
6443: and item_key = itemkey
6444: and activity_status <> wf_engine.eng_completed
6445: order by decode(activity_status, 'ERROR',1, 'NOTIFIED',2, 'DEFERRED',3,

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

6450:
6451: --Now lets start getting all details out of the last activity
6452: if l_status = 'ERROR' then
6453: --Populate the error stack
6454: wf_item_activity_status.Error_Info(itemtype,itemkey,l_instance_id,errname,errmsg,errstack);
6455: end if;
6456:
6457: status := l_status;
6458: result := l_result;

Line 6665: FROM WF_ITEM_ACTIVITY_STATUSES WIAS, WF_PROCESS_ACTIVITIES WPA,

6661:
6662: -- Blocked activities waiting for event (if existing process)
6663: cursor evtacts is
6664: SELECT WIAS.PROCESS_ACTIVITY actid
6665: FROM WF_ITEM_ACTIVITY_STATUSES WIAS, WF_PROCESS_ACTIVITIES WPA,
6666: WF_ACTIVITIES WA
6667: WHERE WIAS.ITEM_TYPE = event.itemtype
6668: AND WIAS.ITEM_KEY = event.itemkey
6669: AND WIAS.ACTIVITY_STATUS = 'NOTIFIED'

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

6755: --Select the activities waiting to receive this event
6756: actdate := WF_Item.Active_Date(itemtype, itemkey);
6757: for act in evtacts loop
6758: actarr(i) := act.actid;
6759: Wf_Item_Activity_Status.Create_Status(itemtype, itemkey, act.actid,
6760: wf_engine.eng_notified, wf_engine.eng_null, sysdate, null);
6761: i := i + 1;
6762: end loop;
6763: actarr(i) := '';

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

6862: -- 4. clear the error to continue with next activity
6863: rollback to wf_savepoint;
6864: Wf_Core.Context('Wf_Engine', 'Event', itemtype, itemkey,
6865: process_name, event_name);
6866: Wf_Item_Activity_Status.Set_Error(itemtype, itemkey, actarr(i),
6867: wf_engine.eng_exception, FALSE);
6868: Wf_Engine_Util.Execute_Error_Process(itemtype, itemkey, actarr(i),
6869: wf_engine.eng_exception);
6870: Wf_Core.Clear;

Line 6904: FROM WF_ITEM_ACTIVITY_STATUSES WIAS,

6900:
6901: -- Blocked activities waiting for event (if existing process)
6902: cursor evtacts is
6903: SELECT /*+ LEADING(WA) */ WIAS.ITEM_TYPE, WIAS.ITEM_KEY, WIAS.PROCESS_ACTIVITY ACTID
6904: FROM WF_ITEM_ACTIVITY_STATUSES WIAS,
6905: WF_PROCESS_ACTIVITIES WPA,
6906: (
6907: SELECT /*+ NO_MERGE */ WA.*
6908: FROM WF_ACTIVITIES WA

Line 7068: Wf_Item_Activity_Status.Set_Error(evtacts_rec.item_type,

7064: -- 4. clear the error to continue with next activity
7065: rollback to wf_savepoint;
7066: Wf_Core.Context('Wf_Engine', 'Event2', evtacts_rec.item_type,
7067: evtacts_rec.item_key, event_name);
7068: Wf_Item_Activity_Status.Set_Error(evtacts_rec.item_type,
7069: evtacts_rec.item_key,
7070: evtacts_rec.actid,
7071: wf_engine.eng_exception, FALSE);
7072: Wf_Engine_Util.Execute_Error_Process(evtacts_rec.item_type,

Line 7237: FROM wf_item_activity_statuses wias,

7233: IS
7234: SELECT wias.item_key,
7235: wpa.process_name,
7236: wpa.instance_label activity
7237: FROM wf_item_activity_statuses wias,
7238: wf_process_activities wpa
7239: WHERE wias.item_type = x_item_type
7240: AND (x_item_key IS NULL OR wias.item_key = x_item_key)
7241: AND (x_process IS NULL OR wpa.process_name = x_process)

Line 7249: FROM wf_item_activity_statuses_h wiash

7245: AND wias.process_activity = wpa.instance_id
7246: AND wias.activity_status = 'ERROR'
7247: AND x_max_retry >=
7248: (SELECT count(1)
7249: FROM wf_item_activity_statuses_h wiash
7250: WHERE wiash.item_type = wias.item_type
7251: AND wiash.item_key = wias.item_key
7252: AND wiash.process_activity = wias.process_activity
7253: AND wiash.action = 'RETRY');