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:  ProjectServerWebServices (in ProjectServerWebServices.dll)

Syntax

'Declaration
<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 Function GetJobCount ( _
    CorrelationGUIDs As Guid(), _
    jobStates As JobState(), _
    messageTypes As QueueMsgType() _
) As Integer
'Usage
Dim instance As QueueSystem
Dim CorrelationGUIDs As Guid()
Dim jobStates As JobState()
Dim messageTypes As QueueMsgType()
Dim returnValue As Integer

returnValue = instance.GetJobCount(CorrelationGUIDs, _
    jobStates, messageTypes)
[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 …]}

Remarks

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

Manage the Project Server queue. Global permission.

Examples

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);

See Also

Reference

QueueSystem Class

QueueSystem Members

WebSvcQueueSystem Namespace