LEADTOOLS Cloud (Leadtools.Services.Cloud.ServiceContracts assembly)
LEAD Technologies, Inc

ResetJob Method

Example 





A Leadtools.Services.Cloud.DataContracts.ResetJobRequest class containing information for the job to be reset.
Resets a job's status to JobStatus.New and initializes all of its fields.
Syntax
[OperationContractAttribute()]
[FaultContractAttribute(DetailType=Leadtools.Services.Cloud.FaultContracts.CloudFault, 
   Action="", 
   Name="", 
   Namespace="", 
   ProtectionLevel=ProtectionLevel.None, 
   HasProtectionLevel=false)]
ResetJobResponse ResetJob( 
   ResetJobRequest request
)
'Declaration
 
<OperationContractAttribute()>
<FaultContractAttribute(DetailType=Leadtools.Services.Cloud.FaultContracts.CloudFault, 
   Action="", 
   Name="", 
   Namespace="", 
   ProtectionLevel=ProtectionLevel.None, 
   HasProtectionLevel=False)>
Function ResetJob( _
   ByVal request As ResetJobRequest _
) As ResetJobResponse
'Usage
 
Dim instance As IJobService
Dim request As ResetJobRequest
Dim value As ResetJobResponse
 
value = instance.ResetJob(request)
[OperationContractAttribute()]
[FaultContractAttribute(DetailType=Leadtools.Services.Cloud.FaultContracts.CloudFault, 
   Action="", 
   Name="", 
   Namespace="", 
   ProtectionLevel=ProtectionLevel.None, 
   HasProtectionLevel=false)]
ResetJobResponse ResetJob( 
   ResetJobRequest request
)
OperationContractAttribute()
FaultContractAttribute(DetailType=Leadtools.Services.Cloud.FaultContracts.CloudFault, 
   Action="", 
   Name="", 
   Namespace="", 
   ProtectionLevel=ProtectionLevel.None, 
   HasProtectionLevel=)
function Leadtools.Services.Cloud.ServiceContracts.IJobService.ResetJob( 
   request 
)
[OperationContractAttribute()]
[FaultContractAttribute(DetailType=Leadtools.Services.Cloud.FaultContracts.CloudFault, 
   Action="", 
   Name="", 
   Namespace="", 
   ProtectionLevel=ProtectionLevel.None, 
   HasProtectionLevel=false)]
ResetJobResponse^ ResetJob( 
   ResetJobRequest^ request
) 

Parameters

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

Return Value

A Leadtools.Services.Cloud.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 as if it has not yet been processed. The job's database columns below 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 Cloud Database

Example
 
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
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.");
   }
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

IJobService Interface
IJobService Members
Programming with Leadtools Cloud SDK
Understanding The LEADTOOLS Cloud Database

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.