Query To Get Workflow Details - Tech7
Query To Get Workflow Details - Tech7
https://tech7.in/query-to-get-workflow-details/ 1/29
2/12/25, 11:19 AM Query to get workflow details - Tech7
15. workflowitemtypeeo.display_name,
16. wf_directory.getroledisplayname2
(workflowitemeo.owner_role)
17. AS role_name,
18. wf_fwkmon.getitemstatus
(workflowitemeo.item_type,
19.
workflowitemeo.item_key,
20.
workflowitemeo.end_date,
21.
workflowitemeo.root_activity,
22.
workflowitemeo.root_activity_version)
23. AS status_code,
24. wf_fwkmon.getroleemailaddress
(workflowitemeo.owner_role)
25. AS role_email,
26. DECODE (
27. (SELECT COUNT (0)
28. FROM wf_items wi2
29. WHERE workflowitemeo.item_type =
wi2.parent_item_type
30. AND workflowitemeo.item_key =
wi2.parent_item_key),
31. 0, 'WfMonNoChildren',
32. 'WfMonChildrenExist')
33. AS child_switcher
34. FROM wf_items workflowitemeo,
35. wf_item_types_vl workflowitemtypeeo,
36. wf_activities_vl activityeo
37. WHERE workflowitemeo.item_type =
workflowitemtypeeo.name
38. AND ActivityEO.ITEM_TYPE =
WorkflowItemEO.ITEM_TYPE
39. AND ActivityEO.NAME =
WorkflowItemEO.ROOT_ACTIVITY
40. AND activityeo.version =
workflowitemeo.root_activity_version)
41. QRSLT
42. WHERE (item_type = :item_type AND item_key = :item_key);
1. SELECT *
https://tech7.in/query-to-get-workflow-details/ 2/29
2/12/25, 11:19 AM Query to get workflow details - Tech7
https://tech7.in/query-to-get-workflow-details/ 3/29
2/12/25, 11:19 AM Query to get workflow details - Tech7
41. AS end_date_col_switch,
42. DECODE (wias.activity_status,
43. 'ERROR', 'WfStatusErrorText',
44. 'WfStatusNoterrText')
45. AS status_column_switch,
46. DECODE (wias.activity_status,
47. 'ERROR', 'WfStatusError',
48. 'COMPLETE', 'WfStatusComplete',
49. 'SUSPEND', 'WfStatusSuspended',
50. 'WAITING', 'WfStatusWaiting',
51. 'DEFERRED', 'WfStatusDeferred',
52. 'NOTIFIED', 'WfStatusNotified',
53. 'WfStatusActive')
54. AS image_column_switch,
55. wf_core.activity_result (
56. wa.result_type,
57. DECODE (wias.activity_result_code,
58. '#NULL', NULL,
59. wias.activity_result_code))
60. AS result_display,
61. wpa.activity_item_type AS activity_item_type,
62. DECODE (
63. wa.TYPE,
64. 'NOTICE', DECODE (wias.activity_status,
65. 'NOTIFIED',
'WfReassignEnabled',
66. 'ERROR',
'WfReassignEnabled',
67. 'WfReassignDisabled'),
68. 'WfReassignDisabled')
69. AS reassign_switcher,
70. DECODE (wias.activity_status,
71. 'NOTIFIED', 'N',
72. 'ACTIVE', 'N',
73. 'ERROR', 'N',
74. 'WAITING', 'N',
75. 'DEFERRED', 'N',
76. 'Y')
77. AS select_disabled,
78. DECODE (
79. wa.TYPE,
80. 'PROCESS', DECODE (wias.activity_status,
81. 'SUSPEND',
'WfResumeEnabled',
https://tech7.in/query-to-get-workflow-details/ 4/29
2/12/25, 11:19 AM Query to get workflow details - Tech7
82. 'COMPLETE',
'WfSuspResDisabled',
83. 'WfSuspendEnabled'),
84. 'WfSuspResDisabled')
85. AS suspend_switcher,
86. wa.expand_role AS expand_role,
87. DECODE (
88. wn.status,
89. 'OPEN', NVL2 (
90. wn.more_info_role,
91. wf_core.TRANSLATE
('WFNTF_MOREINFO_REQUESTED'),
92. wnl.meaning),
93. wnl.meaning)
94. AS notification_status
95. FROM wf_item_activity_statuses wias
96. LEFT JOIN wf_notifications wn
97. ON wias.notification_id =
wn.notification_id
98. LEFT JOIN wf_lookups wnl
99. ON wnl.lookup_code = wn.status
100. AND wnl.lookup_type =
'WF_NOTIFICATION_STATUS',
101. wf_lookups wl,
102. wf_items wi,
103. wf_activities_vl wa,
104. wf_process_activities wpa,
105. wf_activities_vl wa2
106. WHERE wl.lookup_code = wias.activity_status
107. AND wl.lookup_type = 'WFENG_STATUS'
108. AND wias.item_type = wi.item_type
109. AND wias.item_key = wi.item_key
110. AND wias.process_activity = wpa.instance_id
111. AND wpa.activity_name = wa.name
112. AND wpa.activity_item_type = wa.item_type
113. AND wi.begin_date BETWEEN wa.begin_date
114. AND NVL (wa.end_date,
wi.begin_date)
115. AND wpa.process_name = wa2.name
116. AND wpa.process_item_type = wa2.item_type
117. AND wpa.process_version = wa2.version
118. AND wias.item_type = :item_type
119. AND wias.item_key = :item_key
120. UNION ALL
https://tech7.in/query-to-get-workflow-details/ 5/29
2/12/25, 11:19 AM Query to get workflow details - Tech7
https://tech7.in/query-to-get-workflow-details/ 6/29
2/12/25, 11:19 AM Query to get workflow details - Tech7
160. AS end_date_col_switch,
161. DECODE (wiash.activity_status,
162. 'ERROR', 'WfStatusErrorText',
163. 'WfStatusNoterrText')
164. AS status_column_switch,
165. DECODE (wiash.activity_status,
166. 'ERROR', 'WfStatusError',
167. 'COMPLETE', 'WfStatusComplete',
168. 'SUSPEND', 'WfStatusSuspended',
169. 'WAITING', 'WfStatusWaiting',
170. 'DEFERRED', 'WfStatusDeferred',
171. 'NOTIFIED', 'WfStatusNotified',
172. 'WfStatusActive')
173. AS image_column_switch,
174. wf_core.activity_result (
175. wa.result_type,
176. DECODE (wiash.activity_result_code,
177. '#NULL', NULL,
178. wiash.activity_result_code))
179. AS result_display,
180. wpa.activity_item_type AS
activity_item_type,
181. DECODE (
182. wa.TYPE,
183. 'NOTICE', DECODE (wiash.activity_status,
184. 'NOTIFIED',
'WfReassignEnabled',
185. 'ERROR',
'WfReassignEnabled',
186. 'WfReassignDisabled'),
187. 'WfReassignDisabled')
188. AS reassign_switcher,
189. DECODE (wiash.activity_status,
190. 'NOTIFIED', 'N',
191. 'ACTIVE', 'N',
192. 'ERROR', 'N',
193. 'WAITING', 'N',
194. 'DEFERRED', 'N',
195. 'Y')
196. AS select_disabled,
197. DECODE (
198. wa.TYPE,
199. 'PROCESS', DECODE (wiash.activity_status,
https://tech7.in/query-to-get-workflow-details/ 7/29
2/12/25, 11:19 AM Query to get workflow details - Tech7
200. 'SUSPEND',
'WfResumeEnabled',
201. 'COMPLETE',
'WfSuspResDisabled',
202. 'WfSuspendEnabled'),
203. 'WfSuspResDisabled')
204. AS suspend_switcher,
205. wa.expand_role AS expand_role,
206. DECODE (
207. wn.status,
208. 'OPEN', NVL2 (
209. wn.more_info_role,
210. wf_core.TRANSLATE
('WFNTF_MOREINFO_REQUESTED'),
211. wnl.meaning),
212. wnl.meaning)
213. AS notification_status
214. FROM wf_item_activity_statuses_h wiash
215. LEFT JOIN wf_notifications wn
216. ON wiash.notification_id =
wn.notification_id
217. LEFT JOIN wf_lookups wnl
218. ON wnl.lookup_code = wn.status
219. AND wnl.lookup_type =
'WF_NOTIFICATION_STATUS',
220. wf_lookups wl,
221. wf_items wi,
222. wf_activities_vl wa,
223. wf_process_activities wpa,
224. wf_activities_vl wa2
225. WHERE wl.lookup_code = wiash.activity_status
226. AND wl.lookup_type = 'WFENG_STATUS'
227. AND wiash.item_type = wi.item_type
228. AND wiash.item_key = wi.item_key
229. AND wiash.process_activity = wpa.instance_id
230. AND wpa.activity_name = wa.name
231. AND wpa.activity_item_type = wa.item_type
232. AND wi.begin_date BETWEEN wa.begin_date
233. AND NVL (wa.end_date,
wi.begin_date)
234. AND wpa.process_name = wa2.name
235. AND wpa.process_item_type = wa2.item_type
236. AND wpa.process_version = wa2.version
237. AND wiash.item_type = :item_type
https://tech7.in/query-to-get-workflow-details/ 8/29
2/12/25, 11:19 AM Query to get workflow details - Tech7
If you have read only access to apps user objects, please use below query.
https://tech7.in/query-to-get-workflow-details/ 9/29
2/12/25, 11:19 AM Query to get workflow details - Tech7
https://tech7.in/query-to-get-workflow-details/ 11/29
2/12/25, 11:19 AM Query to get workflow details - Tech7
https://tech7.in/query-to-get-workflow-details/ 12/29
2/12/25, 11:19 AM Query to get workflow details - Tech7
154. wiash.assigned_user AS
role_email_address,
155. -- wf_directory.getroledisplayname2 (
156. -- DECODE (
157. -- wn.status,
158. -- 'OPEN', NVL (wn.more_info_role,
wiash.assigned_user),
159. -- wiash.assigned_user))
160. wiash.assigned_user AS role_display_name,
161. DECODE (wiash.activity_result_code,
162. '#NULL', 'WfNoCloseDate',
163. 'WfCloseDate')
164. AS end_date_col_switch,
165. DECODE (wiash.activity_status,
166. 'ERROR', 'WfStatusErrorText',
167. 'WfStatusNoterrText')
168. AS status_column_switch,
169. DECODE (wiash.activity_status,
170. 'ERROR', 'WfStatusError',
171. 'COMPLETE', 'WfStatusComplete',
172. 'SUSPEND', 'WfStatusSuspended',
173. 'WAITING', 'WfStatusWaiting',
174. 'DEFERRED', 'WfStatusDeferred',
175. 'NOTIFIED', 'WfStatusNotified',
176. 'WfStatusActive')
177. AS image_column_switch,
178. -- wf_core.activity_result (
179. -- wa.result_type,
180. -- DECODE (wiash.activity_result_code,
181. -- '#NULL', NULL,
182. -- wiash.activity_result_code))
183. wiash.activity_result_code AS result_display,
184. wpa.activity_item_type AS
activity_item_type,
185. DECODE (
186. wa.TYPE,
187. 'NOTICE', DECODE (wiash.activity_status,
188. 'NOTIFIED',
'WfReassignEnabled',
189. 'ERROR',
'WfReassignEnabled',
190. 'WfReassignDisabled'),
191. 'WfReassignDisabled')
192. AS reassign_switcher,
https://tech7.in/query-to-get-workflow-details/ 13/29
2/12/25, 11:19 AM Query to get workflow details - Tech7
https://tech7.in/query-to-get-workflow-details/ 14/29
2/12/25, 11:19 AM Query to get workflow details - Tech7
Related posts:
Query to find all Expense report entry delegations
Query to find vacation rules in Oracle R12
Query to find AP invoice workflow item key in oracle apps
Query to get workflow details
https://tech7.in/query-to-get-workflow-details/ 15/29
2/12/25, 11:19 AM Query to get workflow details - Tech7
https://tech7.in/query-to-get-workflow-details/ 16/29
2/12/25, 11:19 AM Query to get workflow details - Tech7
https://tech7.in/query-to-get-workflow-details/ 17/29
2/12/25, 11:19 AM Query to get workflow details - Tech7
https://tech7.in/query-to-get-workflow-details/ 18/29
2/12/25, 11:19 AM Query to get workflow details - Tech7
https://tech7.in/query-to-get-workflow-details/ 19/29
2/12/25, 11:19 AM Query to get workflow details - Tech7
https://tech7.in/query-to-get-workflow-details/ 20/29
2/12/25, 11:19 AM Query to get workflow details - Tech7
https://tech7.in/query-to-get-workflow-details/ 21/29
2/12/25, 11:19 AM Query to get workflow details - Tech7
https://tech7.in/query-to-get-workflow-details/ 22/29
2/12/25, 11:19 AM Query to get workflow details - Tech7
https://tech7.in/query-to-get-workflow-details/ 23/29
2/12/25, 11:19 AM Query to get workflow details - Tech7
https://tech7.in/query-to-get-workflow-details/ 24/29
2/12/25, 11:19 AM Query to get workflow details - Tech7
https://tech7.in/query-to-get-workflow-details/ 25/29
2/12/25, 11:19 AM Query to get workflow details - Tech7
https://tech7.in/query-to-get-workflow-details/ 26/29
2/12/25, 11:19 AM Query to get workflow details - Tech7
https://tech7.in/query-to-get-workflow-details/ 27/29
2/12/25, 11:19 AM Query to get workflow details - Tech7
https://tech7.in/query-to-get-workflow-details/ 28/29
2/12/25, 11:19 AM Query to get workflow details - Tech7
https://tech7.in/query-to-get-workflow-details/ 29/29