I have a lot of status and I'm building functions for each status. I'm trying to figure out how I can revert changes based on status. The be a bit more clear: Say you have 5 status: START INSTALLED PROC COMPLETE UPLOADED
In order to go from status COMPLETE to UPLOADED I would have to run PROC status and INSTALLED. I'm trying to build a simple system where I can call a function and it will know which functions to run depending on their dependencies define in an array or something.
Assumptions: Each status can be reverted backwards only. So if in the above example, UPLOADED can't go to the COMPLETE status. Each status can revert to itself (Status UPLOADED and revert to UPLOADED).
Anyone know how I can go about this? of course there's gonna be a lot more status, I'm just trying to avoid 50 if statements :/