Siebel Business Process Designer Administration Guide > For Developers: Understanding How Workflow Processes Are Designed > Invoking Workflow Processes >
Example: Invoking a Workflow from a Script to Pass Field Values to Process Properties
The following is a similar example script that invokes a workflow process called My Opportunity Process. In this example, the process is invoked in the object manager and additional field values are passed to process properties 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);
|