I have a complex application with many pages.
Each page can have many possible routes to other pages: ‘A’ can go to ‘B’ or ‘C’, ‘B’ can go to ‘A’ but not ‘C’. etc.
Rather than embed this ‘where to go to next’ logic in each page (horror!) I of course want to encapsulate it in a main point of control. ‘A’ doesn’t need to know about ‘B’ or ‘C’.
Even better, I’d like to reduce the problem to a matter of configuration.
This isn’t a language/framework specific question — it’s a matter of how best (simple, pragmatic) to represent and interpret Workflow logic.
Has anyone had experience representing a complex flow between points in an application as a configurable setting?
What you describe is a pretty classic Finite State Machine. You have States (Pages), Navigation (Transitions), but also you can have things like entry/exit actions and transition conditions.
With that said, it’s worth thinking about your navigation, do you simply want a list of navigation options dynamically added to the page, or is there some extra smarts involved. Think of when the navigation is valid, what information is required for the navigation, the data you might want to bring with you to the next navigation etc.
I’ve created state maps before by simply using XML, eg: