6Targeting Content by Using Expressions
Targeting Content by Using Expressions
This section describes how to target content by using expressions. It also describes how to create rule sets and associate rule sets with applets. Salutation applets are also described because they use inclusion expressions of rules to display a text message to the user.
This section includes the following topics:
Process of Content Targeting
The following table lists the four steps to content targeting.
Step | Description |
---|---|
Content tagging |
Business managers tag content with attributes that describe for whom the content is most appropriate. For example, a business manager might tag a company’s products by industry focus or value classification. |
User profiling |
Users enter information about themselves for use in evaluating business rules. Each piece of information is called a profile attribute. For example, a profile attribute could keep track of the industries in which a customer is interested. For more information on profile attributes, see About Dynamic User Profile Attributes. |
Business rules administration |
Business managers create rules that govern which content is shown to which users. These rules are written using an if-then syntax and allow business managers to make changes to the business logic during run time. You can write rules to examine tagged content or the actions of users in the system. |
Association with applets |
Business rules are associated with Siebel applets at run time, and only the content matching the rules is shown to the appropriate user. |
Actions to Control the Content
Controlling the content shown to users involves the following actions:
Creating rule sets to control the content shown in applets.
Creating the individual rules needed to accomplish the objectives of the rule sets.
Associating the rule sets with applets and setting the evaluation sequence. Remember that rule sets can be shared by multiple applets.
Creating a conditional expression for each rule set associated with an applet that prevents the rule set from being evaluated whenever there is no content available.
The rule set conditional expression can also create complex Boolean logic within the rule set. The values of profile attributes can turn rules on and off.
Rule Sets and Rules Flow Chart
You create both rule sets and rules in the Rule Sets view. The following figure shows the relationship of rules and rule sets to applets and views.
This section contains the following topics:

