使用連結鉤來偵測 Web 階段作業

撰寫連結鉤時,您可以使用 Rational® ClearQuest® API 來偵測使用者是否使用 Web 用戶端。如果您尚未調整綱目來符合 Web 上可用的功能,此資訊可讓您採取適當的動作。

例如,當您在一個函數中偵測到 Web 階段作業,且它建立了訊息框或新視窗,您可以呼叫已針對 Web 環境修改的程式碼,或結束該函數。 下列程式碼範例可用來偵測 Web 階段作業。

VBScript

dim currDBSession ' Current Db session
set currDBSession = GetSession

' Test for existence of the web session variable.
if currDBSession.HasValue ("_CQ_WEB_SESSION") then
' Either exit or do something else
end if

Perl

my $currDBSession; # Current Db session
$currDBSession = $entity->GetSession();
# Test for existence of the web session variable
if ( $currDBSession->HasValue ("_CQ_WEB_SESSION") {
# Either exit or do something else
}

意見