Wednesday, April 2, 2008

How to invoke a Workflow Process?

Workflow is one of the most commonly used functionality in Siebel. They provide us the way to automate simple and complex business process without much trouble.

Workflows can be invoke in several ways in Siebel.

  • Runtime Events
  • Scripting
  • User Property
  • Workflow Policy

In this post I will be giving example of how to invoke workflow process in different ways.

>> Runtime Events

We can specify runtime event at

Workflow Process: To define a runtime event in the workflow process, follow the steps given below

Select the connecter after the start step as shown below

Siebel Workflow Connector

In the Workflow Step Branch: window below provide the details at which you want to this workflow to execute. For example If I want my workflow to be invoked at write record of Action buscomp then I will enter the following detail

Event Object Type: BusComp
Event Object: Action
Event: Write Record

Runtime Events

>> Administration Runtime

Runtime Events are available in Administration - Runtime Event Screen.

We have all the corresponding events which we find in BusComp, Applet and Application such as WriteRecord, PreWriteRecord, ChangeRecord, and PreQuery etc.

We need to remember one thing here is that Runtime events fire before the corresponding object event.

For example

WriteRecord runtime event for object type BusComp will fire before BusComp WriteRecord event

To call a workflow from Administration Runtime event define a Action Set and Enter the information as shown below

Business Service: Workflow Process Manager
Business Service Method: RunProcess
Business Service Context: “ProcessName”, “Name of workflow”

Even Spaces matter in Business Service Context value after there is a space after comma and then workflow name. Now you can define the event according to your requirement which will call this Action Set

Administration Runtime Events

>> Scripting.

To call a workflow process from scripting you can use the code given below

var svc = TheApplication().GetService(”Workflow Process Manager”);
var Input = TheApplication().NewPropertySet();
var Output = TheApplication().NewPropertySet();
var rowId = this.GetFieldValue(”Id”);
Input.SetProperty(”ProcessName”, “GEAE Activity Approved by SSD Notification”);
Input.SetProperty(”Object Id”, rowId);
Input.SetProperty(”Opportunity Id”, vOppId);
svc.InvokeMethod(”RunProcess”, Input, Output);

Here any property that you set in input property set will be assigned to corresponding process property in the Workflow Process (WFP) as in the above example

Input.SetProperty(”Opportunity Id”, vOppId);

above line of code will result in process property called “Opportunity Id” in WFP to assigned the value of variable vOppId.
>>User Property:

You can use Named Method property on BC to invoke a workflow. Example

Name: Named Method 1
Value: “New Record”, “INVOKESVC”, “Example”, “Workflow Process Manager”, “RunProcess”, “‘ProcessName’”, “Example Wrokflow”, “‘RowId’”, “[Id]”

To see the detail explanation of user property read the following post

>>Workflow Policy:

Workflow Process can also be called from workflow policy. We can Define a workflow policy (WFP) in Administration – Business Process >> Policy.

Steps to create Workflow Policy are not in the scope of this post. We assume here that you have created a workflow policy record and specified appropriate conditions.

In the argument section choose

Argument: Process Name
Value: Workflow Process Name

Hope this helps :)

Page Ranking

Check Page Rank of any web site pages instantly:
This free page rank checking tool is powered by Page Rank Checker service