Note that when creating expressions we often use the numeric internal ids of products, categories and manufacturers to identify them. These ids are visible in the admin app although they may be hidden by setting the configuration variables under the Admin App Configuration sub menu.

The id of a product (and SKU) may be viewed as you move your mouse over the product name in the Products panel:

It may also be viewed in the Details tab of the Edit Product panel:

The id of a category is visible in the Categories panel:

The id of a manufacturer is visible in the Manufacturers panel:

Now that we know where to find the ids, lets move on to the expression that we want to create. As explained in the example above we want to create an expression to show a banner to a customer if his cart already contains $50.00 worth of goods and he has Product A in his wish list or he has recently viewed Product A. For the sake of the tutorial we can attribute a product id of 10 to Product A. Let's create an expression called MY_EXPRESSION as shown below.

Once the expression has been saved, we must click on the Variables button in order to open a new panel where we can enter the expression variables that define the expression.

Click the New button to create the first variable.

We choose CartTotal from the list of customer tags and give it a value of >= 50. Now we must AND this tag with the the following two tags OR'ed together. To achieve this, we click the Group button.

After entering the Customer Tag value for product in wish list, we need to OR it with the recently viewed product tag, by clicking the New button.

Now we can click the save button to save the expression variables.
We have created the expression: (Cart_Total >= 50) AND ((prod in wishlist == 10) OR (recently viewed prod == 10))
The demo store front application is already partially set up to show a tile called DynamicContentTile.jsp. In order to enable the tile, we must edit the file called tiles-defs.xml which can be found under the webapps\konakart\WEB-INF directory. As can be seen from the image below, we must uncomment the line for leftTile3 in order to add DynamicContentTile.jsp. We must also comment or delete the line below this which adds an empty tile called Empty.jsp. Note that once this tile is enabled and customer tag functionality has been enabled, it will attempt to evaluate an expression called MY_EXPRESSION and an exception will be thrown if this expression doesn't exist.

Finally, before running the application to try out our expression, we must enable customer tags in the Customer Details section of the configuration variables, as shown below:

The code that sets the wish list and cart customer tags is embedded within the client engine and so this tag functionality has to be enabled separately. All other customer tags are set within the Struts action classes such as CustomerRegistrationSubmitAction.java for which the source code is shipped.

As can be seen from the image above, a tile appears (red arrow) after logging in, when the cart total is above $50 and Under Siege 2 (product id = 10) is in the wish list. The tile appears on the home page view. Obviously in a real life situation the tile could be a banner.
At any time, you can view (and edit) the customer tag values for any customer from the Tags folder of the Edit Customer panel.
