Siebel Business Process Framework: Workflow Guide > Reference Materials for Siebel Workflow > Predefined Workflow Policy Programs >

Examples of Predefined Workflow Policy Programs


This topic includes examples of using predefined workflow policy programs. It includes the following topics:

The examples use predefined workflow policy programs included with Workflow Policies. These programs can be viewed in Siebel Tools' Object Explorer by choosing the Workflow Policy Program object type.

This topic also includes Predefined Workflow Policy Programs for Siebel Marketing.

Example of a Predefined Workflow Policy Program That Manages SR Close Date

This topic gives one example of using a predefined workflow policy program to automatically close SRs that have been marked as resolved but not closed. You might use this feature differently, depending on your business model.

Using this program, you can define a policy such that if a Service Request has an activity of type Resolution, and the SR is open for more than five days, the SR close date is changed to today's date.

When the policy triggers the workflow policy program, the program enters the current system date into the Close Date field of the Service Request record.

Table 95 describes arguments for the Change SR Close Date to Today program.

Table 95. Description of Program Arguments to Change SR Close Date to Today
Argument Name
Comment

Primary ID

Contains the row ID of the Service Request record meeting the policy condition.

Primary Table

Operation Type

Specifies the table (S_SRV_REQ) and what action is to take place (Update).

Sql Statement

select sys_extract_utc(current_timestamp) from &Table_Owner.S_DUAL

This statement calls the Siebel function now() to obtain the current date and uses the table &Table_Owner.S_DUAL to hold the value temporarily. The S_DUAL table is used to hold temporary values.

Math functions can also be performed. For example, the SQL statement select {fn now()}+7 from &Table_Owner.S_DUAL returns the current date plus seven days.

Different RDBMS have different formats for the same function. For example, in MS SQL, the function GetDate() is used to return the current date.

NOTE:  The column name length must be less than 30 characters. For example, the following statement violates this rule because it is more than 30 characters:
TO_CHAR(CREATED,'dd month yyyy','NLS_DATE_LANGUAGE=FRENCH').

Sql Statement Outputs

The Today variable obtains its value from the SQL statement.

New Close Date (Column)

Specifies the column in the record to be updated (ACT_CLOSE_DT).

New Close Date

Specifies the field to be updated to the value of Today.

Update Row ID

The row ID of the record you need to update. This is the same as the value of the Primary ID.

Example of a Predefined Workflow Policy Program That Assigns an SR Owner

This topic gives one example of using a predefined workflow policy program to automatically assign an SR that has not yet been assigned. You might use this feature differently, depending on your business model.

If an open service request is not assigned for a certain length of time, this workflow policy program can be used to assign, that is change the owner, of a service request to the expert in the area of the specific service request. This allows the correct people to see the incoming service request and assign it appropriately.

This workflow policy program allows you to choose a new owner from a picklist and put it into the field of the Service Request record matching the policy condition.

Table 96 describes arguments for the Change SR Owner program.

Table 96. Description of Program Arguments to Change SR Owner
Argument Name
Comment

Primary ID

Contains the row ID of the Service Request record meeting the policy condition.

Primary Table

Operation Type

Specifies the S_SRV_REQ table and to take the Update action.

New Owner (Column)

Specifies to update the Owner_EMP_ID field in the record to be updated.

New Owner

Indicates that a picklist is displayed for assigning a new owner.

The picklist is defined by columns picklist set to Picklist SR Owner, Source set to ID, and Applet set to SR Owner Pick Applet.

Visible

When checked, indicates the picklist is visible to the user.

Example of a Predefined Workflow Policy Program That Escalates an SR

This topic gives one example of using a predefined workflow policy program to assign an open SR to a manager. You might use this feature differently, depending on your business model.

If the service request is not closed within a specific duration of time, assign the service request to the owner's manager. This allows a proper response time to service calls.

Tasks performed by this workflow policy program include:

  • Uses the Primary ID as input into a SQL statement.
  • Uses a query SQL statement to retrieve the current value of the field Manager.
  • Sets the New Owner field to default to the current value of Manager.
  • Allows the user to update the New Owner field optionally through a picklist.

Table 97 describes arguments for the Change SR Owner to Manager program.

Table 97. Description of Program Arguments to Change SR Owner to Manager
Argument Name
Comment

Primary ID

Contains the row ID of the Service Request record meeting the policy condition.

Primary Table

Operation Type

Specifies the S_SRV_REQ table and to take the Update action.

New Owner (Column)

Specifies to update the Owner_EM_ID field in the record to be updated.

New Owner

Indicates that a picklist is displayed for assigning a new owner.

Sql Statement

Policy Monitor requires definitions that are contained in the workflow policy object, workflow policy components, and workflow policy columns. In working and coding a workflow policy program using Siebel tables, explicitly joining the base table through SQL code is required.

This example SQL statement joins four tables, giving access to data from these four tables:

SELECT MGRPOS.PR_EMP_ID FROM
&TABLE_OWNER.S_POSTN POS, &TABLE_OWNER.S_EMPLOYEE EMP, &TABLE_OWNER.S_POSTN MGRPOS, &TABLE_OWNER.S_SRV_REQ SR
WHERE
SR.ROW_ID = ?
AND
SR.OWNER_EMP_ID = EMP.ROW_ID
AND
EMP.PR_POSTN_ID = POS.ROW_ID
AND
POS.PAR_POSTN_ID = MGRPOS.ROW_ID

Considerations to weigh for this example include:

  • Only one field is retrieved.
  • SR.ROW_ID = ? uses a question mark as a placeholder for inputting the value of the Primary ID. The Primary ID is substituted for the question mark.

Sql Statement Inputs

Set to the value of Primary ID.

Sql Statement Outputs

Set to the value of Manager.

Example of a Predefined Workflow Policy Program That Sends a Quote by Using a Page

This topic gives one example of using a predefined workflow policy program to automatically send a quote depending on the relationship between the quote's value and the revenue value of opportunity to which the quote references. You might use this feature differently, depending on your business model.

If a created quote has a value less than some percentage of the opportunity's revenue, it is considered heavily discounted, then send a page to a designated employee.

This workflow policy program sends out a pager message. The SQL statement is configured for the different RDBMS syntax.

There are four SQL statements, one default and three specific to an RDBMS: Informix, Oracle, and SQL Anywhere.

The SQL Statement default query retrieves five values from four tables using an outer join specified by *=:

select
q.QUOTE_NUM, q.REV_NUM, o.NAME, a.NAME, a.LOC
from
&Table_Owner.S_DOC_QUOTE q, &Table_Owner.S_ORG_EXT a, &Table_Owner.S_OPTY o
where
q.ROW_ID = ? and q.OPTY_ID *= o.ROW_ID and q.TARGET_OU_ID *= a.ROW_ID

The SQL statement Oracle query retrieves five values from four tables using an outer join specified by (+):

select
q.QUOTE_NUM, q.REV_NUM, o.NAME, a.NAME, a.LOC
from
&Table_Owner.S_DOC_QUOTE q, &Table_Owner.S_ORG_EXT a, &Table_Owner.S_OPTY o
where
q.ROW_ID = ? and q.OPTY_ID = o.ROW_ID (+) and q.TARGET_OU_ID = a.ROW_ID (+)

The SQL Statement is required. However, if an SQL Statement with <SQL style> is present, this takes precedent over SQL Statement.

The SQL statement outputs define five variables to hold the result of the query statement. These variables are Quote Number, Revision, Opportunity, Account, and Site.

In an outer join, there might not be an associated table, in which case the variable is set to null.

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