Getting a Session object
About this task
The common sequence for using Rational®
ClearQuest® API functions begins with these steps:
For external applications, you must create a Session object and use it to log in to a user
database. - Start a Rational ClearQuest session.
- Log on to a Rational ClearQuest database.
- Work with Rational ClearQuest records.
- End the Rational ClearQuest session.
Syntax for creating a Session
object:
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. require CQPerlExt;
$CQsession = CQSession::Build();
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 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.