Agent Methods

In this section, we discuss the agent class methods. The methods are discussed in alphabetical order.

Syntax

Delete()

Description

Use the Delete method to delete an agent from the database. You cannot delete an agent that has still has open tasks.

Parameters

None.

Returns

A number. The values are:

Value

Description

0

Agent deleted successfully.

1

Invalid agent ID.

2

Agent has accepted task and cannot be deleted.

3

Other SQL error in executing deletion. Possibly there are errors in the child tables.

Example

import PT_MCF_UQAPI:*;


   &testAgent = create PT_MCF_UQAPI:Agent("QEMGR");
   
   /* Delete an UQ Agent definition */
   &retCode = &testAgent.Delete();
   

Syntax

Refresh()

Description

Use the Refresh method to refresh the properties of the agent.

An agent on a queue is processing tasks as they are assigned to them. Use this method to see realtime statistics on how much load an agent has, or possibly before running any metrics.

If you're interested in how tasklists have changed, use the RefreshQTaskList method instead.

Parameters

None.

Returns

None.

Example

The following refreshes all the properties of the agent:

&MyAgent.Refresh();

Syntax

RefreshQTaskList(PhysQ)

Description

Use the RefreshQTaskList method to refresh the task list properties for the specified physical queue.

You might use this method if you're interested in seeing the realtime statistics for a particular tasklist. If you are only interested in an agent's work, use the Refresh method.

Parameters

Field or Control

Definition

PhysQ

Specify a physical queue ID as a string.

Returns

None.

Example

The following refreshes all task lists on the first physical queue of the agent:

&MyAgent.RefreshQTaskList(&myAgent.PhysicalQueueID [1]);