Skip to content

Martini Tracker Functions

The Tracker class in Martini is essential for managing and manipulating Tracker-related data. This class provides a comprehensive suite of functions for various operations, tailored for use in both Groovy and other relevant programming environments. These functionalities include:

  • Fetching Tracker-related beans: Essential for initializing and managing Tracker instances.
  • Document Operations:
  • Adding new Tracker documents.
  • Retrieving existing Tracker documents.
  • Deleting unwanted Tracker documents.
  • Document Type Management:
  • Adding new document types to the Tracker.
  • Retrieving existing document types.
  • Document State Operations:
  • Adding states to Tracker documents.
  • Retrieving existing document states.
  • Logging and Properties:
  • Adding logs to Tracker documents.
  • Managing document-specific properties.
  • Search Index Queries: Executing sophisticated queries against the Tracker's search index to retrieve relevant documents and data.

Usage Examples

The following examples illustrate common operations performed using the Tracker class in a Groovy environment.

Adding a Document State

This example demonstrates adding a new state to a Tracker document. This is useful for lifecycle management of documents.

1
2
3
4
5
// Identifier for the document
def internalId = 'your-document-id'

// Add a new document state
internalId.addDocumentState('Started')

Performing a Search in Tracker

Executing a search in the Tracker is straightforward. This example performs a basic search using a wildcard query.

1
2
3
4
5
// Search query using a wildcard
def query = '*:*'

// Perform the search
query.searchTracker()

The Tracker class's functions are designed to be intuitive and easy to integrate into your existing Martini workflows, ensuring a seamless experience in managing Tracker-related operations.