Aborts a job in the Job Processor database.
[FaultContractAttribute(System.Type)]
[OperationContractAttribute()]
public AbortJobResponse AbortJob(
AbortJobRequest request
)
request
An Leadtools.Services.JobProcessor.DataContracts.AbortJobRequest class containing information about the job to be aborted.
An Leadtools.Services.JobProcessor.DataContracts.AbortJobResponse class that indicates whether the job was successfully marked for aborting.
Use this method to mark a job for aborting. When calling the method, the cMustAbort column for the specified job is set to 1. The worker assembly is notified to abort the job via calls to the UpdatePercentage method. The job is not actually aborted (where the job status is set to JobStatus.Aborted) until the worker processing this job calls the SetAbortedStatus method from the worker assembly.
For more information, refer to Creating Job Processor Worker Assemblies.
using LeadtoolsJobProcessorExamples.JobService;
public void AbortJob(string jobID)
{
using (JobServiceClient jobServiceClient = new JobServiceClient())
{
AbortJobRequest abortJobRequest = new AbortJobRequest();
abortJobRequest.ID = jobID;
abortJobRequest.Reason = "Duplicate Job";
AbortJobResponse abortJobResponse = jobServiceClient.AbortJob(abortJobRequest);
if (abortJobResponse.IsAborted)
Console.WriteLine("The job was successfully aborted.");
else
Console.WriteLine("The job was not aborted.");
}
}