SpringWebflow2中的操作实现

SpringWebflow2中的操作实现,spring,action,implementation,spring-webflow,Spring,Action,Implementation,Spring Webflow,我正在尝试执行一个SWF操作,如下所示: @Component(value = "initializeProjectsTestingFormAction") public class InitializeProjectsTestingFormAction implements Action { @Autowired private ProjectsBo projectsBo; @Override public Event execute(RequestCont

我正在尝试执行一个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/org/springframework/webflow/execution/Event.html


提前感谢。

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

非常感谢您的回答,这是有意义的。构造函数的第一个参数,
source
?这个论点的效用是什么?它对我们有什么影响?有什么想法吗?谢谢。它是泛型Java超类
Java.util.EventObject
所必需的构造函数参数。不确定它在webflow上下文中的用途。太好了,我会做一些测试来找出其他的东西。您是否有SWF操作实现的示例及其在流程中的各自使用?只是为了与我的做法形成对比,我的行动是有效的,但我想100%确定行动的正确使用,因为我必须实施一系列行动。谢谢