I started using Grails web flow in order to implement a wizard.
checkStep {
action {
User user = springSecurityService.currentUser
if (springSecurityService.loggedIn){
def next = wizardService.getNextFlowStep(user)
switch (next) {
case step1:
step1()
break
...
}
}
on("step1").to "wizard_step1"
} // checkStep
wizard_step1() {
...
}
I'd like to write the first step in more elegant way, such that based on "wizardService" the next step will be determined. I also preferred that the steps will be determined at run time, such that the actual step names and order may be reside in a database.
THanks