DoesTransitionExist
Description
Returns the list of transitions that exist between two states.
The list of transitions is returned in no particular order. You must examine each entry in the array until you find the name of the action you are looking for.
Syntax
VBScript
entitydef.DoesTransitionExist
sourceState, destState
Perl
$entitydef->DoesTransitionExist
(sourceState, destState);
- Identifier
- Description
- entitydef
- An EntityDef object corresponding to a record type in a schema.
- sourceState
- A String containing the name of the state that is the source of the transition.
- destState
- A String containing the name of the state that is the destination of the transition.
- Return value
- For Visual Basic, if at least one transition between the two
states exists, this method returns a Variant containing a list of strings.
Each string corresponds to the name of an action. If no transitions exist,
this method returns an EMPTY variant.
For Perl, if at least one transition between the two states exists, this method returns a reference to an array of strings.
Examples
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]);
}