Siebel Business Process Framework: Workflow Guide > Administering Workflow Policies > About Workflow Policy Administration >

Executing a Workflow Policy with Workflow Monitor Agent


This topic includes the following topics:

About Workflow Monitor Agent

Workflow Monitor Agent checks when the conditions of a workflow policy is met, and executes actions once conditions are met. To execute your workflow policies, you must start Workflow Monitor Agent. You start and stop the Workflow Monitor Agent task in the Administration-Server views.

Table 72 describes some of the database tables involved with workflow policies.

Table 72. Description of Database Tables Involved with Workflow Policies
Table Name
Description

S_ESCL_REQ

Escalation request. This table holds the potential matching requests caused by applications. For more information, see About the S_ESCL_REQ Table.

S_ESCL_STATE

Escalation state. This table holds the time-based policy matches.

S_ESCL_ACTN_REQ

Escalation action request. (Optional) This table holds the requests to execute actions. This is only used if Use Action Agent is set to TRUE.

S_ESCL_LOG

Escalation log. This table holds a history of base table rows that have matched policies.

What Workflow Monitor Agent Does

Workflow Monitor Agent executes several server processes that monitor the Siebel database. Tasks performed by Workflow Monitor Agent include:

  • Checks the S_ESCL_REQ table to see when the conditions of a policy are met.
  • Monitors policies within a single group.

    You can only run one workflow monitor agent process against a specific group at one time. You can run multiple workflow monitor agent processes at the same time, but they must be against different groups. If you run two workflow monitor agent processes against the same group, deadlocks occur.

  • Generates requests for workflow action agent in the S_ESCL_ACTN_REQ table. This occurs if you set Action Agent to True.
  • Purges requests from the S_ESCL_REQ table after processing. When a database trigger is activated because a workflow policy condition is met, a record is inserted into the Escalation Request table, S_ESCL_REQ. Workflow Monitor Agent, Workmon, evaluates the request against the rules set up by the policies in the workflow policy group.

If you set Action Agent to True, and if Workmon determines that the request in the S_ESCL_REQ table has no duration defined in the policy, Workmon takes direct action and logs an entry into the S_ESCL_LOG table or sends it to the S_ESCL_ACTN_REQ table.

If Workmon determines that the request has a time element that must be met, the request is sent to the S_ESCL_STATE table along with the expiration time. The request stays in the S_ESCL_STATE table until the expiration time is met, or the request is removed because the conditions of the policy are no longer met. Workmon evaluates each of the requests that remains in the S_ESCL_STATE table for a time duration match or to determine if the condition still matches in the S_ESCL_STATE table. If you set Action Agent to True, then as each match occurs WorkMon takes direct action and logs an entry into the S_ESCL_LOG table or sends it to the S_ESCL_ACTN_REQ table.

NOTE:  If a workflow policy has a specified duration, the duration time is calculated from the time WorkMon detects that the row is in violation of the policy, not from the time the row was inserted into the S_ESCL_REQ table. For example, if you create a policy and set the duration as one week, but then WorkMon is not started until several days after Generate Triggers is run, the policy action fires one week from when WorkMon is started, not one week from when the policy is created or Generate Triggers is run.

When the request for an action is made to the S_ESCL_ACTN_REQ table, Workflow Action Agent executes the action and logs an entry into the S_ESCL_LOG table.

About S_ESCL_REQ.REQ_ID

S_ESCL_REQ.REQ_ID can hold up to 9 digits, so the maximum value allowed is 999,999,999. Because the S_ESCL_REQ_S sequence does not have an upper boundary, the sequence for S_ESCL_REQ.REQ_ID can potentially generate a number greater than the maximum of 9 digits allowed, causing an overflow. To avoid this, it is recommended you perform one of the following actions:

  • Use a database tool to increase the column size.
  • Use a database tool to reset the S_ESCL_REQ_S sequence.

As a separate issue, you might encounter a message similar to Status: Deleting requests ([a numeric identifier]).

