Siebel Business Process Framework: Workflow Guide > Options for Configuring a Workflow Process > Starting a Workflow Process >

Starting a Workflow Process from a Script


You can use Siebel VB or Siebel eScript to start a workflow process from a script. A script can start a workflow process from most locations in a Siebel CRM application or from a program that is external to Siebel CRM. If a workflow process starts from a script, then you can define it to run on the Siebel Server or in the Object Manager. A workflow process that starts from a script runs in Synchronous mode. Note the following:

  • To run a workflow process on the Siebel Server, you configure Siebel CRM to call the Workflow Process Manager (Server Request) service.
  • To run a workflow process in the Application Object Manager, you configure Siebel CRM to call the Workflow Process Manager service.

Starting a Workflow Process from a Script in the Object Manager

The following example script starts a workflow process named My Account Process that starts in the Object Manager:

/ Example: Starting a Workflow Process through scripting
function Invoke_Process()
{
var svc = TheApplication().GetService("Workflow Process Manager");
var Input = TheApplication().NewPropertySet();
var Output = TheApplication().NewPropertySet();
var bo = TheApplication().ActiveBusObject();
var bc = bo.GetBusComp("Account");
var rowId = bc.GetFieldValue("Id");

Input.SetProperty("ProcessName", "My Account Process");
Input.SetProperty("Object Id", rowId);

svc.InvokeMethod("RunProcess", Input, Output);
}

Starting a Workflow Process from a Script That Sends Field Values to Process Properties

The following example script starts a workflow process named My Opportunity Process that starts in the Object Manager. Siebel CRM passes field values to the process properties that are defined in the workflow process:

//Example: Passing Field Values to Process Properties
function Invoke_Process()
{
   var svc = TheApplication().GetService("Workflow Process Manager");
   var Input = TheApplication().NewPropertySet();
   var Output = TheApplication().NewPropertySet();
   var bo = TheApplication().ActiveBusObject();
   var bc = bo.GetBusComp("Opportunity");
   
   var rowId = bc.GetFieldValue("Id");
   var accountId = bc.GetFieldValue("Account Id");
   
   Input.SetProperty("ProcessName", "My Opportunity Process");
   Input.SetProperty("Object Id", rowId);
   
   // Pass the value of the Account Id field to the Account Id process property
   Input.SetProperty("Account Id", accountId);
   
   svc.InvokeMethod("RunProcess", Input, Output);

Using the Server Requests Business Service to Start a Workflow Process from a Script

You can use the Server Requests business service to asynchronously start a workflow process from a script. For more information, see Using the Server Requests Business Service to Start a Workflow Process from a Script.

Siebel Business Process Framework: Workflow Guide Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Legal Notices.