4Tracking Run-Time Events

Tracking Run-Time Events

Tracking run-time events allows the Siebel application to respond in real time to user actions. Business managers can configure the actions in response to any event. For information about tracing run-time events, see Enabling Personalization Event Logging.

This section includes the following topics:

Note: Where a server script is written for an application, applet, or business component, the run-time event runs first.

About Run-Time Events and Action Sets

When a run-time event occurs that is associated with one or more action sets, the personalization engine performs the specified actions. These actions modify content and user profile attributes, with the potential of triggering personalization rules. You do not need to reconfigure or recompile business objects because the interaction occurs between Siebel Personalization and the user interface.

Note: Upon application startup, to avoid potential inconsistency in the data available through profile attributes and the data stored in the database, it is recommended that you always force the personalization engine to load the user profile in the start event.

For example, you could watch for customers to remove products from their Siebel eSales Shopping Cart (that is, invoke the EmptyCart method of the Shopping Service business service), and then recommend a substitute product for them to consider.

Definitions of Events

Events are defined by:

  • Object Type. The type of object to which the event occurs, such as an application, business component, or applet.

  • Object Name. The name of the application, business component, or applet to which the event occurs.

  • Event. The specific event that happens to the object. The set of available events is different for different object types.

  • Application event. The following table lists available events.

Table Application Events

Application Events Description

Login

A user logs in to an application using the Siebel Mobile Web Client.

Note: Logging in to Siebel Web Client will trigger both Login as well as WebLogin runtime events.

Logout

A user logs out from an application using the Siebel Mobile Web Client.

SetAttribute

A profile attribute is set.

ViewActivated

A view is activated.

ViewDeactivated

A view is deactivated.

WebLogin

A user logs in to the Siebel Web Client.

WebLogout

A user logs out from the Siebel Web Client.

WebSessionEnd

A Web session ends.

WebSessionStart

A Web session begins.

WebTimeout

A Web session times out.

The following example was traced by setting the component parameter Application Personal Log = <FILENAME> and lists the events that occur when a Web session times out.

  1. Object type: Application Object name: Siebel eCustomer Event: TIMEOUT Sub-event:

  2. Object type: Application Object name: Siebel eCustomer Event: Logout Sub-event: TIMEOUT

  3. Object type: Application Object name: Siebel eCustomer Event: WebSessionEnd Sub-event:

  4. Object type: Application Object name: Siebel eCustomer Event: WebTimeout Sub-event:

ApplicationUnload

The ApplicationUnload event is fired on the server side when the client framework is unloaded from the client browser.

  • Business component. All business component events are named after corresponding Siebel VB BusComp functions. The following table lists the available events.

Table Business Component Events

Business Component Events Is Triggered...

Associate

After an association is created when a record is added to a business component.

ChangeRecord

After the current row changes in the business component.

CopyRecord

After a new row is copied in the business component.

DeleteRecord

After a row is deleted in the business component.

InvokeMethod

After a method is called.

NewRecord

After a new row is added to the business component.

PreAssociate

Before an association is created when a record is added to a business component.

PreCopyRecord

Before a new row is copied in the business component.

PreDeleteRecord

Before a row is deleted in the business component.

PreGetFieldValue

When the value of a business component field is accessed.

PreInvokeMethod

Before a method is called.

PreNewRecord

Triggered before a new row is added to the business component.

PreQuery

Triggered before a query is executed.

PreSetFieldValue

Triggered when a value is written to the business component from the user interface.

PreWriteRecord

Triggered before a row is written to the database.

Query

Triggered after a query is executed.

SetFieldValue

Triggered after a value is written to the business component from the user interface.

WriteRecord

Triggered after a row is written to the database.

WriteRecordNew

Triggered after a new row is written to the database. Fires along with WriteRecord.

WriteRecordUpdated

Triggered after a row is updated in the database. Fires along with WriteRecord.

  • Applet. Applet events are triggered just after a method is invoked or an applet or record is displayed, as shown in the following table. For more information on events, see Using Siebel Tools.

Table Applet Events

Applet Event Description

DisplayApplet

An applet is displayed.

DisplayRecord

A record is displayed.

InvokeMethod

A method is invoked.

PreInvokeMethod

Triggered before a method is called.

  • Subevent. The subevent represents the following information according the event and object type, as determined by the object type (the following table).

Table Subevent Information

When the object type is... Then...

BusComp or Applet and the event is InvokeMethod or PreInvokeMethod

The subevent is the name of the method to monitor.

The method name is found in Siebel Tools, in the Invoke Method property of the control that calls the method.

