Sunday, December 30, 2012

Query to find the Activity Status of the workflow

















Title:










Query to find the Activity Status of the workflow





Description:










The following query is to determine the activity status of the workflow for which the item type(internal Workflow name) and item key(Particular instance) is known. Both are mandatory parameters and they are case sensitive.





Query:










SELECT TO_CHAR(WIAS.BEGIN_DATE, 'DD-MON-RR HH24:MI:SS') BEGIN_DATE,


TO_CHAR(WIAS.END_DATE, 'DD-MON-RR HH24:MI:SS') END_DATE,


WAP.NAME || '/' || WPA.INSTANCE_LABEL ACTIVITY,


WIAS.ACTIVITY_STATUS STATUS,


WIAS.ACTIVITY_RESULT_CODE RESULT,


WIAS.ASSIGNED_USER ASSIGNED_USER,


WIAS.NOTIFICATION_ID "Notification Id",


WN.STATUS "Status",


WIAS.ACTION,


WIAS.PERFORMED_BY


FROM WF_ITEM_ACTIVITY_STATUSES WIAS,


WF_PROCESS_ACTIVITIES WPA,


WF_ACTIVITIES WAC,


WF_ACTIVITIES WAP,


WF_ITEMS WI,


WF_NOTIFICATIONS WN


WHERE WIAS.ITEM_TYPE = '&item_type' AND WIAS.ITEM_KEY = '&item_key' AND


WI.ITEM_TYPE = '&item_type' AND


WI.ITEM_KEY = WIAS.ITEM_KEY AND WI.BEGIN_DATE >= WAC.BEGIN_DATE AND


WI.BEGIN_DATE < NVL(WAC.END_DATE, WI.BEGIN_DATE + 1) AND


WIAS.PROCESS_ACTIVITY = WPA.INSTANCE_ID AND


WPA.ACTIVITY_NAME = WAC.NAME AND


WPA.ACTIVITY_ITEM_TYPE = WAC.ITEM_TYPE AND


WPA.PROCESS_NAME = WAP.NAME AND


WPA.PROCESS_ITEM_TYPE = WAP.ITEM_TYPE AND


WPA.PROCESS_VERSION = WAP.VERSION AND AND


WN.NOTIFICATION_ID(+) = WIAS.NOTIFICATION_ID


ORDER BY WIAS.BEGIN_DATE, WIAS.EXECUTION_TIME





No comments:

Post a Comment

Command to do active duplicate for Oracle Database

1. First login to target server 2. Validate tns connectivity between Source DB and Target DB 3. Prepare and validate space availability 4. S...