DocumentStatus
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
DraftDocumentEntity has been created in the DraftDocumentDatabase. This status is the default status set when the entity is created and inserted.
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.
DraftDocumentEntity has failed to upload with what is deemed as recoverable error. If recoverable, it can be included in future upload attempts.
DraftDocumentEntity has failed to upload with what is deemed as unrecoverable error. The DocumentUploadWorker will not attempt re-upload it.
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.
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.
DraftDocumentEntity has reached its maximum retry count while uploading or polling. It will not attempt anymore retries.
DraftDocumentEntity has successfully been long polled and has returned with a valid response
DraftDocumentEntity has returned with an invalid response while long polling. It will not try any additional attempts.
Properties
Functions
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.)
Returns an array containing the constants of this enum type, in the order they're declared.