BusComp and the event is SetFieldValue or PreSetFieldValue

The subevent is the name of the field to monitor.

Application and the event is ViewDeactivated or ViewActivate

The subevent is the name of the view to monitor.

Application and the event is SetAttribute

The subevent is the name of the attribute.

  • Conditional Expression. Adds additional control. If the conditional expression evaluates to TRUE, the action is triggered when the event occurs.

    Note: The field referenced in the conditional expression must be activated, either by setting the field to force active or by displaying it on the applet, to trigger the run-time event.
  • Action Set. What actions are taken when the event occurs. Action sets are defined in the Action Sets view under Administration - Runtime Events.

    Most actions set or modify user profile attributes. These set expressions store information that is later used to tailor content delivery.

  • Sequence. The order in which the action set associated with this event in this record executes, relative to other action sets associated with this event. Runtime events with a sequence value of -1, such as a system generated workflow events for workflow processes, are executed first.

Process of Creating Action Sets

Action sets are groups of actions that are triggered by events. They are created in the Action Sets view under Administration - Runtime Events. The following steps are the tasks to create action sets:

  1. Creating Action Sets.

  2. Creating Actions for Action Sets.

  3. Associating Events with Action Sets.

Action Types Supported

The following action types are supported for all events:

  • Attribute Set. Simple expression that sets user profile attributes. These are: setting to a constant value, auto-increment, auto-decrement, increment by a constant, and decrement by a constant.

  • BusService. Invokes a method of the specified business service. The input to the business service is a property set with the following properties:

    • Context. Business service context, as defined in the action that caused the business service to be called.

    • ActionSet. Action set name.

    • Action. Action that caused the business service to be called.

    • EventId. Row ID of the event that caused the action to occur.

    • Event Name. Event that caused the action to occur.

    • Sub Event. Sub Event defined in the event that caused the action to occur.

    • Event Type. Type of event.

    • Object Name. Object Name defined in the event that caused the action to occur.

    • Business Component Name. Used if the object type is Applet, the name of the business component on which the applet is based, as shown in the following table.

      Table Business Component Name Used if Object Type is Applet or Bus Comp

      If... Then...

      Applet

      The business component name is the name of the business component on which the applet is based.

      BusComp

      The business component name is the same as the object name.

  • Invoke Method. Invokes a method on the business component that caused the event to occur.

Creating Action Sets

You create action sets in the Action Sets view under Administration - Runtime Events.

To create an action set

  1. Navigate to the Administration - Runtime Events screen > Action Sets view.

  2. Create a new record.

    Complete the fields as needed. Some fields are described in the following table.

    Field Description

    Active

    Required. Select the check box to make the action set active.

    Enable Export

    Select the check box to enable exporting the action set when exporting personalization rules.

    Run-time events created automatically by workflow have the Enable Export flag set to false.

Creating Actions for Action Sets

You define actions to be triggered when an event occurs. Actions can modify content or user profile attributes, which in turn can modify the content displayed to the user.

Actions are created in the Action Sets view under Administration - Runtime Events.

Note: After modifying personalization actions, you must refresh the object manager for the actions to take effect immediately. See About Clearing and Reloading Siebel Personalization.

To create actions for an action set

  1. Navigate to the Administration - Runtime Events screen > Action Sets view.

  2. Select the action set, and in the Actions list, create a new record.

  3. Complete the fields as needed under the More Info tab.

Some fields are described in the following table.

Field Comments

Name

Required. Name for conveniently referring to the action.

Sequence

Required. Number describing the order in which the action occurs. Execution begins with the action with the lowest sequence number, such as -1.

Actions with the same sequence number are executed in random order. Actions occur in sequence until all actions are completed.

Active

Required. Check to indicate whether you want the action triggered or not. Inactive actions are ignored when the event occurs.

Note: This is a quick way to turn off an action without changing the start and end dates.

Conditional Expression

If the conditional expression evaluates to TRUE, the action is triggered when the event occurs.

Note: The field referenced in the conditional expression must be activated, either by setting the field to force active or by displaying it on the applet, to trigger the run-time event.

Action Type

Required. Select the type of action from the drop-down menu:

  • Attribute Set. Sets a user profile attribute. The most common action type. For example, ProdName is set to a product in the user’s Shopping Cart. Attribute Set uses the Profile Attribute, Set Operator, Value, Set Minimum, and Set Maximum fields.

    For example, to create an action in which you specify the profile attribute service:

    • Select Attribute Type from the Action Type field.

    • Enter AttributeFooValue in the Profile Attribute field.

    • Enter Set in the Value field.

    • BusService. Invokes a business service method. You can also use this action type to trigger a workflow process or to get profile attributes. The input argument is a property set. BusService uses the Business Service Name, Business Service Method, and Business Service Context fields.

    • InvokeMethod. Invokes a method on the object (applet, business component, or application) that caused the event to occur. InvokeMethod uses the Method Name and Method Argument fields.

