BatchPurgeQueue - Intergraph Batch Services - Help

Intergraph Batch Services Help

Language
English
Product
Intergraph Batch Services
Search by Category
Help

Description

Removes all jobs from the named queue that are not in the RUNNING or TRANSITING state. The caller must have operator privileges on the server.

Syntax

DWORD BatchPurgeQueue(LPCTSTR queuename);

Parameter

LPCTSTR queuename

Specifies the name of the queue to purge.

Return Values

BATCH_ERROR_NO_SUCH_QUEUE

The queue does not exist.

BATCH_ERROR_BAD_QUEUE_NAME

The syntax of the queue name was not valid.

BATCH_ERROR_OPERATOR_ACCESS_DENIED

The user does not have operator privileges.

Example Program

#include <iostream.h>

#include "batchapi.h"

#define MAX_LENGTH 25

void main()

{

char * pTemp;

LPCTSTR QueName;

DWORD ReturnVal;

cout << " STARTING THE EXECUTION OF BATCHPURGEQUEUE API " << endl;

pTemp = new char [MAX_LENGTH];

if (pTemp == NULL){

cout << "unable to allocate the memory.\n Exiting the program"<<endl;

exit(0);

}

cout << " Enter the Queue to Purge ";

cin >> pTemp;

QueName = (const char *)pTemp;

ReturnVal = BatchPurgeQueue(QueName);

switch(ReturnVal)

{

case BATCH_ERROR_NO_SUCH_QUEUE :

cout << " The queue does not exist. " << endl;

break;

case BATCH_ERROR_BAD_QUEUE_NAME :

cout << " The syntax of the queue name was not valid. " << endl;

break;

case BATCH_ERROR_OPERATOR_ACCESS_DENIED :

cout << " The user does not have operator privileges. " << endl;

break;

default:

cout << "SUCCESSFUL COMPLETION OF PURGING THE QUEUE "<< endl;

}

cout << " COMPLETED THE EXECUTION OF BATCHPURGEQUEUE API " << endl;

delete [] pTemp;

}