The Session object is the entry point for accessing Rational ClearQuest databases. If you are writing an external application, you must create a Session object and use it to log on to a database. After you have logged on to a database, you can use the Session object to:
For script hooks (VBScript and Perl), IBM Rational ClearQuest creates a Session object for your hooks automatically when the user logs on to the database. The Session object is available through the Entity object. In the context of a hook, to get a Session object from an entity object, use the following syntax.
VBScript hooks implicitly associate the Entity object with the current record.
For external applications, you must create a Session object manually. If you want to use the AdminSession object, the same rule applies.
set currentSession = CreateObject("CLEARQUEST.SESSION")
set adminSession = CreateObject("CLEARQUEST.ADMINSESSION")
$currentSession = CQSession::Build(); $currentAdminSession= CQAdminSession::Build();
When you are done with the object, destroy it:
CQSession::Unbuild($currentSession); CQAdminSession::Unbuild($currentAdminSession);