Skip To Content ArcGIS for Developers Sign In Dashboard

Job Class

(Esri::ArcGISRuntime::Job)

A base class for classes representing a long running job on a server. More...

Public Functions

~Job()
bool cancel()
TaskWatcher checkStatus()
Error error() const
JobStatus jobStatus() const
JobType jobType() const
QList<JobMessage> messages() const
bool pause()
int progress() const
QString serverJobId() const
bool start()

Reimplemented Public Functions

virtual Credential *credential() const
virtual RequestConfiguration requestConfiguration() const
virtual void setRequestConfiguration(const RequestConfiguration &requestConfiguration)
virtual QString toJson() const
virtual QJsonObject unknownJson() const
virtual QJsonObject unsupportedJson() const

Signals

void checkStatusCompleted(QUuid taskId, bool succeeded)
void jobDone()
void jobStatusChanged()
void progressChanged()

Static Public Members

Job *fromJson(const QString &json, QObject *parent = nullptr)
  • 10 static public members inherited from QObject

Reimplemented Protected Functions

virtual QUrl url() const
  • 9 protected functions inherited from QObject

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public slot inherited from QObject
  • 1 public variable inherited from QObject
  • 9 protected functions inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

A base class for classes representing a long running job on a server.

A job is a long running operation that is completed by an ArcGIS Server asynchronous service operation. They are submitted to an ArcGIS Server end point, they have regular status updates as the job is completed and a result is then returned. Different types of jobs exist and each can have different stages.

A job is initiated when it is submitted to the server. When the server accepts the job, it assigns a unique ID to the job. This ID is available in the serverJobId property.

Job instances created by tasks and returned by task methods are returned in a JobStatus::NotStarted state. For these, call start to start the associated operation.

After the job is initiated on the server and started, the client listens for the jobDone signal to know when the job is done. While the job is not yet done, the client may listen for the jobStatusChanged signal and examine the jobStatus or progress methods to monitor progress.

Classes that inherit from this class may implement a property containing the job's results, whose type depends on the type of job.

If the job fails, information about the failure is available in the error property.

See also JobStatus.

Member Function Documentation

Job::~Job()

Destructor.

bool Job::cancel()

Pause this Job.

Returns true if the job was successfully cancelled; false if it is already done, or if there is an error.

TaskWatcher Job::checkStatus()

Checks the current job status from the service and returns a TaskWatcher for the asynchronous task.

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.

This function was introduced in Esri::ArcGISRuntime 100.1.

See also checkStatusCompleted.

[signal] void Job::checkStatusCompleted(QUuid taskId, bool succeeded)

Signal emitted when checking the status has completed.

The result can be false if the job is not checking server status for example if the job status is paused or uploading.

  • taskId - The task ID of the asynchronous task.
  • succeeded - Whether the current status of the job was checked from the service.

This function was introduced in Esri::ArcGISRuntime 100.1.

See also jobStatus.

[virtual] Credential *Job::credential() const

Reimplemented from RemoteResource::credential().

Returns the security credential used to access the tiled ArcGIS map Service.

This is only applicable if using a service that is secured.

Error Job::error() const

Gets the error encountered during execution, if any.

Returns the Error.

[static] 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.

JobStatus Job::jobStatus() const

Gets the current status of this Job.

[signal] void Job::jobStatusChanged()

Signal emitted when the jobStatus property changed.

JobType Job::jobType() const

Returns the type of this Job.

QList<JobMessage> Job::messages() const

Gets 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.

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] void Job::progressChanged()

Signal emitted when the progress complete changes.

This function was introduced in Esri::ArcGISRuntime 100.1.

[virtual] RequestConfiguration Job::requestConfiguration() const

Reimplemented from RemoteResource::requestConfiguration().

Returns the RequestConfiguration in use by this job.

This function was introduced in Esri::ArcGISRuntime 100.1.

See also setRequestConfiguration().

QString Job::serverJobId() const

Gets the unique job ID of this Job on the server on which it is executing.

[virtual] void Job::setRequestConfiguration(const RequestConfiguration &requestConfiguration)

Reimplemented from RemoteResource::setRequestConfiguration().

Sets configuration parameters used for network requests sent by this job to requestConfiguration.

This function was introduced in Esri::ArcGISRuntime 100.1.

See also requestConfiguration().

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.

[virtual] QString Job::toJson() const

Reimplemented from JsonSerializable::toJson().

Returns this job as a JSON representation.

See also JsonSerializable.

[virtual] QJsonObject Job::unknownJson() const

Reimplemented from JsonSerializable::unknownJson().

Gets the unknown JSON of this object.

See also JsonSerializable.

[virtual] QJsonObject Job::unsupportedJson() const

Reimplemented from JsonSerializable::unsupportedJson().

Gets the unsupported JSON of this object.

See also JsonSerializable.

[virtual protected] QUrl Job::url() const

Reimplemented from RemoteResource::url().

Returns the URL to a tiled ArcGIS Map service.


Feedback on this topic?