在我的 Grails 应用程序中,我定义了以下(简化的)Web 流程
def registerFlow = {
start {
action {RegistrationCommand cmd ->
try {
memberService.validateRegistrationCommandDTO(cmd)
} catch (MemberException ex) {
flow.regErrorCode = ex.errorCode
throw ex
}
}
on("success").to "survey" // The 'survey' state has been omitted
on(MemberException).to "handleRegMemberException"
on(Exception).to "handleUnexpectedException"
}
handleRegMemberException {
action {
// Implementation omitted
}
}
handleUnexpectedException {
redirect(controller:'error', action:'serverError')
}
}
如果“start”状态引发了 MemberException,则执行应该继续到“handleRegMemberException”状态,但事实并非如此。我的流程定义有什么问题,或者我对它应该如何工作的理解有问题吗?
谢谢,唐