Siebel Business Process Designer Administration Guide > For Developers: Understanding How Workflow Processes Are Designed > Building Interactive Workflow Processes >

Creating Synthetic Event Buttons to Control User Navigation


A synthetic event is a specialized run-time event that is dedicated to controlling workflow navigation. To control the way a user navigates through the Siebel application, you can create buttons on applets within views and then associate synthetic events with the buttons. For example, in the Account Note view of the Siebel application you are configuring, there is an Account Entry Applet on which you want to include buttons for Back, Next, and SaveWorkflow synthetic events so that the user can move forward or backward from the Account Note view, or suspend an interactive workflow process, and then return later to resume the workflow.

After you have created the buttons, you associate methods within the interactive workflow process—for example, with Back and Next synthetic events, you associate methods to outgoing branches on the User Interact step. You set the synthetic event method name in the MethodInvoked field of the button controls.

The name of the synthetic event method depends on the synthetic event, taking one of the following formats:

  • FrameEventMethodWFNext and EventMethodWFNext. This event moves the user forward in the interactive workflow.

    NOTE:  You can also give the method name a prefix of "BF," as in "FrameEventMethodWFBFxxxx." Use this optional "BF" prefix to define backward and forward behavior of the synthetic event. A synthetic event with this prefix can be used to resume a workflow process from a step that is different from the current step at which the workflow process is waiting.

  • FrameEventMethodWFBack and EventMethodWFBack. This event moves the user backward in the interactive workflow.
  • SaveWorkflow. This event suspends (saves) the interactive workflow and makes it appear in the user's Inbox.
  • ResumeLastIntFlow. This event resumes the last executed interactive workflow.

    NOTE:  ResumeLastIntFlow is different from the other events in that it is not tied to any specific workflow process and can be invoked from anywhere in the Siebel application. That is, the button corresponding to this event can be put in any applet, including the task bar where the Site Map icon is located (the recommended place for this button).

This topic is organized as follows:

To create synthetic event buttons for Next and Back events

  1. In Siebel Tools, select a view to which a User Interact step navigates the user.
  2. Configure a Next button or a Back button on an applet where the event is to be triggered. For more information, see Using Siebel Tools.
  3. Specify the MethodInvoked property of the button control as the name of the associated event, for example, FrameEventMethodWFBack for backward navigation.
  4. In the Palette Designer, associate the applet type run-time event, for example, FrameEventMethodWFBack, to the outgoing branches of the User Interact step in the workflow process that will receive the event. Assign the event the following properties:
    • Event Type = Applet
    • Event Obj = AppletName
    • Event = InvokeMethod
    • Sub Event = [method name, for example, FrameEventMethodWFBack]

NOTE:  You do not have to manually create buttons for each applet. You can copy any button you have created to other applets by using the Applet Comparison capability in Siebel Tools. Also, if you add the applet button controls to the HTML Model Controls applet, when you create new applets with the New Applet Wizard or the conversion process, you can then select all the Workflow-related method buttons.

To create synthetic event buttons for the SaveWorkflow event

  1. In Siebel Tools, select a view to which a User Interact step navigates the user.
  2. Configure a Save button on an applet where the event is to be triggered. For more information, see Using Siebel Tools.
  3. Specify the MethodInvoked property of the button control as the name of the associated event, SaveWorkflow.
  4. Use the script that follows to invoke the Workflow event handler to handle the button-click event, and passes the Workflow event handler the event's contextual information, that is, the name of the view where the event occurs.

    NOTE:  The event does not need to be defined in the workflow process definition.

    function WebApplet_InvokeMethod (MethodName)

    {

    return (ContinueOperation);

    }

    function WebApplet_PreCanInvokeMethod (MethodName, &CanInvoke)

    {

    // Recognize SaveWorkflow event, which is

    // used to save Interactive flow

    if (MethodName == "SaveWorkflow")

    {

    CanInvoke = "TRUE";

    return (CancelOperation);

    }

    return (ContinueOperation);

    }

    function WebApplet_PreInvokeMethod (MethodName)

    {

    // Handle SaveWorkflow event.

    // Call Workflow Process Manager to save the interactive

    // flow(s) that is waiting in the current view.

    if (MethodName == "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 = BusComp ();

    var bcId = bc.GetFieldValue ("Id");

    Inputs.SetProperty("RowId", bcId);

    var workflowSvc = TheApplication().GetService("Workflow Process Manager");

    workflowSvc.InvokeMethod("_HandleSpecialEvent", Inputs, Outputs);

    return (CancelOperation);

    }

    return (ContinueOperation);

    }

To create synthetic event buttons for the ResumeLastIntFlow event

  1. In Siebel Tools, select a view to which a User Interact step navigates the user.
  2. Configure a Resume button on an applet where the event is to be triggered. For more information, see Using Siebel Tools.
  3. Specify the MethodInvoked property of the button control as the name of the associated event, ResumeLastIntFlow.
  4. Use the script that follows to invoke the Workflow event handler to handle the button-click event, and passes the Workflow event handler the event's contextual information, that is, the name of the view where the event occurs.

    NOTE:  The event does not need to be defined in the workflow process definition.

    function WebApplet_InvokeMethod (MethodName)

    {

    return (ContinueOperation);

    }

    function WebApplet_PreCanInvokeMethod (MethodName, &CanInvoke)

    {

    if (MethodName == "ResumeLastIntFlow")

    {

    CanInvoke = "TRUE";

    return (CancelOperation);

    }

    return (ContinueOperation);

    }

    function WebApplet_PreInvokeMethod (MethodName)

    {

    // Call Workflow Process Manager to resume the last-executed interactive flow

    if (MethodName == "ResumeLastIntFlow")

    {

    var Inputs = TheApplication().NewPropertySet();

    var Outputs = TheApplication().NewPropertySet();

    var workflowSvc = TheApplication().GetService("Workflow Process Manager");

    workflowSvc.InvokeMethod("_ResumeLastInteractFlow", Inputs, Outputs);

    return (CancelOperation);

    }

    return (ContinueOperation);

    }

Siebel Business Process Designer Administration Guide