Previous Next       Contents Index Glossary
         Previous  Next          Contents  Index  Glossary

Background

PL/SQL Syntax

procedure Background

    (itemtype in varchar2,
minthreshold in number default null,
maxthreshold in number default null,
process_deferred in boolean default TRUE,
process_timeout in boolean default FALSE,
process_stuck in boolean default FALSE);

Description

Runs a background engine for processing deferred activities, timed out activities, and stuck processes using the parameters specified. The background engine executes all activities that satisfy the given arguments at the time that the background engine is invoked. This procedure does not remain running long term, so you must restart this procedure periodically. Any activities that are newly deferred or timed out or processes that become stuck after the current background engine starts are processed by the next background engine that is invoked. You may run a script called wfbkgchk.sql to get a list of the activities waiting to be processed by the next background engine run. See: Wfbkgchk.sql.

If you are using the standalone version of Oracle Workflow, you can use one of the sample background engine looping scripts described below or create your own script to make the background engine procedure loop indefinitely. If you are using the version of Oracle Workflow embedded in Oracle Applications, you can use the concurrent program version of this procedure and take advantage of the concurrent manager to schedule the background engine to run periodically. To Schedule Background Engines

Arguments (input)

itemtype A valid item type. If the item type is null the Workflow engine will run for all item types.
minthreshold Optional minimum cost threshold for an activity that this background engine processes, in hundredths of a second. There is no minimum cost threshold if this parameter is null.
maxthreshold Optional maximum cost threshold for an activity that this background engine processes in hundredths of a second. There is no maximum cost threshold if this parameter is null.
process_deferred Specify TRUE or FALSE to indicate whether to run deferred processes. Defaults to TRUE.
process_timeout Specify TRUE or FALSE to indicate whether to run timed out processes. Defaults to FALSE.
process_stuck Specify TRUE or FALSE to indicate whether to run stuck processes. Defaults to FALSE.
Example Background Engine Looping Scripts

For the standalone version of Oracle Workflow you can use one of two example scripts to repeatedly run the background engine regularly.

The first example is a sql script stored in a file called wfbkg.sql and is available on your server in the Oracle Workflow admin/sql subdirectory. To run this script, go to the directory where the file is located and type the following command at your operating system prompt:

sqlplus <username/password> @wfbkg <min> <sec>

Replace <username/password> with the Oracle database account username and password where you want to run the background engine. Replace <min> with the number of minutes you want the background engine to run and replace <sec> with the number of seconds you want the background engine to sleep between calls.

The second example is a shell script stored in a file called wfbkg.csh and is available on your server in the Oracle Home bin subdirectory. To run this script, go to the directory where the file is located and type the following command at your operating system prompt:

wfbkg.csh <username/password>

Replace <username/password> with the Oracle database account username and password where you want to run the background engine.


         Previous  Next          Contents  Index  Glossary