GetStateDefNames

Descrizione

Restituisce i nomi di stato definiti nell'oggetto EntityDef.

Come per le altre parti di un oggetto EntityDef, l'amministratore imposta gli stati definiti utilizzando Rational ClearQuest Designer. Tali stati non possono essere impostati direttamente dall'API.

Sintassi

VBScript

entitydef.GetStateDefNames 

Perl

$entitydef->GetStateDefNames(); 
Identificativo
Descrizione
entitydef
Un oggetto EntityDef corrispondente ad un tipo di record in uno schema.
Valore di ritorno
Per Visual Basic, un valore Variant contenente un array i cui elementi sono stringhe. Ogni stringa contiene il nome di uno stato. Se l'oggetto EntityDef non contiene stati, il valore di ritorno sarĂ  un valore variant vuoto. In Perl, un riferimento ad un array di stringhe.

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