遷移先の状態のタスクのトリガ

条件ロジックをいくつか適用するために、現在アクションを行なっているレコードの遷移先の状態を判別できます。次に、いくつかの例を示します。

次のアクション通知フックは、現在のレコードが閉じている場合、遷移先の状態を取得して電子メールを送信します。

注: このアクション通知フックはベース アクションを使用します。ベース アクションは、アクションごとに発生するアクションです。ベース アクションは、アクションごとに起動される電子メール通知フックなどの、複数回起動するフックの場合に便利です。

VBScript

Sub Defect_Notification(actionname, actiontype)

   Dim cqSes ' a Session object

   Dim entDef ' an EntityDef object

   Dim actionname ' a String

   Dim actiontype ' a 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 

Perl

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}

} 

フィードバック