DocumentStatus

enum DocumentStatus : Enum<DocumentStatus> , KeyedEnum

Enum representing the status of a DraftDocumentEntity.

Below one can find a simple representation of the same flow, represented as document statuses:

       +------+------+
| INITIALIZED | <- Validation is run before initializing, an attempt won't be made if the input is invalid
+------+------+
|
|<--------------------------------+--------------------------------------------------+
| | |
| +--------------+---------------+ |
| | UPLOADING_PAUSED_NO_INTERNET | <retry count not reached>
v +--------------+---------------+ |
+-----+-----+ | +-------------+-------------+
| UPLOADING +---------------------------+--------------------+-------------->| UPLOAD_FAILED_RECOVERABLE |
+-----+-----+ | +-------------+-------------+
| | |
v | <retry count reached>
+-----+-----+ | |
| UPLOADED | | |
+-----+-----+ | |
|<----------+-------------------------+ | |
| | | | |
| +---------+---------+ +-------------+--------------+ | |
| | POLLING_TIMED_OUT | | POLLING_PAUSED_NO_INTERNET | | |
v +---------+---------+ +-------------+--------------+ | |
+-----+-----+ | | | |
| POLLING +-----+-------------------------+ | |
+-----+-----+ | |
| | |
|----------------------+ | |
| | | |
| | | |
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv FINAL STATES vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
| | | |
| | | |
v v v v
+---------+---------+ +---------+---------+ +--------------+--------------+ +------------+------------+
| PROCESSED_SUCCESS | | PROCESSED_FAILED | | UPLOAD_FAILED_UNRECOVERABLE | | REACHED_MAX_RETRY_COUNT |
+---------+---------+ +---------+---------+ +--------------+--------------+ +------------+------------+

Entries

Link copied to clipboard

DraftDocumentEntity has been created in the DraftDocumentDatabase. This status is the default status set when the entity is created and inserted.

Link copied to clipboard

DraftDocumentEntity has been begun the upload step which involves posting to the API and awaiting a response. This status is set as soon as the upload process begins.

Link copied to clipboard

DraftDocumentEntity has begun the upload step, but has no internet access to continue. This state is considered recoverable and will be tried again the next time network is recovered.

Link copied to clipboard

DraftDocumentEntity has been uploaded to the server and now qualifies to be polled. This status is set immediately after we receive a successful upload response from the API.

Link copied to clipboard

DraftDocumentEntity has failed to upload with what is deemed as recoverable error. If recoverable, it can be included in future upload attempts.

Link copied to clipboard

DraftDocumentEntity has failed to upload with what is deemed as unrecoverable error. The DocumentUploadWorker will not attempt re-upload it.

Link copied to clipboard

DraftDocumentEntity has been uploaded to the API, and is now being actively long polled.

Link copied to clipboard

DraftDocumentEntity has been uploaded to the API, and is now being actively long polled, but has timed out. It will try again until a new state is reached.

Link copied to clipboard

DraftDocumentEntity has been uploaded to the API, and is now being actively long polled, but while polling the network was lost and could not be continued. This state is considered recoverable and will be tried again the next time network is recovered.

Link copied to clipboard

DraftDocumentEntity has reached its maximum retry count while uploading or polling. It will not attempt anymore retries.

Link copied to clipboard

DraftDocumentEntity has successfully been long polled and has returned with a valid response

Link copied to clipboard

DraftDocumentEntity has returned with an invalid response while long polling. It will not try any additional attempts.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val isFinal: Boolean = false
Link copied to clipboard
open override val key: String
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Link copied to clipboard

Returns an array containing the constants of this enum type, in the order they're declared.