About this task
The common sequence for using ClearQuest API functions begins
with these steps:
- Start a ClearQuest session.
- Log on to a ClearQuest database.
- Work with ClearQuest records.
- End the ClearQuest session.
For external applications, you must create a Session object and use
it to log in to a user database.
Syntax for creating a Session object:
require CQPerlExt;
$CQsession = CQSession::Build();
Next, you can login to a database by calling the
UserLogon method
of the newly created Session object or first get a list of accessible databases.
When
you are done with the session, you delete the Session object
with the
Unbuild method. Syntax for releasing a Session object:
CQSession::Unbuild($session);
Hooks are attached to events that occur when a user interacts
with IBM Rational ClearQuest. Because hooks execute at predefined times during
the middle of a session, your hook code does not end a session. The session
ends automatically when the user logs off. However, when you write an external
application, you must end the current session by deleting the Session object
that you have created. Delete any objects that you explicitly created and
do not need any more, including a Session object.