9. Variables

A flow may declare one or more instance variables. These variables are allocated when the flow starts. Any @Autowired transient references the variable holds are also rewired when the flow resumes.spring-doc.cn

9.1. The var Element

The var element declares a flow variable, as follows:spring-doc.cn

<var name="searchCriteria" class="com.mycompany.myapp.hotels.search.SearchCriteria"/>

Make sure your variable’s class implements java.io.Serializable, as the instance state is saved between flow requests.spring-doc.cn