QueueSystem.CancelJob Method
Cancels the specified job in the Project Server Queuing Service. Allows correlated and incomplete jobs to be cancelled.
Namespace: WebSvcQueueSystem
Assembly: ProjectServerWebServices (in ProjectServerWebServices.dll)
Syntax
'Declaration
<SoapDocumentMethodAttribute("http://schemas.microsoft.com/office/project/server/webservices/QueueSystem/CancelJob", 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 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("http://schemas.microsoft.com/office/project/server/webservices/QueueSystem/CancelJob", 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 void CancelJob(
Guid jobUID,
bool cancelCorrelationJobs,
bool cancelSendIncompleteJobs
)
Parameters
- jobUID
Type: System.Guid
Queue job GUID.
- 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 ([T:WebSvcQueueSystem.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 |
---|---|
Manage the Project Server queue. Global permission. |