0
我想調用控制器未知的子流。它通過參數傳遞給beginFlow,並將其保存在流程範圍中。在goToForm裏我想調用保存在flow.theController中的控制器。Grails Webflow:在操作或轉換狀態之外訪問流程範圍
def beginFlow = {
enter {
action {
if (params?.redirectTo != null) {
String flow.theController = params.redirectTo
}
if (flow.theController()) {
success()
}
}
on("success").to("beginPage")
}
beginPage {
on('next').to('goToForm')
}
goToForm {
// I'd like this:
// subflow(controller: flow.theController, action:'start'
// this subflow works, but won't work for all cases
subflow(controller: 'AZ_A4', action:'start')
on('done').to('showResults')
on('notDone').to('beginPage')
}
showResults {
redirect(action: 'results')
}
}