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

Invoking a Workflow Process from a Run-Time Event


This topic provides information about using a run-time event to invoke a workflow process. For more information, see About the Run-Time Event.

How a Run-Time Event Invokes a Workflow Process

This topic describes the simple process the Siebel application uses to invoke a workflow process with a run-time event. For this example, assume the PreWriteRecord event is used to invoke the workflow process.

A run-time event invokes a workflow process as described in the following sequence:

  1. The PreWriteRecord run-time event is detected by application object manager components.
  2. Since the PreWriteRecord run-time event is defined on the connector emanating out of the start step, the workflow process is invoked.
  3. The object manager internally calls the Workflow engine. At the time of the call, the business object that caused the run-time event is passed to the Workflow engine.
  4. The Workflow engine uses the active rows on the business object for data operations.
  5. The Workflow engine sets up the rows if they are not already active.

    This is applicable for an object manager that generates run-time events. Workflow runs with the local thread, and if SWE is present, user interacts are allowed. The parameters used include:

    • Context, a CSV string internally registered by Workflow.
    • The business component causing the run-time event.

Choosing Between a Run-Time Event and a Workflow Policy

In cases where it is necessary to detect a database event, use a workflow policy, not a run-time event. For example, when using the UI, use a run-time event to trigger a workflow process. When using the Siebel EAI Adapter or the EAI UI Data Adapter, which performs numerous WriteRecord events, use a workflow policy.

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

Example Requirements for Using a Run-Time Event Compared to a Workflow Policy

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

Table 28. Examples of Requirements for Using a Run-Time Event Compared To a Workflow Policy
Workflow Requirement
Recommended Invocation Technique

Set the priority to ASAP and send a notification email whenever a new service request is created.

Using a workflow policy is a more appropriate way to detect the database event.

Generate a text file with some information whenever a particular entry applet is viewed.

Using a run-time event is more appropriate. Create a workflow process with the InvokeMethod run-time event defined on the Start step that detects when the Entry Applet is viewed. Use a business service step in this workflow process to generate the text file.

Invoking a Workflow Process With a Button

You can use Siebel Tools to configure a button on an applet that triggers the run-time event that invokes a workflow process.

To create a button that invokes a workflow process

  1. From Siebel Tools, configure a button on an applet and specify the MethodInvoked property.

    For more information, see Using Siebel Tools.

  2. Override the PreCanInvokeMethod property.
  3. Edit the server script and compile your changes to the Siebel repository file.

    The following example is specific to Siebel VB:

    Function WebApplet_PreCanInvokeMethod (MethodName As String, CanInvoke As String) As Integer

    If MethodName = "<Name>" Then

    CanInvoke = "True"

    WebApplet_PreCanInvokeMethod = CancelOperation

    Else

       WebApplet_PreCanInvokeMethod = ContinueOperation

    End If

    End Function

  4. Create a workflow process.
  5. Choose an invocation method.

    To invoke this workflow process from a button click, you must specify a run-time event on a connector. Choose from one of the following invocation methods:

    • To start this workflow process, specify the run-time event on the connector emanating from the Start step.
    • To resume this workflow process if it is paused as the result of a button click, specify the run-time event in a User Interact step or a Wait step.
  6. Specify the run-time event using values described in the following table:

    Property

    Value

    Event

    PreInvokeMethod

    Event Cancel Flag

    True.

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

    Event Object

    Name of the business component on which the applet that contains the button is based.

    Event Object Type

    BusComp

    Sub Event

    Name of the method you set in step Step 1.

    The Sub Event name must be unique.

    Type

    (Required) Condition

  7. Activate the workflow process.
  8. In the Siebel client, navigate to Administration-Runtime Events > Events.
  9. From the Menu button on the Events applet, choose Reload Runtime Events.

    You must reload personalization after activating a workflow process that registers a run-time event for the workflow process to take effect.

Configuring a Workflow Process to Avoid the Cannot Resume Process Error Message

Requirements that must be met to return an error when a user clicks a button that invokes a workflow include:

  • The workflow process must be an interactive flow.
  • The workflow process must be started at least once in the current user session.
  • An event must be fired and there must be no workflow instance waiting to handle the event.

If these conditions are met, the event is discarded or the user receives an error message.

You can prevent this from happening by requiring the user to run a workflow process to access this view. For example, you can configure a workflow process that includes the User Interact step. You can handle the error by defining an Error Exception branch or error process.

Identifying A Predefined Workflow Process Invoked by a Run-Time Event

In your implementation, it is possible that some predefined workflow processes are invoked by a run-time event. You can use the Action Set Name field of the Run-time Events administration screen in the Siebel client to identify a predefined workflow process that is invoked by a run-time event.

To identify a predefined workflow process that is invoked by a run-time event

  1. In the Siebel client, navigate to Administration-Runtime Events > Events.
  2. Note the row ID value in the Action Set Name field.

    For example, if Workflow_1-2APXH appears in the Action Set Name field, then 1-2APXH is the row ID of the workflow process being referenced.

  3. Navigate to Administration-Business Process > Workflow Processes.
  4. In the Name field, query 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 © 2008, Oracle. All rights reserved.