Evaluating Rule Sets
The following table lists the sequence in which rule sets are evaluated.
If... | Then... |
---|---|
A rule set is evaluated and no content or records are returned. |
The next rule set is evaluated and
|
The conditional expression associated with the rule set evaluates to FALSE. |
Creating Complex Evaluation Flow
You can also use conditional expressions to set up Boolean logic (IF, AND, OR) among the rule sets associated with a view or an applet to create a more complex flow of evaluation.
The results of the evaluation of all the rules in the set are returned to the underlying business component associated with the applet in the form of a search expression. This search expression controls the content displayed in the applet.
Rule Sets Best Practices
Limiting the number of rule sets is good practice. This is because each rule set is a query built by adding all the rules together. The rules contribute to the final query, but do not cause a query by themselves. Therefore, you can create as many rules as you like, but create rules sets carefully.
The sequence you set for rule set evaluation is important. If the system must evaluate many rule sets before getting one that returns content, performance can be affected noticeably.
Managing Rule Set Overhead
One way of managing the overhead on executing rule sets is to add a conditional expression to the rule set that evaluates to FALSE when the rule set is unlikely to return any records. This action skips the rule set whenever it is unlikely to find content.
For example, as shown in the following table, rule set 1 is based on the user’s age as calculated from his or her birthday and rule sets 2 and 3 are based on other information.
If... | Then... |
---|---|
The user has not entered his or her birthday. |
His or her age cannot be calculated. |
You put a conditional expression on rule set 1 that evaluates to FALSE if the birthday attribute is blank. |
The rule set is not evaluated. |
About Expressions and Expression Types
Expressions set the basic parameters for controlling the content to users. You can create expressions by entering the expression as text in the appropriate field or by using the Personalization Business Rules Designer.
The types of expressions are:
About Building Expressions
Expressions are written in Siebel Query Language entered as text. You build expressions from the following basic elements:
Functions.
Operators
Profile attributes
Business component fields
For more information on these elements, see Personalization Business Rules Designer Contents.
Creating Expressions
To create expressions you can either:
Enter the expression as text directly in the expression field, or
Click the icon in any selected expression field to launch the Personalization Business Rules Designer.
The maximum size for any expression (conditional, include, exclude, and business service context) is 4096, which is limited by the database configuration.
For more information on:
Creating expressions using the Personalization Business Rules Designer, see About the Personalization Business Rules Designer.
Siebel Query Language, see Operators for Building Condition Expressions which details the formulas and operators available.
Conditional Expressions
See also About Creating Rule Sets and Rules.
Conditional expressions control whether an applet or view is displayed. What content is displayed is controlled through rule sets based on content and user profile attributes. You must write conditional expressions to evaluate to TRUE or FALSE. Conditional expressions trigger rules when they evaluate to TRUE, the view or applet is displayed or the rule set and rules are processed.
Example:
GetProfileAttrAsInt(“Number of Visits") >= 7
Interpretation of Numbers in Expressions
Enclose numbers, such as telephone numbers, in quotation marks, for example:‘650-477-5000’.
This prevents numbers from being interpreted as numeric values.
Search Expressions
Search expressions consist of inclusion and exclusion expressions. Inclusion and exclusion expressions relate content attributes to user profile attributes in order to control what content each user sees. Each expression is part of a rule that is part of a rule set that you can link to an applet for the purpose of controlling content.
Business components have existing visibility settings, for example, My visibility, All visibility, or Sales Rep visibility. There may be other search specifications configured in Siebel Tools. When a rule is evaluated at run time, its inclusion and exclusion expression are added to the business component as additional search specifications.
A rule can only return content that is within the scope of the business component’s inherent visibility or search specifications as set in Siebel Tools.
Example:
EXISTS([Related Product] = GetProfileAttr(“ProductInCart"))
shows products that are related to products in the Siebel eSales Shopping Cart.
About the Personalization Business Rules Designer
The Personalization Business Rules Designer allows business managers to implement personalization rules without learning complex programming languages.
This section contains the following topics:
Displaying the Personalization Business Rules Designer
See also Personalization Business Rules Designer Contents, Process of Creating Business Rules, and Writing a Business Rule.
The Personalization Business Rules Designer (the following figure) appears when you click the icon in any selected expression field.

Personalization Business Rules Designer Contents
The contents of the Personalization Business Rules Designers are:
Categories. Contains the main categories available for building business rules:
Function. Siebel Query Language functions.
For more information, see Functions.
Operator. Siebel Query Language operators.
For more information, see Operators for Building Condition Expressions.
Me Profile Attributes. The profile attributes of the primary user, such as a Siebel eSales customer or Siebel Call Center agent.
The following table lists valid subcategories.
Subcategory Description ShowAsString
GetProfileAttr is used in the expression.
ShowAsNumber
GetProfileAttrAsNum is used in the expression.
ShowAsInteger
GetProfileAttrAsInt is used in the expression.
ShowAsDate
GetProfileAttrAsDate is used in the expression.
ShowAsTime
GetProfileAttrAsTime is used in the expression.
ShowAsDateTime
GetProfileAttrAsDateTime is used in the expression.
For more information on GetProfileAttr functions, see Profile Functions.
You Profile Attributes. The profile attributes of the secondary user, such as a customer calling a call center agent. Uses the same subcategories as Me Profile Attributes.
Business Component Fields. These depend on the context of the rule (the following table), that is, where the Rules Designer is invoked. This category will or will not have data in its elements, depending on the following contexts.
Context Data Shown View
None
Applet
Fields in the business component on which the applet is based
Rule set not associated with an applet
None
Rule set associated with one applet
Fields in the business component on which the applet is based
Rule set associated with more than one applet, and the applets are based on the same business component
Fields in the business component on which the applets are based
Rule set associated with more than one applet, and the applets are based on different business components
None
Applet event
Fields in the business component on which the applet is based
Application event
None
Business component event
Business component fields
Action set not associated with an applet event or business component event
None
Action set associated with one applet event
Fields in the business component on which the applet is based
Action set associated with one business component event
Business component fields
Action set associated with more than one applet event or business component event
None
Subcategories. Contains subcategories of the selected category. Its context is controlled by the Categories box and it controls the context of the Elements box.
Elements. Contains all of the elements used to build business rules. Its context is controlled by the Categories and Subcategories boxes.
Expression. Displays the business rule. You can type and edit in the box, as well as add elements to it.
Quick bar (Operators). Provides buttons for frequently used operators.
Description. Gives a description of the element selected in the Elements box.
Errors. Displays errors in expressions or highlighted parts of expressions when you click Validate.
Process of Creating Business Rules
See also Displaying the Personalization Business Rules Designer, Personalization Business Rules Designer Contents, and Writing a Business Rule.
Use the following process to build your business rule using the Personalization Business Rules Designer:
Select an element, and then click Add Element.
Note: Double-clicking an element has the same effect as Add Element. You can also type text in the Expressions box.The Rules Designer automatically provides the correct syntax for elements. For example, adding the Left string function displays
Left(<string>,<n>)
in the Expressions box.Fill in arguments in the element, and then enclose it in parentheses if necessary.
Add other elements and complete them.
Connect elements using the Quick bar or by typing.
Click Validate to check your expression for errors.
If part of an expression is highlighted, only the highlighted string is evaluated. Errors are displayed in the Errors box.
Save the business rule and return to the expression field.
This also validates the entire rule.
If... Then... The rule is valid.
The rule is saved and the Rules Designer is closed.
The rule has any errors.
They are displayed and the Rules Designer is not closed.
Writing a Business Rule
See also Displaying the Personalization Business Rules Designer, Personalization Business Rules Designer Contents, and Process of Creating Business Rules.
This section shows how to write a business rule using the Personalization Business Rules Designer.
Writing Rule Example
The following example shows how to write this rule:
EXISTS([Related Product] = GetProfileAttr("ProductInCart"))
which shows products that are related to products in the Siebel eSales Shopping Cart.
Writing a Personalization Rule
This procedure describes how to write a personalization rule.
To write a personalization rule
Click the icon in a selected expression field.
Choose Operator from Categories, Pattern Matching from Subcategories, and EXISTS from Elements, and then click Add Element.
The Expression box displays
EXISTS(<condition>)
.Click
<condition>
to highlight it.Choose Business Component Fields from Categories, <All> from Subcategories, and Related Product from Elements, and then click Add Element.
The Expression box displays
EXISTS([Related Product])
.Place the cursor after
[Related Product]
in the Expression box, then click = in the Quick bar.The Expression box displays
EXISTS([Related Product]=)
.Place the cursor after =.
Choose Function from Categories, Profile from Subcategories, GetProfileAttr from Elements, and then click Add Element.
The Expression box displays:
EXISTS([Related Product]= GetProfileAttr(<attribute>))
Click
<attribute>
to highlight it, and then type"ProductInCart"
.The Expression box displays the completed rule:
EXISTS([Related Product] = GetProfileAttr("ProductInCart"))
Save the rule to validate it and put it in the expression field.
About Creating Rule Sets and Rules
Rule sets control the display of content. You can associate multiple rule sets with individual applets, and you can associate an individual rule with multiple applets. Each rule set can contain multiple rules. You create rule sets in the Rule Sets view under Administration - Personalization.
After you have created a rule set, you need to create the individual rules that make up the set and accomplish the objective for matching content to the user.
This section consists of the following topics:
Creating a Rule Set
This procedure describes the process of creating a rule set.
To create a rule set
Navigate to the Administration - Personalization screen > Rule Sets view.
Create a new record.
Creating a New Rule
This procedure describes the process of creating a new rule.
To create a new rule
Navigate to the Administration - Personalization screen > Rule Sets view.
Select a rule set.
In the Rules list, create a new record.
Complete the fields as needed. Some fields are described in the following table.
Field | Description |
---|---|
Sequence |
Required. Enter numbers in this field to set the rules evaluation order. Evaluation begins with the rule with the lowest sequence number and continues until all rules are evaluated, except that -1 is evaluated last. Rules with the same sequence number are evaluated in random order. The sequence number for rules does not have the same significance as for rule sets, because all the rules in a rule set are evaluated whether content is returned or not. Rule sequence is very important, however, for the order of the text strings displayed in salutation applets. |
Rule Type |
Select a rule type from the drop-down menu:
|
Active |
Check the box to use the rule. |
Conditional Expression |
Optional. Use the conditional expression to control the evaluation of the rule, or to set up Boolean logic for evaluation of all the rules in the rule set. |
Include Expression |
Use with the Expressions rule type. An expression that sets parameters to include content. |
Exclude Expression |
Use with the Expressions rule type. An expression that sets parameters to exclude content. |
Business Service Name |
Name of the business service to invoke, if the conditional expression evaluates to TRUE and the rule type is BusService. |
Business Service Method |
Method to invoke on the business service. |
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 UserType=Partner;AccountState=Gold |
Method Name |
Method to invoke on the business component, if the conditional expression associated with the rule evaluates to TRUE and the rule type is Invoke Method. |
Method Argument |
Parameter to pass the business component. You can only pass one argument. |
Associating Rule Sets With Applets
This procedure describes how to use the Rule Sets list to associate existing rule sets with applets.
For information on creating rule sets, see About Creating Rule Sets and Rules.
To associate rule sets with an applet
Navigate to the Administration - Personalization screen > Applets view.
Select an applet.
Scroll down to the Rules Sets list, and create a new record.
In the Name field, select a rule set.
Complete the fields as needed. Some fields are described in the following table.
Field Description Sequence
Choose the order in which to evaluate the rule sets.
Start Date
The date after which the conditional expression is evaluated.
If Start Date is blank, the conditional expression is evaluated continuously or until the End Date is reached.
End Date
The date after which the conditional expression is not evaluated.
If End Date is blank, the conditional expression is evaluated continuously after the Start Date. If both Start and End Date are blank, the conditional expression is always evaluated.
Conditional Expression
Processes the rule set if the expression evaluates to TRUE.
About Salutation Applets
See also Hyperlinking Salutation Messages.
The salutation applet is a specialized applet that uses search specifications, defined in the inclusion expressions of rules, as message text displayed to the user. The salutation applet allows business managers to write customized messages using free-form HTML.
Siebel applications use the salutation applet to display information about the user or the session. You can set the parameters of this applet to display a variety of information taken from the user’s profile or actions performed during the session.
This applet can greet the user by name, indicate how long it has been since the user last visited the site, and present the user with information about specific products or services that match known interests or previous behavior.
Hyperlinking Salutation Messages
See also About Salutation Applets.
Use the Language() function to localize salutation messages. The salutation messages can include hyperlinks to other screens, views, and applet drilldown objects.
This section includes the following topics:
Hyperlinking Salutation Messages to Screens
Use the command SWEPersonalizationGotoScreen(‘ScreenName’);
in the hyperlink tag.
Enclose the name of the screen in single quotes (‘), and represent spaces in the name by plus signs (+).
The following is an example of the command syntax:
<A href=JavaScript:SWEPersonalizationGotoScreen('Accounts+ Screen');>
Hyperlinking Salutation Messages to Views
Use the command SWEPersonalizationGotoview(‘ViewName’);
in the hyperlink tag.
Enclose the name of the view in single quotes (‘), and represent spaces in the name by plus signs (+).
The following is an example of the command syntax:
<A href=JavaScript:SWEPersonalizationGotoview('User+Profile +View+(eApps)');>
Hyperlinking to Siebel Employee Relationship Management Views
You can also use this command to hyperlink to Siebel Employee Relationship Management views.
The syntax is the following:
<A href=JavaScript:SWEPersonalizationGotoview('My+View +Name');>
or
<A href=JavaScript:SWEPersonalizationGotoview('My+View +Name','&SWEmyExtra1=true&SWEMyExtra2=false');>
Make sure there are no spaces:
Between the two argument quotes and the comma separating them.
In the myExtra parameters.
The ampersand for the first myExtra parameter is optional. You can also use the following syntax:
<A href=JavaScript:SWEPersonalizationGotoview('My+View +Name','SWEmyExtra1=true&SWEMyExtra2=false');>
There is no dup argument checking mechanism. If your myExtra parameters contain an argument that SWE has already generated, undesired behavior might occur.
Hyperlinking Salutation Messages to Applets
Use the command SWEPersonalizationDrillDown ('
ViewName','
AppletName','
FieldName','
RowId',{
ParentRowIds});
in the hyperlink tag where:
ViewName is the name of the view where the drilldown object is defined.
AppletName is the name of the applet on which the drilldown object is defined.
FieldName is the business component field name on which the drilldown object exists.
ParentRowIds is an array of strings that contains the Row IDs of the parent records. This array is optional, and is only used when drilling down in a child applet.
Enclose names in single quotes (‘), and represent spaces in the names by plus signs (+).
Command Syntax Example
The following is an example of the command syntax:
<A href=JavaScript:SWEPersonalizationDrillDown('Opportunity+ List+View','Opportunity+List+Applet','Name','1-45XHZ');
Two Salutation Applets in One View
See also About Salutation Applets and Hyperlinking Salutation Messages.
To have two salutation applets in the same view, do the following:
Copy the Salutation (eApps) business component and rename it.
Add the copy to the business object associated with the view.
Create a new applet in the view based on the copy.
Process of Adding a Message to the Salutation Applet
See also About Salutation Applets and Hyperlinking Salutation Messages.
The following is the process of adding a message to the salutation applet:
Select the salutation applet.
Select the rule set associated with the salutation applet.
Add a rule to the rule set.
Provide a name, sequence, conditional expression, and inclusion expression (message) for the rule.
Modifying the Siebel eService Salutation Applet
See also About Salutation Applets, Hyperlinking Salutation Messages and Process of Adding a Message to the Salutation Applet.
Use the following procedure to add a message to the Siebel eService salutation applet that will request the user to register his or her product.
This section includes the following topics:
Adding a Message to the eService Salutation Applet
This procedure describes how to modify the eService Salutation applet.
To add a message to the eService Salutation applet
Navigate to the Administration - Personalization screen > Applets view.
Select Salutation Applet (eService).
Click the name of the rule set associated with Salutation Applet (eService).
Scroll down to the rule list to the Message Self-Service rule, and add a new rule to the list.
Fill in the following fields under the More Info tab after the Rules list.
The rule set is saved and the new rule is made active. Reloading Siebel Personalization is not necessary.
Field Value Name
Message Register.
Sequence
13.
This evaluates the rule after the Message Self-Service rule.
Rule Type
Expressions.
Active
Select the check box.
Conditional Expression
((GetProfileAttr("Me.Is Anonymous") IS NULL) OR (GetProfileAttr("Me.Is Anonymous" = 'FALSE')) AND (GetProfileAttr (Full Name" IS NOT NULL)
This shows the expression only to registered users.
Description
Register your products.
This field is optional.
Include Expression
<br><img src='images/bullet_green.gif' align='top' > <b> Please register your products.
This free-form HTML text displays a bullet with the message in bold.
Viewing the Results of Modifying the eSalutation Applet
Log in to eService as SADMIN. The following figure is an example of the Siebel eService Salutation Applet after adding a new personalization rule.
