GetStateDefNames

Description

Returns the state names defined in the EntityDef object.

Like the other parts of an EntityDef object, the administrator sets the defined states using Rational ClearQuest Designer. They cannot be set directly from the API.

Syntaxe

VBScript

entitydef.GetStateDefNames 

Perl

$entitydef->GetStateDefNames(); 
Identificateur
Description
entitydef
An EntityDef object corresponding to a record type in a schema.
Valeur renvoyée
For Visual Basic, a Variant containing an Array whose elements are strings. Each String contains the name of one state. If the EntityDef object has no states, the return value is an Empty variant. Dans Perl, référence à un tableau de chaînes.

Exemples

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)

  }

 } 

Commentaires en retour