Show TOC

Procedure documentationCreating a Definition Alias Locate this document in the navigation structure

 

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

Note Note

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

  • byte

  • short

  • int

  • long

  • float

  • double

  • boolean

  • char

End of the note.

Example 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()

End of the example.

You can create a definition alias in the Project Resources and at the ruleset level.

Prerequisites

You should have added Java classes to the DC.

Procedure

If you want to create a Definition Alias to be used across the DC
  1. Locate the Project Resources node (Where is the Project Resources node?) and double-click the 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 (Where is my ruleset?) and double-click 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 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.

End of the example.