QueueSystem.CancelJob Method

Cancels the specified job in the Project Server Queuing Service. Allows correlated and incomplete jobs to be cancelled.

Namespace:  [QueueSystem Web service]
Service reference: http://ServerName:32843/[Project Service Application GUID]/PSI/QueueSystem.svc
Web service reference: http://ServerName/ProjectServerName/_vti_bin/PSI/QueueSystem.asmx?wsdl

Syntax

'Declaration
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/office/project/server/webservices/QueueSystem/CancelJob", RequestNamespace := "https://schemas.microsoft.com/office/project/server/webservices/QueueSystem/",  _
    ResponseNamespace := "https://schemas.microsoft.com/office/project/server/webservices/QueueSystem/",  _
    Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Sub CancelJob ( _
    jobUID As Guid, _
    cancelCorrelationJobs As Boolean, _
    cancelSendIncompleteJobs As Boolean _
)
'Usage
Dim instance As QueueSystem
Dim jobUID As Guid
Dim cancelCorrelationJobs As Boolean
Dim cancelSendIncompleteJobs As Boolean

instance.CancelJob(jobUID, cancelCorrelationJobs, _
    cancelSendIncompleteJobs)
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/office/project/server/webservices/QueueSystem/CancelJob", RequestNamespace = "https://schemas.microsoft.com/office/project/server/webservices/QueueSystem/", 
    ResponseNamespace = "https://schemas.microsoft.com/office/project/server/webservices/QueueSystem/", 
    Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public void CancelJob(
    Guid jobUID,
    bool cancelCorrelationJobs,
    bool cancelSendIncompleteJobs
)

Parameters

  • cancelCorrelationJobs
    Type: System.Boolean
    If true, cancel correlated jobs.
  • cancelSendIncompleteJobs
    Type: System.Boolean
    If true, also cancel jobs that are still getting queued (the JobState is SendIncomplete).

Remarks

CancelJob sets the job completion state (JobState) of the specified job to Canceled. If cancelCorrelationJobs is false, the result is functionally equivalent to setting the state to FailedNotBlocking; that is, the current job failed, but correlated jobs farther down the queue continue to process.

Note

There is a potential race condition between checking the state of a job and calling CancelJob. When an application checks the state of a job, the state might be ReadyForProcessing. Before calling CancelJob, the state can switch to Processing or any other state.

Project Server Permissions

Permission

Description

ManageQueue

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

See Also

Reference

QueueSystem Class

QueueSystem Members

QueueSystem Web Service

CancelCorrelation

GetJobCompletionState