春季网络流中的操作实现 2.



我正在尝试实现这样的 SWF 操作:

@Component(value = "initializeProjectsTestingFormAction")
public class InitializeProjectsTestingFormAction implements Action {
    @Autowired
    private ProjectsBo projectsBo;
    @Override
    public Event execute(RequestContext requestContext) throws Exception {
        ProjectsTestingForm projectsTestingForm = (ProjectsTestingForm) requestContext.getFlowScope().get("projectsTestingForm");
        EndUse selectedEndUse = (EndUse) requestContext.getFlowScope().get("selectedEndUse");
        projectsTestingForm.setProjects(projectsBo.findImplementableProjectsForTesting(selectedEndUse));
        return new Event("", "initializeProjectsTestingFormAction");
    }
}

当流调用操作时,它目前工作正常,但我对操作必须返回的事件感到有些不安。有没有人知道事件是什么以及根据其值(源和 id)可能会影响流行为的因素?

我正在阅读文档,但我根本无法理解并回答自己这个问题:

http://static.springsource.org/spring-webflow/docs/2.3.x/javadoc-api/index.htmlhttp://static.springsource.org/spring-webflow/docs/2.3.x/javadoc-api/org/springframework/webflow/execution/Event.html

提前谢谢。

事件的id(构造函数的第二个参数)应对应于调用操作后应执行的转换的on属性。

最新更新