Show TOC

AliasLocate this document in the navigation structure

Use

Aliases allow you to express a rule in a manner that is easy to understand. An alias is the representation of a Java method or object in a language understandable to the user. Aliases allow functional users to manage rules without knowing the underlying code. An alias hides the underlying Java code and presents the rules in simple language to the user.

Rules composer also allows you to specify the schema elements, classes and member methods that should be active and available while you create rules. By default, all the schema elements, classes and member methods are active and available. By specifying a schema or class as active, you make the 'schema and its elements' or 'class and its members' available to all rules, conditions, and actions in all rulesets. Only active 'schemas and elements' or 'classes and members' are available in the drop-down lists in conditions and actions.

Example
  • Consider a Java class: Buyer , which has a method : getName () .

    The alias for this Java class can be: The buyer's name .

    The Java class used as it is in a condition appears as : Buyer.getName is John Doe .

    The same Java class when substituted with an alias appears as follows: The buyer's name is John Doe .

  • Consider a schema: CallCharges , which has an element: ConnectionProvider

    The alias for this schema can be: The Connection Provider

    The schema used as it is in a condition appears as : CallCharges/ConnectionProvider Equals null

    The same schema when substituted with an alias appears as follows: The Connection Provider Equals null

Aliases with Arguments

  • If the Java method takes arguments, you can create aliases which allow you to position the arguments anywhere in the alias and also specify a business term to represent the argument.

    Example

    Consider a Java class: Buyer , which has a method: setDiscount {int} (the argument representing the percentage of discount)

    The alias for this Java class can be: Grant a discount of {double} percent to the buyer .

  • If the argument has been assigned a value, for example 10 , then the alias appears as: Grant a discount of 10 percent to the buyer .

    As you can see in the above example curly braces { } are the delimiters which identify the position of an argument. The value within the curly braces can be used to denote the business term signifying the argument.

    The order of the curly brace delimited argument holders should be in the order of the arguments.

    Example

    If you have a method transferMoney(int fromAccount, int toAccount), the alias can be as follows::

    Transfer the money from {string} to {string}.