Tracks progress for a single JsProcessable task and, once marked complete, invokes the app's callback function if one was registered on the task. An instance is created by JsProcessable and installed as its status tracker, so calling setComplete with true, typically done by the async processor when the task finishes running, resolves the current organisation or website branch root folder, runs as the invoking user where one is set, and invokes the callback function through the app's controller mapping cache.

Extends: StatusInfo


Inherited from StatusInfo

Properties

PropertyReturnsDescription
cancelledbooleanWhether the job has been cancelled.
cancelledDateDateThe date and time the job was cancelled.
completebooleanWhether the job has been marked as complete by the async processing framework.
completedDateDateThe date and time the job was marked complete.
createdDateDateThe date and time the job was created. Defaults to the time this status info was constructed.
stateDataStringCustom job state data, as a string, that the job has published for display or for JS job functions to read.

Methods

isComplete() · setComplete(boolean b) · setCancelled(boolean b) · isCancelled() · getCompletedDate() · setCreatedDate(Date createdDate) · getCreatedDate() · getCancelledDate() · getStateData() · job()

isComplete()

Returns: boolean

Whether the job has been marked as complete by the async processing framework.

setComplete(boolean b)

Returns: void

Marks the job as complete or not, and records the current time as the completed date. Called by the async processor when the job finishes.

ParameterDescription
btrue to mark the job complete, false to clear the complete flag

setCancelled(boolean b)

Returns: void

Marks the job as cancelled or not, and records the current time as the cancelled date.

ParameterDescription
btrue to mark the job cancelled, false to clear the cancelled flag

isCancelled()

Returns: boolean

Whether the job has been cancelled.

getCompletedDate()

Returns: Date

The date and time the job was marked complete.

setCreatedDate(Date createdDate)

Returns: void

Sets the date and time the job was created.

ParameterDescription
createdDatethe created date to record

getCreatedDate()

Returns: Date

The date and time the job was created. Defaults to the time this status info was constructed.

getCancelledDate()

Returns: Date

The date and time the job was cancelled.

getStateData()

Returns: String

Custom job state data, as a string, that the job has published for display or for JS job functions to read.

job()

Returns: AsyncJob

The underlying async job this status info was built from.


Methods

setStateData(String stateData)

Returns: void

Records the current state data for this task, delegating to the base implementation.

ParameterDescription
stateDatathe state data to record

setComplete(boolean complete)

Returns: void

Marks the task as complete or not, and, when marking it complete and a callback function has been registered on the owning JsProcessable, invokes that callback through the app's controller mapping cache. Errors raised while invoking the callback are logged rather than thrown.

ParameterDescription
completetrue to mark the task complete and trigger its callback, false to mark it incomplete
To get full access to the Kademi Hub existing customers can login here, or new customers can register here.