Para aplicar alguna lógica condicional, puede determinar el estado de destino del registro que está experimentando, actualmente, una acción. A continuación, se incluyen algunos ejemplos:
El enganche de notificación de acción siguiente obtiene el estado de destino y envía un correo electrónico si se va a cerrar el registro actual.
Sub Defect_Notification(actionname, actiontype) Dim cqSes ' a Session object Dim entDef ' an EntityDef object Dim actionname ' String Dim actiontype ' Long ' action = test_base set cqSes = GetSession ' NOTE: You can also have conditional logic based on the ' current action set entDef = cqSes.GetEntityDef(GetEntityDefName) if entDef.GetActionDestStateName(actionName) = "Closed" then ' put send notification message code here end if End Sub
sub Defect_Notification {
my($actionName, $actiontype) = @_;
# $actionName as string scalar
# $actiontype as long scalar
# action is test_base
$actionName = $entity->GetActionName();
# NOTE: You can also have conditional logic based on the
# current action
# You can use the $session variable that Rational ClearQuest provides.
$entDef = session->GetEntityDef($entitiy->GetEntityDefName());
if ($entDef->GetActionDestStateName($actionName) eq "Closed")
{# put send notification message code here}
}