Extension Rules

Extension rules extend the functionality of a configurator model with code that you write using established interfaces, to support business requirements that may not be available through statement rules.

  • An extension rule is bound to one or more predefined events that can happen during a configuration session. Example: A change in the value of a decimal feature node.

  • An extension rule is associated with a base node. The base node is the model node on which the rule is listening for the events bound to the rule. Listening for events means detecting the occurrence of events. Example: The specific decimal feature node whose value changed.

  • The behavior of an extension rule is defined by its rule text, which is a valid script in the Groovy scripting language. Simple example: A function defined in Groovy calculates the effect of applying a different discounts to the list price of an item, in order to arrive at the sale price.

    Caution: This simplified example is for instructional purposes only. The pricing information displayed in Configurator at run time is normally provided by integration with Oracle Pricing.
  • In order to call a specific Groovy function defined in the script, the function is bound to the occurrence of an event, in an event binding. Example: The invocation of the discounting function is bound to a change in the value of the decimal node whose changed value is the new discount to apply.

  • To provide flexibility, a bound event can be listened for inside a specified event binding scope. Example: a change in node value is listened for only on the base node of the rule.

  • If the bound function has arguments, then each argument must be bound to the source of a value for the argument, in an argument binding. Example: The discounting function has arguments for the list price and the discount; the list price argument is bound to the model node in which an end user enters the list price, and the discount argument is bound to the model node in which an end user enters the discount.

  • If the base node can have multiple instances, then an instantiation scope must be specified, to determine, when the rule is invoked, whether a separate instance of the rule is created for each instance of the base node, or a single instance of the rule is created for the whole set of instances of the base node.