Order Express Formulas

From eVision
Revision as of 09:33, 21 January 2015 by Gwilliams (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Overview

Order Express utilizes a robust expression system designed by eVision Services which allows for the conditional pricing of items. These pricing rules are stored within the database in the PricingRules table. Rules are written in postfix notation, but includes a number of keywords that can be used to retrieve information about the item being priced (such as how a product can be priced differently based on which styles are applied to it.

Unimplemented Keywords

These keywords are considered to be "valid" keywords/tokens within the Rules Engine but currently have no implementation for pricing rules, and are thus not available for usage in pricing rules.

  • C: - Category
  • COUNT: - Count
  • E: - Finished End Option Group
  • EVERY: - Every
  • H: - Hinging Option Group
  • LIMIT: - Limit
  • MAX: - Maximum
  • MIN: - Minimum
  • N: - Style Option Selections Count
  • L: - Product Line
  • Q: - Style Option Selection
  • S: - Style Category
  • SOME: - Some
  • SUM: - Sum
  • Z: - Evaluation

Implemented Keywords

The following keywords have a defined meaning within pricing rules and can be used. Each of the keyboards are shown as links which will take you to their usage instructions.

Usage

Specials

Tokens: A: or Special:

Format: A:?

The format A:? is the equivalent of asking if the current item being evaluated is a special (product).

Categories

Tokens: C: or Category:

Format: C:[product_category_display_id] or C:[modification_category_display_id]

The value for the [product_category_display_id] parameter should match the ProductCategoryDisplayID in the ProductCategories table. The value for the [modification_category_display_id] parameter should match the ModificationCategoryDisplayID in the ModificationCategories table.

Aggregation

Tokens: COUNT:(), MAX:(), MIN:(), SUM:()

Count

Tokens: COUNT:, (, ,, )

Format: COUNT:([atoms]) or COUNT:[count_greater_or_equal_to]([atoms])

The value for [atoms] is a comma separated list of atoms to test against. Returns the number [atoms] that return true. The value of [count_greater_or_equal_to] changes the return type of this atom into a boolean, where the result is true if the number of [atoms] is greater or equal to the value supplied.

Maximum

Tokens: MAX:, (, ,, )

Format: MAX:([atoms])

The value for [atoms] is a comma separated list of atoms of which to find the largest value.

Minimum

Tokens: MIN:, (, ,, )

Format: MIN:([atoms])

The value for [atoms] is a comma separated list of atoms of which to find the smallest value.

Summation

Tokens: SUM:, (, ,, )

Format: SUM:([atoms])

The value for [atoms] is a comma separated list of atoms to add together.

Modifications

Tokens: D: or Modification:

Format: D:[modification_display_id] or D:?

The value for the [modification_display_id] parameter should match the ModificationDisplayID in the Modifications table. If the current item being evaluated is a modification, the value returned will be true if the modification's display id matches. If the current item being evaluated is a product, the value returned will be true if the product has a modification attached to it where the modification's display id matches. The format D:? is the equivalent of asking if the current item being evaluated is a modification.

Modification Product

Tokens: D:P:, D:P:D:, Modification:Product: or Modification:Product:Modification

Format: D:P:[product_display_id] or D:P:D:[modification_display_id]

The value for the [product_display_id] parameter should match the ProductDisplayID in the Products table. The value returned will be true if the modification being evaluated is attached to a product with a matching display id. The format D:P:D:[modification_display_id] is the equivalent of asking if the modification that is being evaluated is attached to a product that with a matching modification display id.

Modification Product Tags

Tokens: D:P:T: or Modification:Product:Tag:

Format: D:P:T:[tag_name]

Used to determine if the modification is attached to a product that is tagged as the value specified in the [tag_name] parameter.

Modification Product Categories

Tokens: D:P:C: or Modification:Product:Category:

Format: D:P:C:[product_category_display_id]

Used to determine if the modification is attached to a product that is included in the category as specified by the value of the [product_category_display_id] parameter.

Nested Formulas

Tokens: F: or Formula:

Format: F:[parameter]

Executes the pricing rule with a name of [parameter]. This is primarily used in conjunction with the conditional operators, or to split expressions into shorter pieces.

The value for [parameter] should match PricingRuleLabel.

Conditionals

Tokens: EVERY:, I:, LIMIT:, SOME:

Every Condition

Tokens: EVERY: or ALL:, (, ,, )

Format: EVERY:([atoms])

The value for [atoms] is a comma separated list of atoms to test against. Returns true if all of the atoms test true.

Conditional Expressions

Tokens: I: or Conditional:, =>, ,

Format: I:[conditional]=>[expression_if_true],[expression_if_false]

Conditional expressions are defined using the above tokens. When these tokens are found within the expression, the expression is split into multiple parts. The [conditional] parameter is always executed to determine if it evaluates to a true or false value. If this evaluates to true, the [expression_if_true] parameter is executed. If it evaluates to false, the [expression_if_false] parameter is executed.

Limits

Tokens: LIMIT:, (, ,, )

Format: LIMIT:([atoms]) or LIMIT:[maximum]([atoms])

The value for [atoms] is a comma separated list of atoms to test against. The value of [maximum] indicates the threshold at which the result will be true (greater than [maximum]). If no [maximum] is supplied, it is assumed 0.

Some Conditions

Tokens: SOME: or ANY:, (, ,, )

Format: SOME:([atoms])

The value for [atoms] is a comma separated list of atoms to test against. Returns true if any of the atoms test true.

Style Options

Tokens: O: or StyleOption:

Format: O:[style_option_display_id] or O:[style_option_tag_name]

The value for the [style_option_display_id] parameter should match the StyleOptionDisplayID in the StyleOptions table. The value of [style_option_tag_name] should match the StyleOptionTag in the StyleOptionTags table.

Products

Tokens: P: or Product:

Format: P:[product_display_id] or P:?

The value for the [product_display_id] parameter should match the ProductDisplayID in the Products table. The format P:? is the equivalent of asking if the current item being evaluated is a product.

Product Modifications

Tokens: P:D: or Product:Modification:

Format: P:D:[modification_display_id] or P:D:?

The value for the [modification_display_id] parameter should match the ModificationDisplayID in the Modifications table. The value returned will be true if the product being evaluated has a modification attached to it where the modification's display id matches. The format P:D:? is the equivalent of asking if the current product has any modifications attached to it.

Product Modification Categories

Tokens: P:D:C: or Product:Modification:Category:

Format: P:D:C:[modification_category_display_id]

The value for the [modification_category_display_id] parameter should match the ModificationCategoryDisplayID in the ModificationCategories table. Returns true of the product being evaluated has any modifications attached to it which match the specified modification category.

Variable Price Codes

Tokens: M: or OEVariablePriceCode:

Format: M:[variable_code]

Used to obtain the price for the current item. The value specified for the [variable_code] parameter is used, alongside the current price group, to obtain the price for the current item. The value for the [variable_code] parameter must match the Code column in the OEVariablePriceCodes table.

Style Option Selections

Tokens: Q: or StyleOptionSelection:

Format: Q:[style_option_display_id] or Q:[style_option_tag_name]

The value for the [style_option_display_id] parameter should match the StyleOptionDisplayID in the StyleOptions table. The value of [style_option_tag_name] should match the StyleOptionTag in the StyleOptionTags table.

Prices

Tokens: R: or Price:

Format: R:[price_type] or R:[pricing_rule_label]

Used to obtain the price for the current item. Only four values are valid for the [price_type] parameter. These values are BOOK, LIST, PREMIUM or BASE. If [pricing_rule_label] is supplied, it executes the pricing rule with a name of [pricing_rule_label]. The value for [pricing_rule_label] should match PricingRuleLabel.

Tags

Tokens: T: or Tag:

Format: T:[tag_name]

Used to determine if the current item is tagged as the value specified in the [tag_name] parameter.

Upcharges

Tokens: U: or Upcharge:

Format: U:[style_option_category_short_name]

Used to obtain the price of an upcharge for the style option category that matches the [style_option_category_short_name] parameter for the current item. The value for the [style_option_category_short_name] must match the ShortName column in the StyleOptionCategories table.

Variables

Tokens: V: or Variable:

Format: V:[variable_code]

Used to obtain the value of a product variable for the current item. The value for the [variable_code] parameter must match the VariableCode column in the OEVariables table.

Modification Variables

Tokens: W: or ModificationVariable:

Format: W:[variable_code]

Used to obtain the value of a modification variable for the current item. The value for the [variable_code] parameter must match the VariableCode column in the OEVariables table.

Constants

Tokens: X: or Constant:

Format: X:[constant_name], X:[decimal], [decimal], "[string]" or [boolean]

Used to obtain the value of constant. The value for the [constant_name] parameter must match the ShortName column in the Constants table. If [decimal] is used, the value must be a string representation of a number. [string] can be any valid string, wrapped in double quotes. [boolean] can be true or false (case-insensitive).