This message does not indicate the number of rows WorkMon is deleting. The numeric identifier indicates the REQ_ID from S_ESCL_REQ, which is generated by the database to uniquely number the rows in the database. For example, the ways in which REQ_ID is generated include:

  • From the Sequence object in an Oracle database.
  • From the identity column in an MS SQL Server database.
  • From the UDF (User Defined Function) in a DB2 database.

There is no correlation between REQ_ID and the number of rows in S_ESCL_REQ.

Checking Modifications Into the Local Database

The Workflow Monitor Agent and Workflow Action Agent read workflow configurations from the server database. If you use Siebel Tools to modify a workflow policy object, column, or program in the local database, then you must check these objects into the server database. Otherwise, workflow monitor agent and workflow action agent have no knowledge about these modifications.

Also, you should restart workflow monitor agent and workflow action agent after modifying a workflow policy object, column, or program through Siebel Tools, or after modifying a workflow action through the workflow administration views in the Siebel client.

If you do not restart workflow monitor agent and workflow action agent, the modifications do not take effect until policies are reloaded, as specified in the Reload Policy parameter. Since the Reload Policy parameter is set to 600 seconds by default, in most cases 10 minutes elapse before the modifications take effect if you do not perform a restart.

It is not necessary to restart the Workflow Process Manager when modifying a workflow process. For more information, see Modifying a Workflow Process.

Using Workflow Monitor Agent

Before you start workflow monitor agent, you must create a separate server component definition for each workflow monitor agent task. You start workflow monitor agent from the server manager command-line interface.

Replication and Workflow Monitor Agent

Within the entire enterprise architecture of a Siebel deployment, there can be only one workflow monitor agent monitoring a particular workflow group.

For example, a regional node can be running a workflow monitor agent that monitors a group called Group 1. Meanwhile, in the headquarters, there is another WorkMon running, which monitors a group called Group 2. In this way, the organization is able to run workflow policies where needed, while working with the restriction of one WorkMon for one group. You cannot run more than one instance of workflow monitor agent and workflow action agent for a particular workflow group. However, you are allowed to have multiple workflow monitor agent and workflow action agent processes for different groups running at the same time.

Starting Workflow Monitor Agent

This topic describes procedures you perform when using workflow monitor agent. To start this predefined component, you must first create a new workflow monitor agent component definition.

In releases prior to Siebel version 7.0, you can start workflow monitor agent from the Server Tasks view in the Server Manager user interface. This is no longer the case. Starting with Siebel version 7.0, you must start workflow monitor agent from the Server Manager command-line interface.

To create a new workflow monitor agent Component Definition

  1. Navigate to Administration-Server Configuration > Enterprises > Component Definitions.
  2. In the Component Definitions list applet, create a new record using values described in the following table:
    Field
    Description

    Name

    (Name of the component.)

    Component Type

    [Workflow Monitor Agent]

    Component Group

    (Choose an existing component group)

    Description

    (Description of the component)

    Alias

    (Alias for the component. The alias cannot contain blank spaces.)

  3. Save the record.
  4. In the Component Parameters list applet, choose the Group Name parameter record then enter the name of the Workflow Policy Group for which this component processes requests.
  5. (Optional) Make additional changes to the component parameters.

    For more information, see Workflow Monitor Agent Command-Line Interface Parameters.

  6. In the Component Parameters list applet, choose the Default Tasks parameter record then set the Value to 1.

    This component automatically starts up and shuts down with the Siebel Server.

    Do not set Default Tasks to a value greater than 1. Setting Default Tasks to a value greater than 1 can cause undesirable behavior, such as multiple tasks starting for the same workflow group.

  7. In the Component Definitions list applet, choose Enable Component Definition from the applet menu.

    The definition state changes from Creating to Active.

  8. Stop then restart the Siebel Server so that the component definition takes effect.

NOTE:  Whenever you make a change to a component parameter, the component must be stopped and restarted for the changes to take effect. Also, you must define a Workflow Monitor Agent component definition for each Workflow Policy Group.

To start workflow monitor agent using the server manager command-line interface

  1. Start the server manager by entering the following into the Server Manager CLI:

    srvrmgr /g <gateway server address> /s <Siebel Server name> /e <enterprise server name> /u <server administrator username> /p <server administrator password>

  2. Start a new Workflow Monitor Agent task in background mode by entering:

    start task for component WorkMon with SleepTime=<time>,GroupName=<group name>

  3. (Optional) Start a new Workflow Monitor Agent task to run in batch to process a Batch policy by entering:

    start task for component WorkMon with GroupName=<group name>, BatchMode=Y

