Today, I will give you one of the implementations of maker-checker workflow which I had adopted in my projects.
It’s a quite common workflow in the industry especially followed in the banking domain where maker will create/update contents and the checker will approve the contents. This is considered to avoid mistakes while entering the records in the process.
- We had the master data which needs to be created or updated through maker-checker flow. Then this data will be visible on the main sites for the users to view.
- The User with the maker role will able to create and update the contents whereas with the checker role can approve/reject the newly available data.
- Without checker’s approval, The contents should not be updated on the main master data.
- If data is already approved and visible on the main site, then modifying/editing the contents will directly reflect on the main site.
Creating new contents were easy as it was not visible on the main website but the problem became slightly challenging where we needed to handle the scenario of data update.
We followed below strategy to handle this.
- We created two tables for Master data.
- a Temporary table where contents can be easily modified and created anytime.
- an Approved Master Table where after the workflow data can be inserted or updated post approval in the temporary table.
- we created common service which would update the data in the approved table on the basis of simple one to one mapping of temporary to master table.
- employee_tmp and employee Table.
- All modification will happen in the temporary table.
- After the approval, Data would need to update from the temporary table to the actual table. This way master table will always get a new update after approval through maker-checker flow.
Hope this will people who want to implement this workflow in their projects.
Please do comment and ask if anything is missing or you have better solutions in your mind which others can learn.