QueueHelper Sample

This is a helper class with reusable methods for other samples or applications, particularly QueueSample. This sample demonstrates how to get queue information and report on various queue-related objects.

Note: The sample source assumes you created a session and supplied a user name and password with appropriate access privileges. The QueueHelper() constructor sets local variables to point to its SessionHelper and Logger objects, initialized by the main method.

Refer to the comments in the sample source for further information. The samples are located on the P8 Documentation CD or ESD image in:

   ecm_help\developer_help\process_java_api\Developer Files\samples\api

See also Running the API Samples.

Methods

General descriptions of the QueueHelper methods follow:

displayQueueContents()

Displays the contents of a Queue: properties of queue elements, step elements, and work objects. This method retrieves the queue information using the local methods displayQueueElements(), displayStepElements(), and displayWorkObjects().

displayQueueElementInfo()

Displays the properties of a single queue element with the following steps.

A field names array is set using VWQueueElement.getUserDefinedFieldNames

Properties of the queue element are logged individually using VWQueueElement.getWorkObjectNumber.

The VWQueueElement methods getWorkClassName(), getQueueName(), getOperationName(), getLockedStatus(), and getLockedMachine() are used to get additional property values, and the results are logged.

displayQueueElements()

Uses VWQueue.createQuery to get a VWQueueQuery object and VWQueueQuery.next to query the series of all queue elements. The local method displayQueueElementInfo() is used to display the queue element information.

displayQueueLockStatus()

Displays lock status information for all workflow queue elements and logs queue names.

displayQueueLockStatus() performs a query of all queue elements similar to displayQueueElements(), but it differs by controlling the loop with VWQueueQuery.next(). VWQueueElement.getLockedUser is used to find a locked work object, and VWQueueElement.getWorkObjectNumber is used to get the work object number.

displayQueueNames()

Logs all queue names using VWQueueElement.getQueueName.

displayStepElements() and displayWorkObjects()

These two methods display property information for a group of queue elements, step elements, or work objects. The processing steps these methods use are similar, and begin by setting up an iterative query of the elements/objects group, using VWQueue.createQuery and specifying the appropriate VWFetchType constant to get the VWQueueQuery object, and VWQueueQuery.next to iterate through the group of elements/objects.

getQueue()

Uses VWSession.getQueue to get the VWQueue object for the specified queue name.

getQueueNames()

Uses the VWSession session object flags to filter the queue names to be returned (by VWSession.fetchQueueNames).