Configuring a Synthetic Event Button for the Save Workflow Process Event
The following procedure describes how to configure a synthetic event button for the save Workflow Process event.
To configure a synthetic event button for the save Workflow Process event
Define a Save button on an applet where Siebel CRM calls the event.
For more information, see Using Siebel Tools.
Set the MethodInvoked property of the button control to reference the Save Workflow Process event.
Use the following script to call the event handler that the Workflow Process uses to handle the button click event. This script also sends the contextual information for the event to the Workflow Process event handler, which is the name of the view where the event occurs. It is not necessary for you to define the event in the Workflow Process:
function WebApplet_PreCanInvokeMethod(MethodName, (&CanInvoke) { var returnValue = ContinueOperation; // Recognize SaveWorkflow event, which is used to save Interactive flow if (MethodName == "SaveWorkflow") { CanInvoke = "TRUE"; returnValue = CancelOperation } return (returnValue); } function WebApplet_PreInvokeMethod (MethodName) { var returnValue = ContinueOperation; try { switch (MethodName) { // Handle SaveWorkflow event. // Call Workflow Process Manager to save the interactive // flow(s) that is waiting in the current view. case "SaveWorkflow": var Inputs = TheApplication().NewPropertySet(); var Outputs = TheApplication().NewPropertySet(); // Event name ("SaveWorkflow"), view name, and the rowId // of the active row of the underlying buscomp are // three required parameters for handling the event Inputs.SetProperty("Event Name", MethodName); var viewName = TheApplication().ActiveViewName(); Inputs.SetProperty("Sub Event", viewName); var bc = this.BusComp (); var bcId = bc.GetFieldValue ("Id"); Inputs.SetProperty("RowId", bcId); var workflowSvc = TheApplication().GetService("Workflow Process Manager"); workflowSvc.InvokeMethod("_HandleSpecialEvent", Inputs, Outputs); returnValue = CancelOperation break; // Add other cases for different custom methods here. } } // end try finally { bc = null; workflowSvc = null; Inputs = null; Outputs = null; } // end finally return(returnValue); } // end function