You must create a separate server component definition for each Workflow Monitor Agent task.

CAUTION:  If a Workflow Process Manager task fails, and more tasks are started that also fail, then Workflow Monitor Agent exits with error after only one violation. This can result in Workflow Monitor Agent starting more, unneeded tasks when the WfProcMgr task fails. To avoid this condition stop, then restart wfprocmgr.

For more information, see Workflow Monitor Agent Command-Line Interface Parameters. For more information on using the Siebel Server Manager Command-line Interface, see Siebel System Administration Guide.

To stop or restart a workflow monitor agent Component

  1. In the Siebel client, navigate to Administration-Server Management > Components.
  2. Choose the component, then click Shutdown or Startup.

NOTE:  When you make changes to the parameters of the component, the component must be stopped and restarted for the changes to take effect. Also, you must define a Workflow Monitor Agent component definition for each Workflow Policy Group.

Workflow Monitor Agent Command-Line Interface Parameters

Table 73 describes parameters that can be set by using the Workflow Monitor Agent command-line interface.

Table 73. Description of Parameters for WorkMon Command-Line Interface
Parameter Name
Display Name
Usage
Default Value

ActionAgent

Use Action Agent

Specify whether the Action Agent is automatically run with Monitor Agent.

If set to FALSE (the default setting), the Workflow Action Agent server component starts within Workflow Monitor Agent, and actions are then executed by Workflow Monitor Agent.

Several conditions apply when configuring Use Action Agent. For more information, see Setting the Use Action Agent Parameter

FALSE

ActionInterval

Action Interval

Define the action execution interval in seconds.

This argument determines when actions for a given policy are executed again on a given base table row. The purpose of this argument limits the number of times actions are executed if a row keeps going in and out of a matching condition.

In other words, if the same record repeatedly violates the same policy before the action interval expires, the record is removed from the S_ESCL_REQ table and the action is not performed again.

Note: The default is 3600 seconds. If this parameter is used, the value must be greater than 0 (zero) or unexpected behavior can result.

3600

BatchMode

Processes the batch policies

Specify whether Monitor Agent is running in batch mode.

When the value is set to TRUE, only the policies that have the Batch flag set to TRUE are evaluated. When FALSE, only the policies that have the Batch flag set to FALSE are evaluated.

Note that when starting with BatchMode set to TRUE, Workflow Monitor Agent is run once. That is, it processes records in the table then exits.

FALSE

CheckLogCacheSz

Cache size of Policy violations

Define the number of policy violations to store in cache.

This parameter determines how many violated policies can be stored in the cache. Based on the presence of the ROW_ID and RULE_ID in the map/cache, the cache determines whether or not an action is already initiated.

The Workflow Monitor checks S_ESCL_LOG for policy violations for the same BT_ROW_ID and RULE_ID.

100

DeleteSize

Request delete size

Define the number of records to commit at a time.

The minimum is 1. If Workflow Monitor encounters deadlocks, you can reduce the default to 125 with minimal performance degradation. Note: to avoid call stack errors, do not set the Request Delete Size value to zero.

500

GenReqRetry

Number of seconds to retry

Define the number of seconds to retry sending a Generic Request message.

120

GroupName

Group Name

Required. Define the workflow policy group that Monitor Agent works on.

(This cell is intentionally empty.)

IgnoreError

Ignore errors

Specify whether to ignore errors while processing requests.

By default, the Workflow Monitor and Action agents do not ignore errors that occur while processing the requests. If Ignore Errors is set to TRUE and an error is encountered, the agent processes log the error condition, delete the request, then continue working. By setting this argument to FALSE, the agent processes exit on an error and send an email message to the mail ID specified by the Mailing Address argument.

When running Workflow with Ignore Errors=TRUE, note that valid errors are ignored. Whereas, if Ignore Errors is set to FALSE, the agent stops and exits with the error.

