Class Job<T>
A job is a long-running asynchronous operation performed by an ArcGIS Server asynchronous service operation.
Inheritance
Namespace: Esri.ArcGISRuntime.Tasks
Assembly: Esri.ArcGISRuntime.dll
Syntax
public abstract class Job<T>
Type Parameters
Name | Description |
---|---|
T | The type of result returned by the operation |
Remarks
This is the base class for a range of long-running jobs classes, such as GeoprocessingJob, GenerateGeodatabaseJob, SyncGeodatabaseJob, GenerateOfflineMapJob, and ExportVectorTilesJob. You can create a job instance from its associated task using a set of parameters. For example, to create a GeoprocessingJob, call CreateJob(GeoprocessingParameters) and provide a set of GeoprocessingParameters. A newly instantiated job has a status of NotStarted.
Call Start() to initiate the job on the server. If the server accepts the job, it assigns a unique job id (available from the ServerJobId) and executes the job. At this point, the job status is Started. The running job periodically polls the server to get messages and progress of the job. While the job is in progress, you can listen for changes to the Status, display its collection of Messages, and report the Progress to show the percentage of the job that has been completed.
When the job is done, you can examine the Status to determine if it was successful. If the job failed (Failed), information about the failure is available in the Error. If the job succeeds (Succeeded), its specific type of result is returned. For example, a successful GeoprocessingJob returns a GeoprocessingResult, a successful ExportVectorTilesJob returns a ExportVectorTilesResult, and so on.
If necessary, you can pause a job and re-start it using Pause() and Start(), respectively. Note, you should always cancel jobs that are no longer needed by calling CancelAsync(). This sends a cancel request to the server and helps reduce unnecessary server load.
Properties
Name | Description |
---|---|
Error | Gets the error if one occurred during execution of the job.
If no error has occurred, then |
Messages | Gets the job's status messages |
Progress | Gets the current progress of the job as a percentage toward completion |
ServerJobId | Gets the server job ID of the job |
Status | Gets the status of the job. |
Methods
Name | Description |
---|---|
CancelAsync() | Cancels this job and waits for any asynchronous server-side operations to be canceled. |
CheckStatusAsync() | Initiates a request to check the status of a job while executing on a server |
GetResultAsync() | A convenience method that starts the job, waits for completion, and returns the result. |
Pause() | Pauses execution of the job |
Start() | Starts the job if the job is not started or paused. |
ToJson() | Converts the job into a JSON representation |
Events
Name | Description |
---|---|
MessageAdded | Raised when a new JobMessage was added to Messages. |
ProgressChanged | Occurs when the Progress has changed |
StatusChanged | Raised when the Status property has changed. |
Applies to
Target | Versions |
---|---|
.NET Standard 2.0 | 100.3 - 200.8 |
.NET | 100.13 - 200.8 |
.NET Windows | 100.13 - 200.8 |
.NET Android | 200.0 - 200.8 |
.NET iOS | 200.0 - 200.8 |
.NET Framework | 100.0 - 200.8 |
Xamarin.Android | 100.0 - 100.15 |
Xamarin.iOS | 100.0 - 100.15 |
UWP | 100.0 - 200.8 |