Getting Symbolic Names

This section shows you how to retrieve the symbolic name of an object using Java and Tcl.

The following topics are discussed:

Java

The method described below can be used to get symbolic names for administrative objects in JSPs, JavaBeans, and JPOs.

To get the symbolic name for an administrative object, use this method:

FrameworkUtil.getAliasForAdmin(context, "Type", "admin name", 
"useCache value"); 

where:


  • "Type" is the administrative type, such as Type, Attribute, Relationship, etc.
  • "admin name" is the name of the administrative object, such as Part or Quantity
  • "useCache value" is a Boolean to get the value from the cache or from the database: True gets the value from cache and false gets it from the database

For optimum performance, obtain the symbolic name from the cache and not from the database.

Example 1

To get the symbolic name for the Part type administrative object Part from the cache, use this code:

String typePart = FrameworkUtil.getAliasForAdmin(context, 
"Type", "Part", true);

The code would return "type_Part".

Example 2

To get the symbolic name for the EBOM relationship administrative object from the cache, use this:

String relEBOM = FrameworkUtil.getAliasForAdmin(context, 
"Relationship", "EBOM", true);

The code would return "relationship_EBOM".

For more information on symbolic names for administrative objects, see How the System Identifies Administrative Objects: Symbolic Name Properties.

Tcl

This section describes how to get the symbolic name for administrative objects when writing a Tcl program, although Java is the preferred method for writing programs. You should use a JPO instead of Tcl for triggers.

The program eServiceSchemaVariableMapping.tcl contains the procedure emxGetPropertyFromAdminName that gets the symbolic name for an administrative object. The signature for using the procedure is:

proc emxGetPropertyFromAdminName {sAdminType sRegProg 
sAdminName} 

where:


  • sAdminType is the administrative object type, such as attribute, type, relationship
  • sRegProg is the name of the program on which all the administrative object's properties are registered
  • sAdminName is the current name of the administrative object whose symbolic name you want

For example, to get the symbolic name for the attribute named Originator:

set sAttOriginatorProperty [emxGetPropertyFromAdminName 
"attribute" eServiceSchemaVariableMapping.tcl Originator]

Use the emxGetPropertyFromStateName procedure to get the symbolic name for a state. the signature for using the procedure is:

proc emxGetPropertyFromStateName {sPolicyName sStateName}  

where:


  • sPolicyName is the name of the policy that contains the state
  • sStateName is the name of the state whose symbolic name you want

For example:

set sStateProp [emxGetPropertyFromStateName Person Active]