11th December 2019
Recoverability is the ability to restart an automation from the last completed record. In a production environment, there are successful records and exceptions. While both states indicate a completed record. Completed records should be skipped if the automation needs to restart due to unrecoverable error.
A successful record is indicated when the favorable business process is executed and no human intervention is needed. While the next step in the business may necessitate a human action the scope of the automation task was completed without human escalation. I,e, a bank record is successfully entered and categorized within quickbooks.
Exceptions are when the process cannot be executed against the scope of the script. When the scope of the process cannot be executed against the scope of the automation. I,e, a bank record is successfully entered but no expense category that matches can be assigned within quickbooks.
An incomplete record occurs when the automation ends prematurely. Such an event could be caused by an unintended reboot or OS fault. When the automation is restarted it needs some way to know which records are complete.
Any situation where the last line of code does not execute.
For recoverability the scope of the automation should mean the automation processes multiple records one at a time but not on demand. An on demand automation would execute a record only if called for a single record. Got example the entire automation runs on one record and then exits. For recoverability to be a factor the scope of the automation needs to execute one record after another until all records are complete.
Definition of done
All records are status of exception or success and the last line of code has executed.
- Prevent duplication of records
- Prevent data loss
- Ensure complete process execution
The automation starts and identifies a logging function. Develop and add on a built in function called AuditLog. Accept Parameters DateFormat, CallBack
DateFormat - same as FormatTime command this parameter will be optional. If omitted, it defaults to the time followed by the long date
CallBack- optional. Sets a callback function that will set a callback. The callback could link to a DB or network share. If omitted the audit log is a text file stored in workingdir. The CallBack must accept a UniqueRecordID and an optional boolean value. If the boolean is set to true this call back must log the UniqueRecordID. If not set the function should check the log using the UniqueRecordID and if found return true otherwise return false
Record Complete Record
A record for this discussion is one complete iteration of the automation. AuditRecordComplete accepts parameter of UniqueRecordID, RecordStatus and is passed to the callback indicated in AuditLog.
UniqueRecordID - is some identifier that can easily be checked at the beginning of the iteration
RecordStatus - if set to true the UniqueRecordID is logged to the AuditLog callback. Otherwise this function returns false. This is useful if called at the beginning of the iteration
Indicated by execution of last line of the code. AuditComplete accepts an optional callback function to compile the current audit log and remove it from active status. If omitted the current audit text file is simply deleted