DBA Data[Home] [Help]

PACKAGE: APPS.WF_MONITOR

Source


1 package WF_MONITOR as
2 /* $Header: wfmons.pls 120.7 2006/05/01 09:54:10 sramani ship $: */
3 /*#
4  * Provides APIs to access the various pages of the Workflow Monitor.
5  * @rep:scope public
6  * @rep:product OWF
7  * @rep:displayname Workflow Monitor
8  * @rep:lifecycle active
9  * @rep:compatibility S
10  * @rep:category BUSINESS_ENTITY WF_ENGINE
11  * @rep:ihelp FND/@wfmonit See the related online help
12  */
13 -- Html
14 --   Sends back a very simple dynamic HTML page to tell the browser what
15 --   applet to run.
16 procedure Html(
17     x_item_type  in varchar2,
18     x_item_key   in varchar2,
19     x_admin_mode in varchar2,
20     x_access_key in varchar2,
21     x_nls_lang   in varchar2 default null);
22 
23 -- GetRole
24 --   Called by Monitor.class.
25 --   Printf's all the role information back to the
26 --   Monitor applet, which reads them a line at a time, interpreting them.
27 -- IN
28 --  x_filter
29 procedure GetRole(p_titles_only varchar2,
30                   P_FIND_CRITERIA varchar2 default null);
31 
32 -- GetResource
33 --   Called by Monitor.class.
34 --   Printf's all the role information back to the
35 --   Monitor applet, which reads them a line at a time, interpreting them.
36 -- IN
37 --  x_filter
38 function GetResource(x_restype varchar2,
39                       x_resname varchar2) return varchar2;
40 
41 -- GetResources
42 --   Called by Monitor.class.
43 --   Printf's all the role information back to the
44 --   Monitor applet, which reads them a line at a time, interpreting them.
45 -- IN
46 --  x_filter
47 function GetResources(x_restype varchar2,
48                       x_respattern varchar2) return varchar2;
49 
50 -- GetProcess
51 --   Called by Monitor.class.
52 --   Printf's all the information about the workflow objects back to the
53 --   Monitor applet, which reads them a line at a time, interpreting them.
54 -- IN
55 --  x_item_type
56 --  x_item_key
57 --  x_proc_name
58 function GetProcess(
59     x_item_type varchar2,
60     x_item_key  varchar2,
61     x_admin_mode varchar2,
62     x_access_key varchar2,
63     x_proc_name varchar2 default null,
64     x_proc_type varchar2 default null) return clob;
65 
66 -- GetAccessKey
67 /*#
68  * Retrieves the access key password that controls access to the
69  * Workflow Monitor. Each process instance has separate access
70  * keys for running the Workflow Monitor in 'ADMIN' mode or 'USER'
71  * mode.
72  * @param x_item_type Item Type
73  * @param x_item_key Item Key
74  * @param x_admin_mode Administrator Mode
75  * @return Access Key
76  * @rep:scope public
77  * @rep:lifecycle active
78  * @rep:displayname Get Access Key
79  * @rep:ihelp FND/@wfmonit#getackey See the related online help
80  */
81 function GetAccessKey(
82     x_item_type  varchar2,
83     x_item_key   varchar2,
84     x_admin_mode varchar2) return varchar2;
85 
86 function GetUrl (x_agent in varchar2,
87                  x_item_type in varchar2,
88                  x_item_key in varchar2,
89                  x_admin_mode in varchar2 default 'NO') return varchar2;
90 
91 /*#
92  * Returns a URL that allows guest access to the Status
93  * Diagram page in the administrator version of the Status
94  * Monitor. The URL displays the Status Diagram page
95  * for a specific instance of a workflow process, operating
96  * either with or without administrator privileges.
97  * @param x_agent Web Agent
98  * @param x_item_type Item Type
99  * @param x_item_key Item Key
100  * @param x_admin_mode Administrator Mode
101  * @return Status Diagram URL
102  * @rep:scope public
103  * @rep:lifecycle active
104  * @rep:displayname Get Status Diagram URL
105  * @rep:ihelp FND/@wfmonit#geturl See the related online help
106  */
107 function GetDiagramURL (x_agent in varchar2,
108                  x_item_type in varchar2,
109                  x_item_key in varchar2,
110                  x_admin_mode in varchar2 default 'NO') return varchar2;
111 
112 /*#
113  * Returns a URL that allows guest access to the
114  * Participant Responses page in the administrator version
115  * of the Status Monitor. The URL displays the Participant
116  * Responses page for a specific instance of a workflow
117  * process, operating either with or without administrator
118  * privileges.
119  * @param x_agent Web Agent
120  * @param x_item_type Item Type
121  * @param x_item_key Item Key
122  * @param x_admin_mode Administrator Mode
123  * @return Participant Responses URL
124  * @rep:scope public
125  * @rep:lifecycle active
126  * @rep:displayname Get Participant Responses URL
127  * @rep:ihelp FND/@wfmonit#getenv See the related online help
128  */
129 function GetEnvelopeURL (
130   x_agent               IN VARCHAR2,
131   x_item_type           IN VARCHAR2,
132   x_item_key            IN VARCHAR2,
133   x_admin_mode          IN VARCHAR2 DEFAULT 'NO'
134 ) return varchar2;
135 
136 /*#
137  * Returns a URL that allows guest access to the Activity
138  * History page in the administrator version of the
139  * Status Monitor. The URL displays the Activity History
140  * page for a specific instance of a workflow process,
141  * operating either with or without administrator
142  * privileges. All activity type and activity status
143  * filtering options are automatically selected by
144  * default.
145  * @param x_agent Web Agent
146  * @param x_item_type Item Type
147  * @param x_item_key Item Key
148  * @param x_admin_mode Administrator Mode
149  * @param x_options Filtering Option
150  * @return Activity History URL
151  * @rep:scope public
152  * @rep:lifecycle active
153  * @rep:displayname Get Activity History URL
154  * @rep:ihelp FND/@wfmonit#getadenv See the related online help
155  */
156 function GetAdvancedEnvelopeURL (
157   x_agent               IN VARCHAR2,
158   x_item_type           IN VARCHAR2,
159   x_item_key            IN VARCHAR2,
160   x_admin_mode          IN VARCHAR2 DEFAULT 'NO',
161   x_options             IN VARCHAR2 DEFAULT NULL
162 ) return varchar2;
163 
164 
165 
166 -- EngApi
167 --  Called by Monitor class.
168 --  Directly communicate with the WF engine API and handle exceptions
169 -- IN
170 --  apiname
171 --  itype
172 --  ikey
173 --  thirdarg
174 --  fortharg
175 --  fiftharg
176 procedure EngApi (api_name in varchar2,
177                   x_item_type in varchar2,
178                   x_item_key in varchar2,
179                   x_access_key in varchar2,
180                   third_arg in varchar2,
181                   forth_arg in varchar2 default '',
182                   fifth_arg in varchar2 default '');
183 
184 -- Show
185 --   This is to be called by forms when people want to link to workflow.
186 --   If nothing to be passed, this will take you to Find_Instance().
187 --   Otherwise, this will take you to the envelope() page.
188 procedure Show (
189   item_type              VARCHAR2 DEFAULT NULL,
190   item_key               VARCHAR2 DEFAULT NULL,
191   admin_mode             VARCHAR2 DEFAULT 'N',
192   access_key             VARCHAR2 DEFAULT NULL);
193 
194 --
195 -- Find_Instance
196 --   Query page to find processes
197 --
198 procedure find_instance;
199 
200 --
201 -- INSTANCE_LIST
202 --   Produce list of processes matching criteria
203 -- IN
204 --   x_active - Item active or complete (ACTIVE, COMPLETE, ALL)
205 --   x_itemtype - Itemtype (null for all)
206 --   x_ident - Itemkey (null for all)
207 --   x_process - Root process name (null for all)
208 --   x_status - Only with activities of status (SUSPEND, ERROR, ALL)
209 --   x_person - Only waiting for reponse from
210 --   x_numdays - No progress in x days
211 --
212 procedure instance_list (
213   x_active      VARCHAR2 default null,
214   x_itemtype    VARCHAR2 default null,
215   x_ident       VARCHAR2 default null,
216   x_user_ident  VARCHAR2 default null,
217   x_process     VARCHAR2 default null,
218   x_process_owner       VARCHAR2 default null,
219   x_display_process_owner       VARCHAR2 default null,
220   x_admin_privilege     VARCHAR2 default 'N',
221   x_status      VARCHAR2 default null,
222   x_person      VARCHAR2 default null,
223   x_display_person      VARCHAR2 default null,
224   x_numdays     VARCHAR2 default null);
225 
226 /*
227 ** The sorting issues are fairly complicated.
228 ** You cannot use a decode statement to identify
229 ** the direction of your sort only the column that
230 ** will be used for the sort.  To get around this
231 ** I've had to copy the select statement twice in the
232 ** envelope procedure.  The first is the sort
233 ** for the ascending list.  The second is the list
234 ** for the descending sort.  The x_activity_cursor is
235 ** shared across multiple selects and fetches its data
236 ** into the wf_activity record.
237 */
238 TYPE wf_activity_record IS RECORD
239 (
240 item_type               VARCHAR2(8),
241 item_key                VARCHAR2(240),
242 begin_date              DATE,
243 execution_time          NUMBER,
244 end_date                DATE,
245 begin_date_time         VARCHAR2(40),
246 duration                NUMBER,
247 activity_item_type      VARCHAR2(8),
248 activity_type           VARCHAR2(8),
249 parent_activity_name    VARCHAR2(30),
250 activity_name           VARCHAR2(30),
251 activity_display_name   VARCHAR2(80),
252 parent_display_name     VARCHAR2(80),
253 activity_status         VARCHAR2(8),
254 notification_status     VARCHAR2(8),
255 notification_id         NUMBER,
256 recipient_role          VARCHAR2(320),
257 recipient_role_name     VARCHAR2(4000),
258 activity_status_display VARCHAR2(4000),
259 result                  VARCHAR2(4000)
260 );
261 
262 
263 /*
264 ** Create the appropriate cursor for the requested sort
265 ** order.  We currently fetch all the activity rows for
266 ** the given process and then programatically determine
267 ** which rows to display based on your activity list
268 ** filters.
269 */
270 TYPE wf_activity_cursor IS REF CURSOR RETURN wf_activity_record;
271 
272 
273 /*
274 ** ENVELOPE
275 **   Produce list of activities matching selected process
276 ** IN
277 **-----------------------------------------------------------------------
278 **   x_item_type - Item type of this process instance
279 **   x_item_key - Internal key for this process instance
280 **   x_admin_mode - Are you in admin mode
281 **   x_access_key - Access key for this process
282 **-----------------------------------------------------------------------
283 **   These parameters are for future use when youll want to navigate
284 **   from six advanced searches deep directly back to the process list.
285 **-----------------------------------------------------------------------
286 **   x_active_find - Item active or complete (ACTIVE, COMPLETE, ALL)
287 **                   find window.  Needed to differentiate between
288 **                   this and x_active which is one of the advanced
289 **                   search options.
290 **   x_itemtype_find - Itemtype (null for all) from the find window.
291 **                   Needed to differentiate between
292 **                   this and x_item_type which is one for this specific
293 **                   process
294 **   x_ident - Itemkey (null for all)
295 **   x_process - Root process name (null for all)
296 **   x_status - Only with activities of status (SUSPEND, ERROR, ALL)
297 **   x_person - Only waiting for reponse from
298 **   x_numdays - No progress in x days
299 **-----------------------------------------------------------------------
300 **  x_advanced - Are you in advanced mode or standard (TRUE, FALSE, FIRST)
301 **               (First means youre going into advanced mode for the first
302 **                time.  The function behaves slightly differently in this
303 **                case.
304 **-----------------------------------------------------------------------
305 **   These parameters are for the advanced filter options.  The first
306 **   four are for the status checkboxes.  When one of these checkboxes
307 **   are set they get passed in as 'ACTIVE' or 'COMPLETE'.
308 **   They are Null if they are not checked. IN ( then do some comparisons
309 **   to see if the current status of the activity matches the checked
310 **   checkboxes.  x_active include statuses of ACTIVE, WAITING, DEFERRED,
311 **   and NOTIFIED
312 **-----------------------------------------------------------------------
313 **  x_active
314 **  x_complete
315 **  x_error
316 **  x_suspend
317 **-----------------------------------------------------------------------
318 **   These parameters are for the advanced filter options.  These four
319 **   are for the activity type checkboxes.  They are passed in as 'Y'
320 **   when they are checked.  They are Null if they are not checked.
321 **-----------------------------------------------------------------------
322 **  x_proc_func   - Show processes and functions
323 **  x_note_resp   - Show notifications with responses
324 **  x_note_noresp - Show FYI notifications
325 **  x_func_std    - Show Standard Workflow activities
326 **-----------------------------------------------------------------------
327 **  x_sort_column - The current column that the list is sorted by
328 **  x_sort_order - The sort order direction (ASC, DESC)
329 **-----------------------------------------------------------------------
330 */
331 procedure envelope (
332   x_item_type              VARCHAR2,
333   x_item_key               VARCHAR2,
334   x_admin_mode             VARCHAR2,
335   x_access_key             VARCHAR2,
336   x_advanced               VARCHAR2 DEFAULT NULL,
337   x_active                 VARCHAR2 DEFAULT NULL,
338   x_complete               VARCHAR2 DEFAULT NULL,
339   x_error                  VARCHAR2 DEFAULT NULL,
340   x_suspend                VARCHAR2 DEFAULT NULL,
341   x_proc_func              VARCHAR2 DEFAULT NULL,
342   x_note_resp              VARCHAR2 DEFAULT NULL,
343   x_note_noresp            VARCHAR2 DEFAULT NULL,
344   x_func_std               VARCHAR2 DEFAULT NULL,
345   x_event                  VARCHAR2 DEFAULT NULL,
346   x_sort_column            VARCHAR2 DEFAULT NULL,
347   x_sort_order             VARCHAR2 DEFAULT NULL,
348   x_nls_lang               VARCHAR2 DEFAULT NULL
349 );
350 
351 procedure envelope_frame (
352   x_item_type              VARCHAR2,
353   x_item_key               VARCHAR2,
354   x_admin_mode             VARCHAR2,
355   x_access_key             VARCHAR2,
356   x_advanced               VARCHAR2 DEFAULT NULL,
357   x_active                 VARCHAR2 DEFAULT NULL,
358   x_complete               VARCHAR2 DEFAULT NULL,
359   x_error                  VARCHAR2 DEFAULT NULL,
360   x_suspend                VARCHAR2 DEFAULT NULL,
361   x_proc_func              VARCHAR2 DEFAULT NULL,
362   x_note_resp              VARCHAR2 DEFAULT NULL,
363   x_note_noresp            VARCHAR2 DEFAULT NULL,
364   x_func_std               VARCHAR2 DEFAULT NULL,
365   x_event                  VARCHAR2 DEFAULT NULL,
366   x_sort_column            VARCHAR2 DEFAULT NULL,
367   x_sort_order             VARCHAR2 DEFAULT NULL,
368   x_nls_lang               VARCHAR2 DEFAULT NULL
369 );
370 
371 /*===========================================================================
372   PROCEDURE NAME:       draw_activity_error
373 
374   DESCRIPTION:          Displays an HTML page with all the errors that have
375                         occurred for a particular process instance
376 
377   PARAMETERS:
378      x_item_type IN     Item type of this process instance
379      x_item_key  IN     Internal key for this process instance
380 
381 ============================================================================*/
382 procedure draw_activity_error (
383  x_item_type        VARCHAR2,
384  x_item_key         VARCHAR2
385 );
386 
387 
388 /*
389 ** Create a table to store child activities for a given process
393 item_type               VARCHAR2(8),
390 */
391 TYPE wf_items_rec_type IS RECORD
392 (
394 item_key                VARCHAR2(240),
395 root_activity           VARCHAR2(30),
396 root_activity_version   NUMBER,
397 user_key                VARCHAR2(240),
398 owner_role              VARCHAR2(320),
399 begin_date              DATE,
400 end_date                DATE
401 );
402 
403 
404 /*
405 ** Create the wf_items table based on the above record definition
406 */
407  TYPE wf_items_tbl_type IS TABLE OF
408  wf_monitor.wf_items_rec_type
409  INDEX BY BINARY_INTEGER;
410 
411 
412 
413 procedure process_children (
414 x_item_type        IN VARCHAR2,
415 x_item_key         IN VARCHAR2,
416 x_admin_mode       IN VARCHAR2 DEFAULT 'NO',
417 x_nls_lang         IN VARCHAR2 DEFAULT null );
418 
419 procedure draw_process_children (
420 p_parent_item_type IN VARCHAR2,
421 p_parent_item_key  IN VARCHAR2,
422 p_admin_mode       IN VARCHAR2 DEFAULT 'NO',
423 p_indent_level     IN NUMBER DEFAULT 0,
424 p_nls_lang         IN VARCHAR2 DEFAULT null);
425 
426 procedure get_process_children (
427 p_parent_item_type IN VARCHAR2,
428 p_parent_item_key  IN VARCHAR2,
429 p_child_item_list  OUT NOCOPY wf_monitor.wf_items_tbl_type,
430 p_number_of_children OUT NOCOPY NUMBER);
431 
432 
433 PROCEDURE draw_header (
434     x_item_type  varchar2,
435     x_item_key   varchar2,
436     x_admin_mode varchar2,
437     x_access_key varchar2,
438     x_advanced   varchar2,
439     x_nls_lang   varchar2 default null);
440 
441 
442 
443 function  createapplettags (
444     x_item_type  in varchar2,
445     x_item_key   in varchar2,
446     x_admin_mode in varchar2,
447     x_access_key in varchar2,
448     x_nls_lang   in varchar2 default null,
449     x_browser    in varchar2 default 'WIN') return varchar2;
450 
451 
452 -- Procedure to build URLs to access status monitor.
453 -- These Urls will take the user either the Status Monitor Diagram,
454 -- History or the Participant Responses page in the Guest Access mode.
455 PROCEDURE buildMonitorUrl (akRegionCode in varchar2 default null,
456                            wa in varchar2 default null,
457                            wm in varchar2 default null,
458                            itemType in varchar2 default null,
459                            itemKey in varchar2 default null,
460                            ntfId in varchar2 default null);
461 
462 PROCEDURE getFWKMonitorUrl(akRegionCode in varchar2 default null,
463                            wa in varchar2 default null,
464                            wm in varchar2 default null,
465                            itemType in varchar2 default null,
466                            itemKey in varchar2 default null,
467 			   l_lurl out nocopy varchar2);
468 
469 FUNCTION getFunctionForRegion(akRegionCode in varchar2) return varchar2;
470 
471 PROCEDURE updateToFWKMonitorUrl(oldUrl in varchar2,
472                                 newUrl out nocopy varchar2,
473      		                errorCode out nocopy pls_integer);
474 
475 PROCEDURE parseUrlForParams(paramName in varchar2,
476                             l_oldUrl in varchar2,
477  			    paramValue out nocopy varchar2);
478 
479 end WF_MONITOR;