ResetJob Method

Summary

Resets a job's status to JobStatus.New and initializes all of its fields.

Syntax
C#
VB
C++
[FaultContractAttribute(System.Type)] 
[OperationContractAttribute()] 
public ResetJobResponse ResetJob( 
   ResetJobRequest request 
) 
  
<FaultContractAttribute(DetailType=Leadtools.Services.JobProcessor.FaultContracts.CloudFault,  
   Action="",  
   Name="",  
   Namespace="",  
   ProtectionLevel=ProtectionLevel.None,  
   HasProtectionLevel=False)> 
<OperationContractAttribute()> 
Function ResetJob( _ 
   ByVal request As ResetJobRequest _ 
) As ResetJobResponse 
[FaultContractAttribute(DetailType=Leadtools.Services.JobProcessor.FaultContracts.CloudFault,  
   Action="",  
   Name="",  
   Namespace="",  
   ProtectionLevel=ProtectionLevel.None,  
   HasProtectionLevel=false)] 
[OperationContractAttribute()] 
ResetJobResponse^ ResetJob(  
   ResetJobRequest^ request 
)  

Parameters

request
A Leadtools.Services.JobProcessor.DataContracts.ResetJobRequest class containing information for the job to be reset.

Return Value

A Leadtools.Services.JobProcessor.DataContracts.ResetJobResponse class containing the job's updated status information.

Remarks

Use this method to reset a job's status back to JobStatus.New. Calling ResetJob will reset all of the job's fields so that it will be as if it has not yet been processed. The following columns of the job's database are affected:

Column Name New Value
cMustAbort 0
cWorker NULL
cAttempts 0
cPercentage 0
cLastStartedTime NULL
cCompletedTime NULL
cFailedTime NULL
cLastUpdatedTime NULL
cFailedErrorID 0
cFailedMessage NULL
cAbortReason NULL
cWorkerMetadata NULL

For more information, refer to Understanding The LEADTOOLS Job Processor Database

Example
C#
VB
using LeadtoolsJobProcessorExamples.JobService; 
 
public void ResetJob(string jobID) 
{ 
   using (JobServiceClient jobServiceClient = new JobServiceClient()) 
   { 
      ResetJobRequest resetJobRequest = new ResetJobRequest(); 
      resetJobRequest.ID = jobID; 
      resetJobRequest.JobType = "NewJobType"; 
      ResetJobResponse resetJobResponse = jobServiceClient.ResetJob(resetJobRequest); 
      if (resetJobResponse.Status == JobStatus.New) 
         Console.WriteLine("The job was successfully updated."); 
      else 
         Console.WriteLine("The job was not updated."); 
   } 
} 
Public Sub ResetJob(ByVal jobID As String) 
   Using jobServiceClient As JobServiceClient = New JobServiceClient() 
      Dim resetJobRequest As ResetJobRequest = New ResetJobRequest() 
      resetJobRequest.ID = jobID 
      resetJobRequest.JobType = "NewJobType" 
      Dim resetJobResponse As ResetJobResponse = jobServiceClient.ResetJob(resetJobRequest) 
      If resetJobResponse.Status = JobStatus.New Then 
         Console.WriteLine("The job was successfully updated.") 
      Else 
         Console.WriteLine("The job was not updated.") 
      End If 
   End Using 
End Sub 

Requirements

Target Platforms

Help Version 20.0.2020.3.31
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.