사용자 정의 메시지 생성

ClearQuest® 클라이언트 및 ClearQuest Web 클라이언트를 통해 후크는 일반 후크 오류 메시지에 경보 메시지 매개변수를 임베드하여 사용자에게 오류, 경고, 정보 경보 메시지를 표시할 수 있습니다. 그러나 Windows용 ClearQuest 클라이언트, 사용자가 작성한 스크립트, 이전 클라이언트는 경보 메시지 매개변수를 인식하지 못할 수 있으므로 스키마에 이를 추가한 후 아래 글로벌 후크를 통해 이 기능에 액세스해야 합니다. 클라이언트가 사용자 정의 메시지를 지원하지 않는 경우 후크는 일반 die문의 메시지 매개변수를 사용합니다. 클라이언트가 사용자 정의 메시지를 지원하는 경우 후크는 DieWithCustomMessage 함수를 사용합니다.

아래 DieWithCustomMessage 함수는 die문을 사용할 수 있는 모든 위치에서 호출할 수 있으며 현재 조작에서 die문과 동일한 효력을 가집니다. 예를 들어, 액세스 제어 후크에서 DieWithCustomMessage 함수를 호출하면 die문이 실패를 표시하는 방법과 정확하게 동일한 방법으로 사용자 정의 메시지를 사용하여 실패를 표시합니다.

글로벌 후크 코드 다운로드에 대한 지시사항은 http://www.ibm.com/support/docview.wss?&rs=939&uid=swg21322606의 기술 노트 1322606을 참조하십시오.

예제

Perl 예제

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;
}

VBScript 예제

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

피드백