Saturday, April 27, 2013

Overview of workflow background engine and it is statuses


The Workflow Engine manages all automated aspects of a workflow process for each item. The engine is implemented in server-side PL/SQL and is activated whenever a call to a workflow procedure or function is made. Since the engine is embedded inside the Oracle Database, if the Workflow server goes down for any reason, the Oracle Database is able to manage the recovery and transactional integrity of any workflow transactions that were running at the time of the failure.

Additionally, Workflow engines can be set up as background tasks to perform activities that are too costly to execute in real time.
The Workflow Engine performs the following services for a client application:
  • It manages the state of all activities for an item, and in particular, determines which new activity to transition to whenever a prerequisite activity completes.
  • It automatically executes function activities (execution is either immediate or deferred to a background engine) and sends notifications.
  • It maintains a history of an activity's status.
  • It detects error conditions and executes error processes.
Based on the result of a previous activity, the engine attempts to execute the next activity directly. An activity may have the following status:
  • Active - activity is running.
  • Complete - activity completed normally.
  • Waiting - activity is waiting to run.
  • Notified - notification activity is delivered and open.
  • Deferred - activity is deferred.
  • Error - activity completed with error.
  • Suspended - activity is suspended.

Important: The Workflow Engine traps errors produced by function activities by setting a savepoint before each function activity. If an activity produces an unhandled exception, the engine performs a rollback to the savepoint, and sets the activity to the ERROR status. For this reason, you should never commit within the PL/SQL procedure of a function activity. The Workflow Engine never issues a commit as it is the responsibility of the calling application to commit.
For environments such as database triggers or distributed transactions that do not allow savepoints , the Workflow Engine automatically traps "Savepoint not allowed" errors and defers the execution of the activity to the background engine.
Oracle Workflow components that continue workflow processing asynchronously, such as background engines and the Notification System, do issue commits when appropriate on behalf of the calling application.

1 comment:

  1. Hello Prasad Garu, its nice compilation.. really good.

    ReplyDelete