Siebel Business Process Framework: Workflow Guide > Example Workflow Processes >

Example Workflow Process That Attaches an Activity Plan to an Opportunity


This topic gives one example of using workflow to attach an activity plan to an Opportunity record. You might use this feature differently, depending on your business model. It includes the following topics:

In this example, you define a workflow that creates a child activity plan for an opportunity record, then navigates the user to a view that displays the new plan. The workflow then waits for the user to enter more data and save changes before continuing.

You use the Process Simulator and the Siebel client to test the workflow.

Creating the New Workflow Process

This topic describes how to create a workflow process that attaches an activity plan to a large opportunity. You create a new workflow process object definition, define step properties, then validate the workflow.

To create a new workflow process object definition

  1. In Siebel Tools, create a new workflow process object definition using values described in the following table:
    Property
    Value

    Process Name

    Create Plan

    Business Object

    Opportunity

    Workflow Mode

    Interactive Flow

    To view an example, see Creating a New Workflow Process Object Definition.

  2. In the Workflow Processes OBLE, right-click the new workflow process object definition, then choose Edit Workflow Process.
  3. Add steps and connectors until your workflow process resembles the workflow illustrated in the following diagram:

    For more information, see About Workflow Process Steps and Connectors, and Diagramming a Workflow Process.

Next, define the workflow step properties.

To define workflow step properties

  1. In the Process Designer canvas, click the Add Activity Plan to Oppty step.
  2. In the Properties window, define the business component to use for the operation and the operation to be performed by entering values described in the following table:

    Property

    Value

    Business Component

    Activity Plan

    Operation

    Insert

    When you perform an Insert operation on a business component, you must supply a value for required fields in the business component. In particular, to insert a new activity plan, you must provide the name of the activity plan template.

  3. With the Add Activity Plan to Oppty step still chosen, in the MVPW add a new input argument using values described in the following table:

    Field Name

    Type

    Value

    Template

    Literal

    A valid activity template name, such as Introductory Sales Call.

    For more information, see About Process Properties.

  4. In the Process Designer canvas, choose the Display Activity Plan step.
  5. Use the Properties window to define which view is displayed for the Display Activity Plan user interact step. Use values described in the following table:

    Property

    Value

    User Interact View

    Opportunity Activity Plan

  6. Click the connector located between the Display Activity Plan step and the End step, then define properties in the Properties window using values described in the following table:

    Property

    Value

    Event Object Type

    BusComp

    Event

    WriteRecordUpdated

    Event Object

    Activity Plan

    Type

    Condition

    Defining a run-time event signals the end of the Display Activity Plan user interact step. This is achieved by defining a conditional branch emanating from the Display Activity Plan step.

    For this example, you need to wait for the user to make and save a change to the Activity Plan record before continuing the workflow process. WriteRecordUpdated is the run-time event that signals this change.

    For the Event and Event Object picklists to populate correctly for this example, you must specify the Event Object Type first.

Next, test the workflow process.

Testing the Workflow Process

In this topic, you validate and simulate the workflow process you created in Creating the New Workflow Process.

Because this example workflow is based on the Opportunity business object and the workflow attempts to add an activity plan to an existing opportunity, you must specify the row Id for a specific opportunity to allow the Process Simulator to execute the workflow's logic.

Before you can test your workflow process, you create an opportunity that matches the test criteria. You create this opportunity, and note the opportunity record's row ID. This row ID is then used in the workflow process properties to run the test.

To prepare example data for the simulation

  1. Launch the Siebel client, logging in as SADMIN/SADMIN to the Sample database.
  2. Navigate to the Opportunities list applet.
  3. Choose an Opportunity record, right-click, then choose About Record.
  4. Note the value of the row ID in the Row # field, then click OK to close the About Record dialog box.
  5. In Siebel Tools, in the MVPW, find the Object Id process property, then set the property's Default String field to the Opportunity row Id you identified in Step 4.

    If the MVPW is not visible, from the application-level menu choose View > Windows > Multi Value Property Window.

  6. Next, you test the workflow process.

To test the workflow process

  1. Validate then simulate the workflow process.

    For more information, see Process of Testing a Workflow Process.

  2. Once you reach the user interact step in the simulation, use the Siebel client to make a change to the Activity Plan, then save your changes. For example, change values in the Planned Start Date field or the Description field.

    Note that you cannot reach the End step by clicking the Next button once the Opportunity Activity Plan view is displayed in the Siebel client. Since you specified a condition on the branch, you must satisfy the condition to allow the workflow logic to proceed to the End step.

  3. Acknowledge the message that displays at the end of the workflow.

    When the last step is reached, the Siebel client displays a message reporting Simulation terminated! Please check the Watch window for details.

  4. Enter Alt-Tab to return to Siebel Tools, then click Next to finish the End step.
  5. In the Watch window, view the Simulator Status field.

    If Simulation ended successfully is displayed, the workflow process ended without error.

