Working with Rules
The following topics are covered here:
Creating Rules
Creating the classifier rules
Creating the content selector rules
Creating Rules
Since we've indexed the content for the new promotion, we now need to create rules that will match the content with users when they visit MyBuyBeans.com. To implement this functionality, we need to create four rules:
- A classifier rule that classifies users as frequent shoppers if they've accumulated
15 or more Beanie Points.
- A classifier rule that classifies users as infrequent shoppers if they've
accumulated fewer than 15 Beanie Points.
- A content selector rule that matches frequent shopper message content to user
profiles in the frequent shopper classification.
- A content selector that matches hints to user profiles in the infrequent shopper
classification.
Creating the classifier rules
You will create two classifier rules to classify frequent and infrequent shoppers in this section. We will later use these classifier rules in content selector rules that select a message or hint to display to users of MyBuyBeans.com.
Note: WebLogic Commerce Server doesn't save rules until you click the finished button in a Rule view page.
- Make sure WebLogic Commerce Server is running and go to the Administration
Tools Home Page at http://<wlhost>:<port>/wlpsadmin.
- Click the Rules Management icon. The Rules Management home page appears.
- Click the rulesheet named MyBuyBeans to edit it. The MyBuyBeans Rulesheet
view page appears.
- Click create in the Classifiers bar to create a new classifier rule. The Create a
Classifier Rule edit page appears.
- Enter the rule name FrequentShopper into the Rule Name field.
- Enter a description of the rule into the Description field. For example, you might
type Classifies users with 15 or more Beanie Points.
- Click create to add the rule to the MyBuyBeans rulesheet. The Create a
Classifier Rule edit page refreshes and displays a message about the rule
creation's success.
Note: We'll add phrases to the rule later in the tutorial.
- Now create another classifier rule by entering the rule name
InfrequentShopper into the Rule Name field.
- Enter a description for this rule. For example, Classifies users with fewer
than 15 Beanie Points.
- Click create to save the rule in the MyBuyBeans rulesheet. The Create a
Classifier Rule edit page refreshes and displays a message about the rule
creation's success.
- Click back to return to the MyBuyBeans Rulesheet view page.
Adding phrases to the classifier rules
We need to add conditions to the classifier rules to classify users depending on the number of Beanie Points they have.
- Click the FrequentShopper classifier rule on the MyBuyBeans Rulesheet view
page to open it for editing. The Rule view page appears.
- Click phrase to add a phrase to the rule.
- Select the Single-Value with Constant template to define the phrase and click
next. Step 2 of the Create If Phrase Wizard appears.
- Click the USER.BeaniePoints property to define the left operand of the rule
phrase and click next. Step 3 of the Create If Phrase Wizard appears.
- Select the >= comparator from the Comparator drop-down list box and enter the
value 15 into the Constant field.
- Click save to add the phrase to the rule. The Rule view page appears with the
new phrase displayed.
- Click finished to save the rulesheet and return to the Rulesheet view page.
- Now add a phrase to the InfrequentShopper rule. Click the InfrequentShopper
classifier rule on the MyBuyBeans Rulesheet view page to open it for editing.
The Rule view page appears.
- Click phrase to add a phrase to the rule.
- Select the Single-Value with Constant template to define the phrase and click
next. Step 2 of the Create If Phrase Wizard appears.
- Click on the USER.BeaniePoints property to define the left operand of the rule
phrase and click next. Step 3 of the Create If Phrase Wizard appears.
- Select the < comparator from the Comparator drop-down list box and enter the
value 15 into the Constant field.
- Click save to add the phrase to the rule. The Rule view page appears with the
new phrase displayed.
- Click finished to save the rulesheet and return to the Rulesheet view page.
Note: Notice how much faster the pages load since the page source code already compiled the first time you accessed the pages.
Creating the content selector rules
You've created two classifier rules to categorize users as frequent or infrequent shoppers. In this section, you'll create two content selector rules that use the classifier rules. The content selector rules will match content to users based on the user's classification. Let's create a rule to show site usage hints to infrequent shoppers.
Note: The hints will tell new users how to use MyBuyBeans.com's features, how to find account information, and search for bean products.
- Click create in the Content Selectors bar of the Rules list. The Create a Content
Selector Rule edit page appears.
- Select the LoadedData content type from the Content Type drop-down list box.
Note: The LoadedData content type results from the reference implementation's BulkLoader utility. If you use a different DMS, you will see different content types.
- Enter the rule name Hints into the Rule Name field.
- Enter a description of the rule into the Description field. For example, Shows
site usage hints to users in the InfrequentShopper
classification.
- Click create to add the rule to the MyBuyBeans rulesheet. The Create a Content
Selector Rule edit page refreshes and displays a message about the rule creation's
success.
- Add another rule that shows promotional messages to frequent shoppers. Enter
the rule name FrequentShopperMessage into the Rule Name field.
- Enter a description of the rule into the Description field. For example, Selects
a preview message for users in the FrequentShopper
classification.
- Click create to save the new rule in the MyBuyBeans rulesheet. The Create a
Content Selector Rule edit page refreshes and displays a message about the rule
creation's success.
- Click back to return to the MyBuyBeans Rulesheet view page.
Adding conditions to the Hints rule
- Click the Hints content selector rule on the MyBuyBeans Rulesheet view page to
open it for editing. The Rule view page appears.
- Click classifier in the If the user has the following characteristics bar to add a
classifier to the Hints rule. The Rule search page appears.
- Enter InfrequentShopper in the Classifier Name field to find the
InfrequentShopper classifier rule and click search.
Note: The * character allows you to perform a wildcard search. Using the * character alone returns a list of all classifier rules.
Note: The search is case sensitive.
- Check the box next to the InfrequentShopper classifier rule. This will add the
classifier to the Hints rule when you click save.
- Click save to commit the changes. The Rule search page refreshes and displays a
message about the process's success.
- Click back to return to the Rule view page. The Rule view page appears with the
new classifier displayed.
- Click finished to save the rulesheet and return to the Rulesheet view page.
- Click the Hints content selector rule on the MyBuyBeans Rulesheet view page
to open it for editing again. The Rule view page appears
- Click phrase in the "Then display content based on" bar. Step 1 of the Create
Then Phrase Wizard appears.
- Select the Value with Constant template to use to define the content query and
click next. Step 2 of the Create Then Phrase Wizard appears.
- Select the CONTENT.shoppingFrequency property from the Property list and
click next. Step 3 of the Create Then Phrase Wizard appears.
Note: This content property comes from the information in the <meta> tags in the hints1.htm and hints2.htm files the BulkLoader indexed earlier.
- Select the == comparator and enter InfrequentShopper into the Constant field.
Click save to add the phrase to the rule. The Rule view page appears with the
new phrase displayed.
Note: The value InfrequentShopper is stored in the metadata in the hint1.htm and hint2.htm files. We loaded the metadata using the BulkLoader earlier in the tutorial. At run time, a user who logs in with fewer than 15 Beanie Points will match the InfrequentShopper classification and will see the hints content selected through the query defined here.
- Click finished to save the rulesheet and return to the Rulesheet view page.
Adding conditions to the FrequentShopperMessage rule
- Click the FrequentShopperMessage content selector rule on the MyBuyBeans
Rulesheet view page to open it for editing. The Rule view page appears.
- Click classifier to add a classifier to the FrequentShopperMessage rule. The
Rule search page appears.
- Enter FrequentShopper in the Classifier Name field to find the
FrequentShopper classifier rule and click search.
Note: The * character allows you to perform a wildcard search. Using the * character alone returns a list of all classifier rules.
- Check the box next to the FrequentShopper classifier rule. This will add the
classifier to the FrequentShopperMessage rule when you click save.
- Click save to commit the changes. The Rule search page refreshes and displays a
message about the process's success.
- Click back to return to the Rule view page. The Rule view page appears with the
new classifier displayed.
- Now we will add a phrase to select special messages to match to frequent
shoppers. Click phrase in the Then display content based on bar. Step 1 of the
Create Then Phrase Wizard appears.
Note: This phrase defines the query that will execute at run-time if a user matches the FrequentShopper classification.
- Select the Value with Constant template to use to define the content query and
click next. Step 2 of the Create Then Phrase Wizard appears.
- Select the CONTENT.shoppingFrequency property from the Property list and
click next. Step 3 of the Create Then Phrase Wizard appears.
Note: The property list receives its data from the metadata stored in the document management system, in this case the reference implementation that loaded metadata using the BulkLoader utility.
- Select the == comparator and enter FrequentShopper into the Constant field.
Click save to add the phrase to the rule. The Rule view page appears with the
new phrase displayed.
You've completed indexing the content and creating the rules to match the content to users who log into MyBuyBeans.com. In the next phase, you'll use the Personalization Advisor's JSP tags to create the JSP page to pull the entire personalized application together.
Note: Remember that WebLogic Commerce Server doesn't save rules until you click the finished button in a Rule view page.
|
Copyright © 2000 BEA Systems, Inc. All rights reserved.
Required browser: Netscape 4.0 or higher, or Microsoft Internet Explorer 4.0 or higher.
|