DoesTransitionExist

Description

Restituisce l'elenco di transizioni esistente tra due stati.

L'elenco di transizioni non viene restituito in un ordine specifico. È necessario esaminare ogni voce del vettore fino a quando non si individua il nome dell'azione desiderato.

Sintassi

VBScript

entitydef.DoesTransitionExist sourceState, destState 

Perl

$entitydef->DoesTransitionExist(sourceState, destState); 
Identificativo
Description
entitydef
Un oggetto EntityDef corrispondente ad un tipo di record in uno schema.
sourceState
Un valore String contenente il nome dello stato, ovvero l'origine della transizione.
destState
Un valore String contenente il nome dello stato, ovvero l'origine della transizione.
Valore di ritorno
Per Visual Basic, se esiste almeno una transizione tra i due stati, questo metodo restituisce un valore Variant contenente un elenco di stringhe. Ogni stringa corrisponde al nome di un'azione. Se non esiste alcuna transizione, questo metodo restituisce una variante EMPTY.

Per Perl, se esiste almeno una transizione tra i due stati, questo metodo restituisce un riferimento ad un vettore di stringhe.

Esempi

VBScript

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

transitions = entityDefObj.DoesTransitionExist("open", "resolved")
If transitions <> Empty Then
   ' Simply initiate an action using the first entry.
   sessionObj.EditEntity entity, transitions(0)

   ' ...
End If 

Perl

$sessionObj = $entity->GetSession();

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



$transitions = $entityDefObj->DoesTransitionExist("open",
       "resolved");



if (@$transitions)

 {

 # Simply initiate an action using the first entry.

 $sessionObj->EditEntity($entity, @$transitions[0]);

 } 


Feedback