NOTE:  It is recommended that you set Ignore Errors to FALSE so that valid errors are not ignored.

FALSE

KeepLogDays

Number of days to keep violation information

Define the number of days worth of violation information to be retained.

Sets the number of days log information is stored. Log information older than the number of days set is automatically removed. This value can be set to 0 to prevent the purging of this log information.

For more information, see KeepLogDays Parameter and Workflow Monitor Agent.

30

LastUsrCacheSz

Cache size of last user information

Define the number of last user information items to cache.

When executing actions, the information about the last user to modify the base table row is available as a token substitution in the program arguments. By caching this information in the server, the throughput performance of executing actions can potentially increase.

100

MailServer

Mail Server

Define the name of email server to send notification of abnormal termination.

(This cell is intentionally empty.)

MailTo

Mailing Address

Define the mail address to review notification of abnormal termination.

Mail to [mail ID] if a Workflow Agent process exits with an error condition. An error can be caused by the failure of an action to execute, invalid object definitions, and so forth.

(This cell is intentionally empty.)

NumRetries

Number of Retries

Define the number of retries for recovery.

This parameter works with the Retry Interval and Retry Up Time parameters to reconnect MTS or Siebel Server components to the database if database connectivity is lost.

10000

ReloadPolicy

Reload Policy

Define the policy reload interval in seconds.

This argument defines the frequency that policies are reloaded into the engine. This allows changes to be made on the screens and with the Generate Triggers component. The engine acts on the changes within some time frame.

The default is 600 seconds.

600

Requests

Requests Per Iteration

Define the maximum number of requests read for each iteration.

This controls the maximum number of requests WorkMon reads from the requests queue within one iteration. Between iterations WorkMon deletes processed requests from the requests queue and commits, optionally reloads policies from the database, checks for shutdown request, and optionally sleeps. In other words, you can think of the Requests Per Iteration parameter as a way to control the maximum amount of work WorkMon performs before taking these steps between iterations.

5000

Sleep Time

Sleep Time

Define the time in seconds that the Workflow Agent process sleeps after it has polled for events and fulfilled obligations to notify.

Once the Workflow Agent process has finished its obligations, the Workflow Agent process stops polling for the time period set by the sleep interval. This parameter affects both the performance of the Workflow Agent process and the responsiveness of the application server.

For more information, see Sleep Time Parameter and Workflow Monitor Agent.

60

Setting the Use Action Agent Parameter

Table 74 describes conditions in which to set the Use Action Agent parameter.

Table 74. Description of Setting Use Action Agent
When to Set Use Action Agent to False
When to Set Use Action Agent to True

In most cases, it is recommended you start Workflow Monitor Agent with Use Action Agent set to False, the default setting.

This way, Workflow Monitor Agent monitors conditions as well as executes actions. Some possible actions that are executed include workflow processes, workflow programs, and email programs.

If you start Workflow Action Agent to execute actions when Use Action Agent is True, and the action is executing a workflow process, you might encounter access violation errors and Workflow Action Agent can fail.

It is recommended you start Workflow Monitor Agent with Use Action Agent set to True when executing an action that involves email consolidation.

If you are using email consolidation and Use Action Agent is set to True, then you must start Workflow Action Agent separately.

Sleep Time Parameter and Workflow Monitor Agent

You can increase the Sleep Time to adjust the processing frequency, because the WorkMon task waits for more requests when it goes to sleep. By default, the task sleeps every one minute (the default setting is 60 seconds). The WorkMon task wakes up, processes requests (if there are any), then goes back to sleep. WorkMon does this repeatedly.

KeepLogDays Parameter and Workflow Monitor Agent

If the Number of Days to Keep Violation Information parameter is set to 0, then WorkMon does not purge from S_ESCL_LOG. If you set this parameter to 0, then monitor the size of S_ESCL_LOG, because the size of this table affects performance. Use this parameter judiciously.

Because infrequent cleaning of S_ESCL_LOG can lead to slow performance, decide how often you need to start WorkMon using KeepLogDays, then restart WorkMon with a setting of 0 for this parameter.

Siebel Business Process Framework: Workflow Guide Copyright © 2008, Oracle. All rights reserved.