ClearQuest® 클라이언트 및 ClearQuest Web 클라이언트에서는 일반적인 후크 오류 메시지 내에 경보 메시지 매개변수를 포함시키는 방법을 통해 후크를 사용하여 오류, 경고 및 정보 경보 메시지를 사용자에게 표시할 수 있습니다. 하지만 Windows용 ClearQuest 클라이언트, 사용자 작성 스크립트 및 기존 버전의 클라이언트에서는 경보 메시지 매개변수를 인식할 수 없으므로 먼저 아래 글로벌 후크를 스키마에 추가한 후 글로벌 후크를 통해 이 기능에 액세스해야 합니다. 클라이언트가 사용자 정의 매개변수를 지원하지 않을 경우 후크는 일반 die 명령문의 메시지 매개변수를 사용합니다. 클라이언트가 사용자 정의 메시지를 지원할 경우 후크는 DieWithCustomMessage 함수를 사용합니다.
아래 DieWithCustomMessage 함수는 die 명령문을 사용할 수 있는 모든 위치에서 호출할 수 있으며, 이는 현재 오퍼레이션에서 die 명령문을 사용하는 것과 동일한 효과를 제공합니다. 예를 들어, 액세스 제어 후크에서 DieWithCustomMessage 함수를 호출하는 것은 사용자 정의 메시지를 사용한다는 점을 제외하면 die 명령문과 동일한 방식으로 실패를 나타낸다.
글로벌 후크 코드를 다운로드하는 방법에 대한 지시사항은 기술 노트 1322606(http://www.ibm.com/support/docview.wss?&rs=939&uid=swg21322606)을 참조하십시오.
sub Defect_generate_error_message {
my($result);
my($param) = @_;
# record type name is Defect
$error_summary="ReturnCustomErrorMessage";
$error_details="Error message: Clicking this button will activate a computer virus!";
# $result=&DieWithCustomMessage($error_summary,$error_details,"ERROR");
DieWithCustomMessage("ERROR",$error_summary, $error_details);
return $result;
}
sub Defect_generate_warning_message {
my($result);
my($param) = @_;
# record type name is Defect
$error_summary="ReturnCustomWarningMessage";
$error_details="Warning message: Do not smoke at the work place!";
DieWithCustomMessage("WARNING",$error_summary, $error_details);
return $result;
}
sub Defect_generate_info_message {
my($result);
my($param) = @_;
# record type name is Defect
$error_summary="ReturnCustomInfoMessage";
$error_details="Information message: Welcome to Beijing!";
DieWithCustomMessage("INFO", $error_summary, $error_details);
return $result;
}
Function recordtype_ErrorMessage(param)
' param As Variant
' record type name is recordtype
REM add your hook code here
Dim error_summary
Dim error_details
error_summary="ReturnCustomErrorMessage"
error_details="Error message: Clicking this button will activate a computer virus!"
' $result=&DieWithCustomMessage($error_summary, $error_details,"ERROR");
call DieWithCustomMessage("ERROR",error_summary, error_details)
End Function
Function recordtype_WarningMessage(param)
' param As Variant
' record type name is recordtype
REM add your hook code here
Dim error_summary
Dim error_details
error_summary="ReturnCustomWarningMessage"
error_details="Warning message: Do not smoke at the work place!"
call DieWithCustomMessage("WARNING",error_summary, error_details)
End Function
Function recordtype_InfoMessage(param)
' param As Variant
' record type name is recordtype
REM add your hook code here
Dim error_summary
Dim error_details
error_summary="ReturnCustomInfoMessage"
error_details="Information message: Welcome to Beijing!"
call DieWithCustomMessage("INFO",error_summary, error_details)
End Function