Functions can be nested inside each other. You can also chain sets of functions together to create more complex criteria expressions. All standard rules for Java functions are supported such as the && (AND) operator and the || (OR) operator.
The following criteria expression sets a temporary variable called filteredCart with the list of cart complex attribute category's item attributes that have a value that matches ItemX. The criteria expression then creates a temporary variable called filteredWallet with a list of wallet discounted items that match ItemX.
Finally, the criteria expression returns true if the count of items in the filteredCart is greater than the number of items in the filteredWallet.
set("filteredCart", filter( get("Account.cart"),"item","ItemX" ) )&& set("filteredWallet", filter( get("Account.wallet"),"discountedItem","ItemX" ) )&& count(filteredCart) > count(filteredWallet)
The following criteria expression uses the pattern function extensively as well as the && operator. The criteria expression returns true if the customer has never seen a Savings page and has seen Product and Cards pages and Products within the last two pages and is currently on the Credit page.
index( get("Session.Customer.nav.page"), pattern(".*Savings") ) == -1 && index( get("Session.Customer.nav.page"), list( pattern("Products.*"), pattern(".*Cards.*"), pattern("Products.*", 2) ) ) > -1 && get("Customer.nav.page") == "Credit"