Personally, I think "evaluate expression" is a better choice. It provides a lot of more flexibility. In my code, I always avoid expose real data to the flow definitions.
The below code should work.
Code:
public class Flag implements Serializable{
private EnumType enumValue;
// getters and setters
}
public class YourAction{
public Flag setFlag(){
// you logic for creating or setting flags.
// and whatever you want to do
}
}
<evaluate expression="yourAction.setFlag()" result="flowScope.flag"/>

Originally Posted by
Taariq
Some of my use cases rely on certain records being created or updated when the session is started or ended. Some output documents will also be generated here.
This code is in a FlowExecutionListener, and here I rely on the flow storing an enum in flowScope.
I know how to create and use enums in Spring, but I don't know about webflow and what I've tried isn't working.
I'm hoping to avoid having to define a bean for each enum value, can I assign an enum value to a variable either using "var" or with "evaluate expression"?
Or any other ideas?
I'm using the enum value to determine which use case specific bean to return to the listener. This bean will have access to all sorts of DAO type services that will not be serializable so I cannot store the bean itself in scope.