Show TOC

Creating a Definition AliasLocate this document in the navigation structure

Use

The aliases of operations on definitions whose return type is non-primitive are called definitions aliases.

For more information, see Definition

Note

The eight primitive return types supported by the Java programming language are:

  • byte

  • short

  • int

  • long

  • float

  • double

  • boolean

  • char

Example

Address custAddress = null is a Definition Alias.

The Address object has operations like getCity() , getCountry() .

Definition Aliases of custAddress are:

  • custAddress.getCity()

  • custAddress.getCountry()

You can create a definition alias in the project resources and at the ruleset level.

For more information, see Project Resources

Prerequisites

You must have added Java classes to DC.

For more information, see Adding a Class

Procedure
If you want to create a Definition Alias to be used across the DC
  1. Locate the Project Resources node and double-click the node.

    For more information, see Locating the Project Resources Node

  2. In the Project Resources editor, choose the Definitions tab.

If you want to create a Definition Alias to be used within a ruleset
  1. Locate the ruleset and double-click the ruleset.

    For more information, see Locating the Ruleset

  2. In the ruleset editor, choose the Definitions tab.

  3. In the definition editor create a definition whose return type is non- primitive and save the changes.

  4. In the Project Resources editor and the ruleset editor, choose the Aliases tab to view the Definition Aliases.

Example

Let us consider a Java type - StringBuffer [java.lang] .

  1. In the Project Resources editor, choose the Aliases tab.

  2. In the Alias Name table , select the StringBuffer [java.util.StringBuffer] checkbox.

  3. Save the changes.

  4. In the Project Resources editor, choose the Common Definitions tab.

  5. In the definition editor, in the Variable Definitions section, choose the Add icon and in the drop down that appears, choose StringBuffer[java.lang] .

  6. Choose StringBuffer1 and in the inline textbox enter messageBuffer and press Enter

  7. Choose null and in the drop down menu that appears, expand the StringBuffer[java.lang] and choose new StringBuffer .

  8. Save the changes.

    In the Project Resources editor, choose the Aliases tab and you should see the messageBuffer node.

  9. Expand the messageBuffer node to see all the all definition aliases.

More Information