Profile Attribute

The user profile attribute to set.

Set Operator

One of five choices:

  • Set. Sets a user attribute to an explicit value. For example, Set DidLogin to Yes.

  • Increment. Increments a user attribute by an integer (default value, if Set Expression is blank, is 1). For example, Increment PagesView by 1.

  • Decrement. Decrements a user attribute by an integer (default value, if Set Expression is blank, is 1). For example, Decrement PagesView by 10.

  • Add List. Adds a value to a comma-delimited list. For example, add the name of the current product to the list of products viewed.

  • Remove List. Removes a value from a comma-delimited list.

Value

The expression to use with the set operator. You can use any expression that evaluates to something the Set Operator can use, usually a business component field.

Use the Personalization Business Rules Designer to pick the business component field.

Set, Add List, and Remove List must evaluate to a single value. Increment and Decrement must evaluate to an integer.

Business Service Context

Parameter to pass to the business service method. While a business service can take many name/value pair parameters, you can only pass one parameter—called Context—in Siebel Personalization.

An example of a business service context is:

Action Type: BusService
Business Service Name: Workflow Process Manager
Business Service Method: RunProcess
Business Service Context: "ProcessName", "My Workflow".

Use the following eScript command to retrieve the value from the business service context from a custom build business service:

var sValue = Inputs.GetProperty("Context") 

Expressions like Today() or [<Field Name>] are not calculated. Only the plain string is sent to the business service and the string must be interpreted within the business service. In business services, like Workflow Process Manager, the name value pairs are used as input arguments. However, in a custom business service you must develop this functionality.

Method Name

Method to invoke on the business component, if the conditional expression evaluates to TRUE and the action type is Invoke Method.

Method Argument

Parameter to pass the business component. You can only pass one argument.

Associating Events with Action Sets

You can set up events to be monitored by the system and to trigger actions when these events occur. The actions then modify content or user profile attributes or invoke business service methods, which can cause personalization rules to fire.

To associate an event with an action set

  1. Navigate to the Administration - Runtime Events screen > Events view.

  2. Create a new record.

    Complete the fields as needed. Some fields are described in the following table.

    Field Description

    Sequence

    Required. An event can trigger multiple action sets. Enter numbers in this field to control when the action set associated with this event in this record executes, relative to other action sets associated with this event.

    Object Name

    The name of the application, business component, or applet (depending on the object type) to which the event occurs.

    Event

    Required. Select from the drop-down list. The choices depend on which object type you choose.

    Subevent

    The subevent represents the following information according the event and object type:

    When the object type is:

    • BusComp or Applet and the event is InvokeMethod or PreInvokeMethod, the subevent is the name of the method to monitor. The method name is found in Siebel Tools, in the Invoke Method property of the control that calls the method.

    • BusComp and the event is SetFieldValue or PreSetFieldValue, the subevent is the name of the field to monitor.

    • Application and the event is ViewDeactivated or ViewActivated, the subevent is the name of the view to monitor.

    • Application and the event is SetAttribute, the subevent is the name of the attribute.

    Conditional Expression

    Enter a conditional expression if necessary to add additional control to whether the event is monitored.

    Note: The field referenced in the conditional expression must be activated, either by setting the field to force active or by displaying it on the applet, to trigger the run-time event.

Creating Event Aliases

An event alias is a template that you can use to create commonly occurring events. Event aliases are created in the Event Aliases list under Administration - Runtime Events.

Event aliases consist of a meaningful name and the minimum set of objects that define an event: Object Type, Object Name, Event, and Subevent. When you pick an event alias in the Name field of the Events form, the fields for the objects that define the event are automatically completed.

To create an event alias

  1. Navigate to the Administration - Runtime Events screen > Event Aliases view.

  2. Create a new record.

    Complete the fields as needed. Some fields are described in the following table.

    Field Description

    Object Type

    Required. Select from the drop-down list:

    • Application

    • BusComp
    • Applet

    Object Name

    The name of the object to which the event occurs.

    Event

    Required. Select from the drop-down list. The choices depend on which object type you choose.

    Subevent

    Fill in Subevent only when the object type is BusComp or Applet and the event is InvokeMethod.

    In this case, the subevent is the name of the method to be monitored.