Next, you configure an invocation method for the workflow process.

Configuring an Invocation Method for the Workflow Process

Now that you have built and simulated a workflow process, you must decide where and how it is invoked from the user interface. For this example, you add a button to the Opportunity List applet to invoke the workflow. For more information, see Invoking a Workflow Process.

To add a new button to the Opportunity list applet and configure it to invoke a new event

  1. In Siebel Tools, choose the Applet object type in the Object Explorer.

    TIP:   If you have hidden the Object Explorer, type CTRL+E to re-expose it. You can also hide the Watch window.

  2. In the Applets OBLE, choose the Opportunity List Applet applet.
  3. Right-click then choose Edit Web Layout.
  4. In the Controls/Columns window, set the Mode to 3: Edit List.

    By default Mode is set to 1: Base. You must set it to 3: Edit List. If the Controls/Columns window is not visible, choose View > Windows > Controls Window.

  5. Drag a Button control From the palette to the layout, then set the control's properties using values described in the following table:
    Property
    Value

    Caption-String Override

    Create Plans

    HTML Type

    MiniButton

    MethodInvoked

    EventMethodCreateActivityPlan

    The value displayed in the table does not appear in the MethodInvoked picklist. You must manually enter the value for MethodInvoked.

    Methods that use the naming format EventMethod[a string value] do not require an applet or business component script to allow the event. If you do not use this special naming convention you must write a WebApplet_PreCanInvokeMethod script to allow the event.

  6. Preview the applet. Make sure the new Create Plan button appears as displayed in the following image:
  7. Save the applet changes.
  8. Compile your changes to the SRF in your Siebel client directory.

Next, configure the workflow process to invoke when the run-time event is detected.

To configure the workflow process to invoke when the run-time event is detected

  1. In the Object Explorer, choose the Workflow Process object.
  2. In the Workflow Processes OBLE, query for the Create Plan workflow process you created in Creating the New Workflow Process.
  3. Right-click the process then choose Edit Workflow Process.
  4. Click the connector between the Start step and the step named Add Activity Plan to Oppty, then use the Properties window to set the connector's properties using values described in the following table:
    Property
    Value

    Type

    Condition

    Event Object Type

    Applet

    Event Object

    Opportunity List Applet

    Event

    PreInvokeMethod

    Subevent

    EventMethodCreateActivityPlan

    EventCancelFlag

    TRUE

    This configuration supplies a start condition for the workflow so that the workflow is invoked whenever EventMethodCreateActivityPlan occurs on the Opportunity List Applet.

  5. Validate then simulate the workflow process.

    For more information, see Process of Testing a Workflow Process.

Next, deploy and activate the workflow process.

Deploying a Workflow Process Invoked By a Runtime Event

Before the new workflow process can be called in the Siebel client, you must deploy it.

To deploy the workflow process

Follow the procedures described in Process of Deploying a Workflow Process with the following modifications:

  1. In the Active Workflow Processes applet, set the Monitoring Level to 4-Debug.
  2. Make sure you reload run-time events.
  3. Make sure a run-time event was created for this workflow process:
    1. Navigate to Administration-Runtime Events > Events.
    2. Query the Subevent for EventMethodCreateActivityPlan.

This is the method you are using to invoke the workflow. One record should be returned. Next, you test the workflow process by using the Siebel Client.

Verifying Workflow Process Functionality

In this topic you verify that the workflow process implements the required functionality.

To verify the workflow process implements the required functionality

  1. In the Siebel client, navigate to Opportunities > All Opportunities.
  2. In the All Opportunities list, click the Create Plan button.

    This invokes the workflow process for an opportunity. The workflow process navigates you to the Opportunity Activity Plan view

  3. Edit the plan Description field and save the change.
  4. Navigate to Administration-Business Process > Workflow Instance Monitor.
  5. In the Name field, query for the workflow process named Create Plan.

    The related instance data is displayed in the bottom applet.

  6. Choose the Step Instances tab to view step instance details.

If your workflow process runs without error, you can turn off monitoring for the workflow process.

To turn off monitoring for the workflow process

  1. Navigate to Administration-Business Process > Workflow Deployment.
  2. In the Active Workflow Processes applet, query the name field for the workflow process named Create Plan.
  3. Set the Monitoring Level field to 0-None.
Siebel Business Process Framework: Workflow Guide Copyright © 2008, Oracle. All rights reserved.