GetType

Description

Returns the type (state-based or stateless) of the EntityDef.

Like the other parts of an EntityDef object, the type of an EntityDef object is determined by the corresponding record type, whose type is set by the administrator using HCL Compass Designer. The type cannot be set directly from the API.

Syntax

VBScript


entitydef.GetType 

Perl


$entitydef->GetType(); 
Identifier
Description
entitydef
An EntityDef object corresponding to a record type in a schema.
Return value
A Long whose value is an EntityType constants: REQ_ENTITY for a state-based EntityDef object or AUX_ENTITY for a stateless EntityDef object.

Examples

VBScript


set sessionObj  = GetSession
set entityDefObj = sessionObj.GetEntityDef(GetEntityDefName())

If entityDefObj.GetType = AD_REQ_ENTITY Then
   sessionObj.OutputDebugString "States of record type: " & _
         entityDefObj.GetName()

   ' List the possible states of the record
   nameList = entityDefObj.GetStateDefNames()
   For Each stateName in nameList
      sessionObj.OutputDebugString stateName
   Next
End If 

Perl


$sessionObj = $entity->GetSession();

$entityDefObj = $sessionObj->GetEntityDef($entity->GetEntityDefName());



if ($entityDefObj->GetType() eq $CQPerlExt::CQ_REQ_ENTITY)

 {

 $sessionObj->OutputDebugString("States of record type:
       ".$ entityDefObj->GetName());



 # List the possible states of the record

 $nameList = $entityDefObj->GetStateDefNames();

foreach $statename (@$nameList)
   {
  $sessionobj->OutputDebugString($statename);

  }

 }