BEA Logo BEA WLCS Release Release Number

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

 

   WLCS Doc Home   |   Personalization Server MyBuyBeans Tour   |   Previous Topic   |   Next Topic   |   Contents   |   Index

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:

  1. A classifier rule that classifies users as frequent shoppers if they've accumulated 15 or more Beanie Points.

  2. A classifier rule that classifies users as infrequent shoppers if they've accumulated fewer than 15 Beanie Points.

  3. A content selector rule that matches frequent shopper message content to user profiles in the frequent shopper classification.

  4. 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.

  1. Make sure WebLogic Commerce Server is running and go to the Administration Tools Home Page at http://<wlhost>:<port>/wlpsadmin.

  2. Click the Rules Management icon. The Rules Management home page appears.

  3. Click the rulesheet named MyBuyBeans to edit it. The MyBuyBeans Rulesheet view page appears.

  4. Click create in the Classifiers bar to create a new classifier rule. The Create a Classifier Rule edit page appears.

  5. Enter the rule name FrequentShopper into the Rule Name field.

  6. Enter a description of the rule into the Description field. For example, you might type Classifies users with 15 or more Beanie Points.

  7. 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.

  8. Now create another classifier rule by entering the rule name InfrequentShopper into the Rule Name field.

  9. Enter a description for this rule. For example, Classifies users with fewer than 15 Beanie Points.

  10. 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.

  11. 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.

  1. Click the FrequentShopper classifier rule on the MyBuyBeans Rulesheet view page to open it for editing. The Rule view page appears.

  2. Click phrase to add a phrase to the rule.

  3. Select the Single-Value with Constant template to define the phrase and click next. Step 2 of the Create If Phrase Wizard appears.

  4. 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.

  5. Select the >= comparator from the Comparator drop-down list box and enter the value 15 into the Constant field.

  6. Click save to add the phrase to the rule. The Rule view page appears with the new phrase displayed.

  7. Click finished to save the rulesheet and return to the Rulesheet view page.

  8. 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.

  9. Click phrase to add a phrase to the rule.

  10. Select the Single-Value with Constant template to define the phrase and click next. Step 2 of the Create If Phrase Wizard appears.

  11. 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.

  12. Select the < comparator from the Comparator drop-down list box and enter the value 15 into the Constant field.

  13. Click save to add the phrase to the rule. The Rule view page appears with the new phrase displayed.

  14. 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.

  1. Click create in the Content Selectors bar of the Rules list. The Create a Content Selector Rule edit page appears.

  2. 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.

  3. Enter the rule name Hints into the Rule Name field.

  4. Enter a description of the rule into the Description field. For example, Shows site usage hints to users in the InfrequentShopper classification.

  5. 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.

  6. Add another rule that shows promotional messages to frequent shoppers. Enter the rule name FrequentShopperMessage into the Rule Name field.

  7. Enter a description of the rule into the Description field. For example, Selects a preview message for users in the FrequentShopper classification.

  8. 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.

  9. Click back to return to the MyBuyBeans Rulesheet view page.

Adding conditions to the Hints rule

  1. Click the Hints content selector rule on the MyBuyBeans Rulesheet view page to open it for editing. The Rule view page appears.

  2. 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.

  3. 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.

  4. Check the box next to the InfrequentShopper classifier rule. This will add the classifier to the Hints rule when you click save.

  5. Click save to commit the changes. The Rule search page refreshes and displays a message about the process's success.

  6. Click back to return to the Rule view page. The Rule view page appears with the new classifier displayed.

  7. Click finished to save the rulesheet and return to the Rulesheet view page.

  8. Click the Hints content selector rule on the MyBuyBeans Rulesheet view page to open it for editing again. The Rule view page appears

  9. Click phrase in the "Then display content based on" bar. Step 1 of the Create Then Phrase Wizard appears.

  10. 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.

  11. 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.

  12. 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.

  13. Click finished to save the rulesheet and return to the Rulesheet view page.

Adding conditions to the FrequentShopperMessage rule

  1. Click the FrequentShopperMessage content selector rule on the MyBuyBeans Rulesheet view page to open it for editing. The Rule view page appears.

  2. Click classifier to add a classifier to the FrequentShopperMessage rule. The Rule search page appears.

  3. 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.

  4. Check the box next to the FrequentShopper classifier rule. This will add the classifier to the FrequentShopperMessage rule when you click save.

  5. Click save to commit the changes. The Rule search page refreshes and displays a message about the process's success.

  6. Click back to return to the Rule view page. The Rule view page appears with the new classifier displayed.

  7. 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.

  8. 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.

  9. 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.

  10. 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.