Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

QueueSystem.GetJobCount method

Gets the number of jobs of the specified correlations, job states, and message types in the Project Server Queuing Service.

Namespace:  WebSvcQueueSystem
Assembly:  ProjectServerServices (in ProjectServerServices.dll)
[SoapDocumentMethodAttribute("http://schemas.microsoft.com/office/project/server/webservices/QueueSystem/GetJobCount", RequestNamespace = "http://schemas.microsoft.com/office/project/server/webservices/QueueSystem/", 
	ResponseNamespace = "http://schemas.microsoft.com/office/project/server/webservices/QueueSystem/", 
	Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public int GetJobCount(
	Guid[] CorrelationGUIDs,
	JobState[] jobStates,
	QueueMsgType[] messageTypes
)

Parameters

CorrelationGUIDs
Type: []

Array of job correlation GUIDs.

jobStates
Type: []

Array of JobState enumeration values.

messageTypes
Type: []

Array of QueueMsgType enumeration values.

Return value

Type: System.Int32
Count of jobs with { [corrID1 OR corrID2 OR …] AND [state1 OR state2 OR …] AND [type1 OR type2 OR …]}

Any of the parameters can be a null reference (Nothing in Visual Basic). For example, if CorrelationGUIDs and jobStates are both a null reference (Nothing in Visual Basic), GetJobCount returns the total number of jobs of the specified messageTypes.

If CorrelationGUIDs is a null reference (Nothing in Visual Basic), GetJobCount counts all correlations. If jobStates is a null reference (Nothing in Visual Basic), count all job states. If messageTypes is a null reference (Nothing in Visual Basic), count all message types.

Project Server Permissions

Permission

Description

ManageQueue

Allows the user to manage the Project Server queue. Global permission.

The following example returns the total number of queue jobs in the corGuid1 OR corGuid1 correlations that are of the ProjectPublish type AND in the Success state. The q variable is an initialized instance of WebSvcQueueSystem.QueueSystem.

Guid[] correlationGuids = { corGuid1, corGuid2 };
WebSvcQueueSystem.JobState[] jobStates = { WebSvcQueueSystem.JobState.Success };
WebSvcQueueSystem.QueueMsgType[] jobTypes = { WebSvcQueueSystem.QueueMsgType.ProjectPublish };

int numJobs = q.GetJobCount(null, jobStates, jobTypes);

The following example returns the number of publish jobs plus the number of save jobs in the OnHold OR Failed state.

WebSvcQueueSystem.JobState[] jobStates = { WebSvcQueueSystem.JobState.OnHold, 
                                           WebSvcQueueSystem.JobState.Failed };
WebSvcQueueSystem.QueueMsgType[] jobTypes = { WebSvcQueueSystem.QueueMsgType.ProjectPublish, 
                                              WebSvcQueueSystem.QueueMsgType.ACProjectSave };
int numJobs = q.GetJobCount(null, jobStates, jobTypes);

The following example returns the total number of jobs in the OnHold OR Failed state.

WebSvcQueueSystem.JobState[] jobStates = { WebSvcQueueSystem.JobState.OnHold, 
                                           WebSvcQueueSystem.JobState.Failed };
int numJobs = q.GetJobCount(null, jobStates, null);
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.