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

Starting a Workflow Process from a Run-Time Event


This topic describes how to use a run-time event to start a workflow process. For more information, see Configuring Run-Time Events.

How a Run-Time Event Starts a Workflow Process

This topic describes the process that Siebel CRM uses to start a workflow process from a run-time event. For this example, assume the PreWriteRecord event starts the workflow process:

  1. Components in the Application Object Manager detect the PreWriteRecord run-time event.
  2. The PreWriteRecord run-time event is defined on the connector that emanates out of the start step and the workflow process starts.
  3. The Object Manager calls the Workflow Engine. Siebel CRM passes the business object that caused the run-time event to the Workflow Engine.
  4. The Workflow Engine uses the active rows on the business object for data operations.
  5. If the rows are not already active, then the Workflow Engine sets up the rows, which is necessary for an Object Manager that creates run-time events.
  6. Siebel Workflow runs with the local thread. If SWE is present, then Siebel CRM allows user interacts. It uses the following parameters:
    • Context, which is a comma-separated string that Siebel Workflow registers internally
    • The business component that causes the run-time event

Choosing Between a Run-Time Event and a Workflow Policy

If Siebel CRM must detect a database event, then you must use a workflow policy and not use a run-time event. For example, if your configuration uses:

  • The Siebel client, then you can configure Siebel CRM to use a run-time event to start a workflow process.
  • The Siebel EAI Adapter or the EAI UI Data Adapter, then use a workflow policy. These adapters perform numerous WriteRecord events.

For more information, see Starting a Workflow Process from a Workflow Policy.

Comparison of Using a Run-Time Event to a Using a Workflow Policy

Table 38 describes two different requirements for using a run-time event compared to a workflow policy.

Table 38. Examples of Requirements for Using a Run-Time Event Compared to a Workflow Policy
Requirement
Recommended Configuration

If the user creates a new service request, then set the priority to ASAP and send a notification email.

Use a workflow policy. It is the appropriate way to detect a Siebel database event.

If the user views an entry in an applet, then create a text file that contains some information.

Use a run-time event. Define a workflow process that includes the InvokeMethod run-time event defined on the start step. This event detects if the user views the Entry Applet. Use a business service step to create the text file.

Defining a Button That Starts a Workflow Process

You can use Siebel Tools to define a button on an applet that starts a workflow process.

To define a button that starts a workflow process

  1. Open Siebel Tools, and then define a minibutton on an applet:
    1. Set the Method Invoked property to a meaningful value, such as SendEmail.
    2. Define an applet user property that calls the method. Use values from the following table.

      Property

      Value

      Name

      Named Method n

      Value

      'INVOKESVC', 'Workflow Process Manager', 'RunProcess', '"ProcessName"', '"<name of the workflow process>"', '"RowId"', '[Id]'

      For example, the following code calls the eAuction XML Bulk Upload 1 workflow process and sends a pointer to the current record:

    'INVOKESVC', 'Workflow Process Manager', 'RunProcess', '"ProcessName"', '"eAuction XML Bulk Upload 1"', '"RowId"', '[Id]'

    For more information, see the topic about the Named Method n applet user property in Siebel Developer's Reference.

  2. Define a workflow process.
  3. Optional. Use a runtime event to start this workflow process:
    1. Define a run-time event on the connector that emanates from the start step of the workflow process. Use values from the following table.

      Property

      Value

      Event Object Type

      Applet

      Event Object

      Choose the applet where the button is defined.

      Subevent

      Enter the same value that appears in the MethodInvoked property of the minibutton.

      Event Cancel Flag

      TRUE

      If you use this configuration to call a workflow process, then it is not necessary to add the Named Method n applet user property.

    2. If you write a script for PreInvokeMethod to run on the applet or the business component, then do the following:
      • Set the event cancel flag in Step a to FALSE.
      • Write a script in the WebApplet_PreInvokeMethod event of the applet that returns CancelOperation.
      • Use the BusComp_PreInvokeMethod event of the business component that the applet references to return the CancelOperation.
  4. Optional. To resume this workflow process if the user pauses it, you can define the run-time event on the connector that emanates from a user interact step or from a wait step. This event is a synthetic event. For more information, see About the Synthetic Event.
  5. Define the run-time event using values from the following table.

    Property

    Value

    Event

    PreInvokeMethod

    Event Cancel Flag

    True.

    If this flag is not checked, then an error results when the workflow process runs.

    Event Object

    Name of the business component that the applet references. This applet contains the button.

    Event Object Type

    BusComp

    Sub Event

    Name of the method you set in Step 1.

    The Sub Event name must be unique.

    Type

    (Required) Condition

  6. Activate the workflow process.

    For more information, see Activating a Workflow Process.

  7. In the Siebel client, navigate to the Administration-Runtime Events screen, and then the Events view.
  8. Click Menu on the Events applet, and then choose Reload Runtime Events.

    You must reload personalization after you activate a workflow process that registers a run-time event.

Avoiding the Cannot Resume Workflow Process Error

If the user clicks a button that starts a workflow process, and if all of the following situations exist, then an error occurs:

  • The workflow process is an interactive flow.
  • The workflow process starts at least one time in the current user session.
  • An event occurs but there is no workflow process instance available to handle this event.

Siebel CRM discards the event and displays an error message in the client.

To avoid the cannot resume workflow process error

  • Require the user to run a workflow process to access this view.

For example, you can define a workflow process that includes the user interact step. To handle the error, you can create an error exception connector or error process.

Identifying a Predefined Workflow Process That a Run-Time Event Starts

You can use the Siebel client to identify a predefined workflow process that a run-time event starts.

To identify a predefined workflow process that a run-time event starts

  1. In the Siebel client, navigate to the Administration-Runtime Events screen, and then the Events view.
  2. Note the value of the row ID in the Action Set Name field.

    For example, if Siebel CRM displays Workflow_1-2APXH in the Action Set Name field, then 1-2APXH is the Row Id of the workflow process.

  3. Navigate to the Administration-Business Process screen, and then the Workflow Processes view.
  4. Query the Name field for the row ID of the workflow process you noted in Step 2.

    For example:

    [Id]='1-2APXH'

    The query returns the record for the workflow process.

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