Siebel Business Process Framework: Workflow Guide > Options for Configuring a Workflow Process > Starting a Workflow Process >

Starting a Workflow Process from a Custom Toolbar


The example in this topic starts a workflow process from a custom toolbar.

To start a workflow process from a custom toolbar

  1. If necessary, display the Command object type and the Toolbars object type in the Object Explorer.

    For more information, see Displaying Object Types You Use to Develop a Workflow Process.

  2. In Siebel Tools, navigate to the Business Services list, and then create a new business service using values from the following table.

    Property

    Value

    Name

    TestTBItem

    Server Enabled

    TRUE

  3. Navigate to the Commands list, and then create a new command using values from the following table.

    Property

    Value

    Name

    TestTBItem

    Business Service

    TestTBItem

    Method

    TestTBItem

    Target

    Server

  4. In the Object Explorer, click Toolbar, and then query the Name property in the Toolbars list for the following value:

    HIMain

  5. In the Object Explorer, expand the Toolbar tree, and then click Toolbar Item.
  6. In the Toolbar Items list, add a new record using values from the following table.
    Property
    Value

    Name

    TestTBItem

    Command

    TestTBItem

    DisplayName

    TestTB Item

    Type

    Button

    HTML Type

    Button

    Position

    20

  7. In the Siebel client, define a workflow process and make sure it can run successfully from the process simulator.

    For more information, see Preparing to Use the Process Simulator.

  8. Add the following server script to the business service that you defined in Step 2. You must use the name of the workflow process that you use in Step 7:

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

    }

  9. Compile and test your changes in the Siebel client.

    Make sure Siebel CRM displays you new custom button in the custom toolbar. Click it to make sure the correct workflow process starts.

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