RE-Framework:
RE-Framework is a template built on top of state machines workflow which will help us to automate complex business scenarios and robust exception handling, logging is in place where we can focus on main process functionalities which will help us to reduce development time.
We can customize RE-Framework based on input data. By default, it will use orchestrator queues as transaction data and we can customize to any iterative data objects like list, data tables and collections. In state machines we will have only two states i.e., state and final state we can customize number of states in the workflow but need to have at least one state and one finally state.
By using orchestrator queues, we can scale our process by enabling multiple robots to execute same process.
RE-Framework will have four states initialization state, Get Transaction State, Process Transaction state and End process state. Transition from on state to other state will be based on transition conditions and these conditions are evaluated in sequential order and we can define transition by adding the transition conditions from one state to other.
1. Initialization State:
This state will be executed in two conditions one is processes initiated and other is any system exception occurred at process transaction state.
In the initialization state first check for first execution or not based on Config variable is holding any data or not. If it’s first execution robot will initialize all settings by reading config files, and assets.
In both the conditions robot will initialize all the applications and make applications ready for the process to be executed.
If initialization successful, then transition to get transaction state will takes place.
If any exception occurred in initialization the transition to End process will takes place.
2. Get Transaction State:
This state will be executed in three conditions initialization successful; process transaction is successful and business rule exception occurred.
Robot will check if stop command is received from the robot if received will move to end process state else, Transaction data will be retrieved from the collection (Transaction data)
If Data is retrieved, then transition to process transaction state will takes place.
If any exception occurred or no data is available in while getting the transaction data, the transition to End process will takes place.
3. Process Transaction State:
This state will be executed in only one if transaction data is retrieved successfully from get transaction data state.
There are three possible outcomes from process transaction state and transition from process to get transaction state if transaction is successful or business rule exception. And if transaction status id system exception, then transition to initialization state will takes place.
In Process Transaction state we will be doing all the process execution, we will validate business rules and if data is not meeting business validations then we will be throwing business rule validation and if all the business validations are successful then we will be continuing the process and if the process is successfully completed then we will be updating the status to success in the set transaction state and will increment the transaction number.
If any business rule exception is occurred, then we will update the status to failed and will update the exception type to business rule and will log the error message. And will continue with the next transaction data by getting the next transaction data in get transaction data state.
If any system exception occurred:
Using Queues:
will check for retry is enabled for the queue if enabled and max retry is not reached will update the status to retried and new transaction item is created with same data and will increment transaction number, close all the applications and will transition to initialization and continue the process with same transaction data.
If retry is not enabled or max retries is reached, then will update the status to failed with system exception, close all the applications, and will transition to initialization and continue the process with next transaction data.
Not using Queues:
will check for max retry in config file constants sheet if retry number is more than zero and max retry is not reached transaction number is not incremented, close all the applications and will transition to initialization and continue the process with same transaction data.
If retry is not max retry in config file constants sheet is zero or max retries is reached, then will update the status to failed with system exception will increment the transaction number, close all the applications, and will transition to initialization and continue the process with next transaction data.
4. End Process State:
This state will be executed in three conditions exception occurred in initialization, no transaction data available for processing transaction in get transaction state and any exception occurred in get transaction state.
In this state robot will try to safe close all the applications and if any error occurred in closing applications, then robot will kill all the processes related to the applications used in this process.
There won’t be any transition from end process to other states.