这是一个从 Spring 动作状态调用的片段。
public Event doSomething(){
/* do something */
// (1) How to create a instance of this and set custom attributes?
AttributeMap customAttributeMap;
Event done = new Event(this, "done", customAttributeMap);
}
这是 flow.xml 中调用 about 方法的片段:
<action-state id="someStateId">
<evaluate expression="flowAction.doSomething" />
<transition on="done">
<!-- (2) How do I access my custom attribute set in Event -->
<evaluate expression="currentEvent.attributes.pageName" result="requestScope.pageName" />
</transition>
</action-state>
所以,我的问题是:
- 如何创建具有自定义属性集的事件?
- 如何在 spring flow xml 文件中访问此事件的自定义属性?