Siebel Business Process Framework: Workflow Guide > Example Workflow Processes That Call a Business Service > Examples That Use the Server Requests Business Service >

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


The following example code uses the Server Requests business service to start a workflow process from a script and passes field values to process properties:

//Example: Passing Field Values to Process Properties and start workflow from script using the Server Request BS

//function Invoke_Process()

{

var svc = TheApplication().GetService("Workflow Process Manager(Server Request)");

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);

}

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