A job is a long-running asynchronous operation performed by an ArcGIS Server asynchronous service operation. More...
Detailed DescriptionThis 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 GeoprocessingTask::createJob(const Esri::ArcGISRuntime::GeoprocessingParameters&) and provide a set of GeoprocessingParameters. A newly instantiated job has a status of JobStatus::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 JobStatus::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 jobStatus, 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 jobStatus to determine if it was successful. If the job failed (JobStatus::Failed), information about the failure is available in the error. If the job succeeds (JobStatus::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.
Relevant samples:
[override virtual noexcept]
Job::~Job()
Destructor.
[since Esri::ArcGISRuntime 200.2]
QFuture<bool> Job::cancelJobAsync()
Cancels this Job and waits for any asynchronous, server-side operations to be canceled.
The job is canceled and will result in a JobStatus::Failed status after all cancellation tasks have completed. For jobs running on a server, a cancel request is sent for the associated serverJobId. You should always cancel unneeded jobs (for example when exiting your app) to avoid placing unnecessary load on the server. Examples of server-side jobs include:
In addition, the GenerateOfflineMapJob is composed of several server-side jobs, depending on the types of layers in your Map. Canceling this high-level job will also send a cancel request to the underlying server jobs.
Upon calling this method, the jobStatus is immediately set to JobStatus::Canceling.
This method returns a QFuture for the asynchronous operation. Use future.then() to continue processing when the operation completes. Use future.onFailed() to handle exceptions of type ErrorException.
See Working with QFuture for further details.
This function was introduced in Esri::ArcGISRuntime 200.2.
[since Esri::ArcGISRuntime 200.2]
QFuture<bool> Job::checkStatusAsync()
Initiates a request to check the server status.
The task contains a bool indicating if the check was successful. The task completes after the status has been checked. If the job is polling the server for status and is in a time gap, then calling this method will ensure a request is sent right away. The result can be false
if the job is not checking server status for example if the job status is paused or uploading.
This method returns a QFuture for the asynchronous operation. Use future.then() to continue processing when the operation completes. Use future.onFailed() to handle exceptions of type ErrorException.
See Working with QFuture for further details.
This function was introduced in Esri::ArcGISRuntime 200.2.
Esri::ArcGISRuntime::Error Job::error() constGets the error encountered during execution, if any.
Returns the Error. The error is available when the job status is JobStatus::Failed.
[static]
Esri::ArcGISRuntime::Job *Job::fromJson(const QString &json, QObject *parent = nullptr)
Creates and returns a new Job object from the provided json, with an optional parent.
The Job will be in a paused state.
See also JsonSerializable.
[signal]
void Job::jobDone()
Signal emitted when this Job is done.
Esri::ArcGISRuntime::JobStatus Job::jobStatus() constGets the current status of this Job.
Esri::ArcGISRuntime::JobType Job::jobType() constReturns the type of this Job.
[signal, since Esri::ArcGISRuntime 100.14]
void Job::messageAdded(const Esri::ArcGISRuntime::JobMessage &message)
Signal emitted when a new JobMessage is added to Job::messages.
This function was introduced in Esri::ArcGISRuntime 100.14.
QList<Esri::ArcGISRuntime::JobMessage> Job::messages() constGets the informational messages produced during execution of this job.
Returns the list of JobMessage objects.
bool Job::pause()Pause this Job.
Returns true
if the job was successfully paused; false
if it is already done, or if there is an error.
[since Esri::ArcGISRuntime 100.1]
int Job::progress() const
Gets the current progress of the job as the percentage complete.
This function was introduced in Esri::ArcGISRuntime 100.1.
[signal, since Esri::ArcGISRuntime 100.1]
void Job::progressChanged()
Signal emitted when the progress complete changes.
This function was introduced in Esri::ArcGISRuntime 100.1.
QString Job::serverJobId() constGets the unique job ID of this Job on the server on which it is executing.
bool Job::start()Starts or resumes this Job.
Call this method to start the job initially and also to resume it after it is paused.
Returns true
if the job was successfully started/resumed; false
if it is already done, or if there is an error.
[signal, since Esri::ArcGISRuntime 100.14]
void Job::statusChanged(Esri::ArcGISRuntime::JobStatus status)
Signal emitted when the jobStatus property changes.
This function was introduced in Esri::ArcGISRuntime 100.14.
[override virtual]
QString Job::toJson() const
Reimplements: JsonSerializable::toJson() const.
Returns this job as a JSON representation.
See also JsonSerializable.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4