Using the HCL Compass API

This topic provides an overview of the tasks you can perform with the HCL Compass Web client API.

You can use the HCL Compass API to customize predefined hooks, to write your own hooks, and to write external applications that perform tasks against HCL Compass databases.

For details about the objects, methods, properties, and constants that you can use when you write hooks or external applications, see the Compass API Reference.

Working with sessions

The Session object represents the current database-access session and is the starting point of all operations. If you are writing hooks, access to the current Session object is provided through the GetSession method of the Entity object. Because hooks operate in the context of modifying a record (entity), you always have a corresponding Entity object from which to call GetSession.

If you are writing an external application to access HCL Compass databases, you must create a Session object and log in to the database. To work with an entity, you must then call the API that returns the entity object.

For more information, see Working with sessions Working with sessions in the Compass API Reference.

Working with queries

You can run queries to retrieve data from a HCL Compass database based on a set of search criteria that you provide. To build a query:

  1. Build a query by using the QueryDef object to specify the data to retrieve.
  2. Create a ResultSet object to hold the data.
  3. Run the query to retrieve the data in the result set.
  4. Access the data.

To learn how to build a query by using objects such as QueryDef and ResultSet, see Working with queries in the Compass API Reference.

Working with records

When users enter change requests, the data is stored in a logical record called an entity. You can create, edit, and view record data and view data about the record entity type. Use the BuildEntity method to create a record; use the EditEntity method to edit an existing record. The HCL Compass API also provides methods for validating changes and committing the updated record to the database.

For more information, see Working with records in the Compass API Reference.