A brief summary of how a workflow policy works with an example scenario.
Scenario:
An activity must be created for a specific user of the system when another object (for example: an incident) goes to a specific state (for example: resolved)

The first thing to keep in mind is to know how to develop this requirement:
We create a WF that will call a BS to create the activity to users who have the specific position when the incident becomes resolved.
Since by code we cannot control when to execute the process that generates the activity, we will need “something” that triggers this execution: a WorkFlow Policy.
1º- Create the WF Policy
Go to : Administration – Business Processes
Select: Workflow PoliciesCreate a record in the view: “Workflow Policy Detail View”
2º- Create the trigger
Go to Administration – Server Management –> Jobs
Launch the job: Generate Triggers, The “Remove” parameter must be = TRUE (in case there is already a previous job launched)
Include the following parameters in the Work:
EXEC = True
Mode = All
Privilegde User = siebel Privilegde User
Pass = [The corresponding environment]
Remove = TRUE
Once you are in “Status” = Success, launch the job: “Generate Triggers” again, the parameter “Remove” should be = FALSE with the following parameters
EXEC = True
Mode = All
Privilegde User = siebel Privilegde User
Pass = [The corresponding environment]
Remove = FALSE
3º- The workflow policy detects when an incident meets the condition established in the WF Policy created in step 1 (through the database trigger -step 2-)

A record is inserted into table S_ESCL_REQ
BT_ROW_ID: id of the event that has met the conditions (this is the ROW_ID in the Table corresponding to Incidents GROUP_ID: Id of the policy group to which our policy belongs. RULE_ID: Id of the policy that has been triggered. TBL_NAME: Name of the Table corresponding to Incidents
Next, the Workflow Monitor Agent component reads the S_ESCL_REQ table and prepares the actions to be executed by inserting records into the table S_ESCL_STATE
BT_ROW_ID: ID of the event that has met the condicionesEND_TM: date and time at which the acciónRULE_ID will be executed: Id of the policy that has been triggered
STATUS: Execution status (pending, completed)
Finally, when it comes time to execute the action, the Workflow Process Manager will execute that action and save the result in the S_ESCL_LOG
The action in our scenario will be the execution of a WorkFlow that will call the BS which will contain all the logic for the creation of the activity.

