Siebel Business Process Framework: Workflow Guide > About Workflow Process Design Options > Invoking a Workflow Process >

Example of Invoking a Workflow Process from a Custom Toolbar


This topic gives one example of invoking a workflow process from a custom toolbar. You might use this feature differently, depending on your business model.

To invoke a workflow process from a custom toolbar button

  1. In Siebel Tools, navigate to the Business Services OBLE, then create a new business service object definition using values described in the following table:

    Property

    Value

    Name

    TestTBItem

    Server Enabled

    TRUE

  2. Navigate to the Commands OBLE, then create a new command object definition using values described in the following table:

    Property

    Value

    Name

    TestTBItem

    Business Service

    TestTBItem

    Method

    TestTBItem

    Target

    Server

    If necessary, expose the Command object type in the OE. From the application-level menu choose View > Options, then click the Object Explorer tab. In the Object Explorer Hierarchy window, make sure the Command hierarchy has a check mark. Click OK.

  3. In the Object Explorer, choose the Toolbar object type. In the Toolbars OBLE, query for the HIMain toolbar object definition.

    If the Toolbars object type is not exposed in the Object Explorer, from the Tools application-level menu choose View > Options, click the Object Explorer tab, then click the checkbox next to Toolbar.

  4. In the Object Explorer, expand the Toolbar object type, then choose Toolbar Item.
  5. In the Toolbar Items OBLE, add a new record using values described in the following table:
    Property
    Value

    Name

    TestTBItem

    Command

    TestTBItem

    DisplayName

    TestTB Item

    Type

    Button

    HTML Type

    Button

    Position

    20

  6. In the Siebel client, create a workflow process and make sure it can be run successfully from the process simulator.

    For more information, see Preparing and Using the Process Simulator.

  7. Add the server script below to the business service you created in Step 1.

    NOTE:  The workflow process name you used in Step 6 must be added in the script.

    function Service_PreCanInvokeMethod (MethodName, &CanInvoke)

    {

    if ( MethodName == "TestTBItem" )

    {

    CanInvoke = "TRUE";

    return( CancelOperation );

    }

    return (ContinueOperation);

    }

    function Service_PreInvokeMethod (MethodName, Inputs, Outputs)

    {

    if ( MethodName == "TestTBItem" )

    {

    var input = TheApplication().NewPropertySet();

    var output = TheApplication().NewPropertySet();

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

    input.SetProperty("ProcessName", "<WF Process Name Created in Step 4>");

    svc.InvokeMethod("RunProcess", input, output);

    input = null;

    output = null;

    svc = null;

    return (CancelOperation);

    }

    return (ContinueOperation);

    }

  8. Compile the changes.
  9. Launch the Siebel client.

Your new custom button displays in the custom toolbar. When you click it, the corresponding workflow is invoked.

Siebel Business Process Framework: Workflow Guide Copyright © 2008, Oracle. All rights reserved.