----查当前系统中所有的工作流:
SELECT b.NAME,t.display_name, t.description
FROMwf_item_types b, wf_item_types_tl t
WHERE b.NAME =t.NAME
ANDt.LANGUAGE = 'ZHS'
ORDER BY 1
----查看当前的Workflow管理员,用其登陆EBS即可
SELECTwfr.text
FROMwf_resources wfr
WHERE NAME ='WF_ADMIN_ROLE'
ANDwfr.LANGUAGE = 'US'
----查看Notifaction
SELECT wfn.notification_id,
wfn.message_type,
wfn.recipient_role,
wfn.status,
wfn.subject,
wfn.due_date,
wfn.end_date
FROM wf_notifications wfn
WHERE wfn.message_type = 'Item type的 Internal name'
AND wfn.subject LIKE ' message标题 '
ORDER BY wfn.notification_id DESC
--获取流程实例的属性值:
SELECTitem_type,
item_key,
NAME,
text_value,
number_value,
date_value,
event_value
FROMapplsys.wf_item_attribute_values
WHERE item_type = 'item type的internalname'
AND item_key = 'item key的值 ';
--获取当前的active节点的信息:
SELECTwas.item_type,
was.item_key,
wpa.process_name || ':' || wpa.instance_label activity,
was.activity_status,
was.activity_result_code,
was.assigned_user,
was.notification_id,
was.begin_date,
pro.display_name process_name,
act.display_name activity_name
FROMapps.wf_item_activity_statuses was,
apps.wf_process_activities wpa,
apps.wf_activities_vl pro,
apps.wf_activities_vl act,
applsys.wf_items wi
WHEREwas.process_activity = wpa.instance_id
ANDwpa.process_item_type = pro.item_type
ANDwpa.process_name = pro.NAME
ANDwpa.process_version = pro.version
ANDwpa.activity_item_type = act.item_type
ANDwpa.activity_name = act.NAME
ANDwas.item_type = wi.item_type
ANDwas.item_key = wi.item_key
ANDwi.begin_date >= act.begin_date
ANDwi.begin_date < nvl(act.end_date, wi.begin_date + 1)
AND was.item_type = 'item type的 internal name'
AND was.item_key = 'item key的值'
ANDwas.end_date IS NULL;
/*查找出EBS中过期工作流数据,以确定是否可以清除,须确保两个条件:
Wf_items表中本条工作流数据end_date不为空(保证本条工作流状态为closed)
Wf_items表中本条工作流数据不含父项工作流,或者父项工作流end_date也不为空(保证本条工作流的父工作流状态为closed)
*/
select c.item_typechild,
decode(c.end_date, null, 'OPEN', 'CLOSED') child_status,
c.parent_item_type parent,
decode(c.parent_item_type,
null,
'NOPARENT',
decode(p.end_date, null, 'OPEN', 'CLOSED'))parent_status,
count(*)
from wf_itemsp, wf_items c
wherep.item_type(+) = c.parent_item_type
andp.item_key(+) = c.parent_item_key
group byc.item_type,
decode(c.end_date, null, 'OPEN', 'CLOSED'),
c.parent_item_type,
decode(c.parent_item_type,
null,
'NOPARENT',
decode(p.end_date, null, 'OPEN','CLOSED'))
order by c.item_type, c.parent_item_type