GetType

Descrizione

Restituisce il tipo (basato sullo stato o stateless) dell'oggetto EntityDef.

Come per le altre parti di un oggetto EntityDef, il tipo di un oggetto EntityDef viene determinato dal tipo di record corrispondente, il cui tipo viene impostato dall'amministratore tramite l'utilizzo di Rational ClearQuest Designer. Il tipo non può essere impostato direttamente dall'API.

Sintassi

VBScript

entitydef.GetType 

Perl

$entitydef->GetType(); 
Identificativo
Descrizione
entitydef
Un oggetto EntityDef corrispondente ad un tipo di record in uno schema.
Valore di ritorno
Un valore Long i cui valori sono Costanti EntityType: REQ_ENTITY per un oggetto EntityDef basato sullo stato o AUX_ENTITY per un oggetto EntityDef stateless.

Esempi

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);

  }

 } 

Feedback