use of org.springframework.webflow.engine.support.BeanFactoryVariableValueFactory in project cas by apereo.
the class AbstractCasWebflowConfigurer method createFlowVariable.
/**
* Create flow variable flow variable.
*
* @param flow the flow
* @param id the id
* @param type the type
* @return the flow variable
*/
protected FlowVariable createFlowVariable(final Flow flow, final String id, final Class type) {
final Optional<FlowVariable> opt = Arrays.stream(flow.getVariables()).filter(v -> v.getName().equalsIgnoreCase(id)).findFirst();
if (opt.isPresent()) {
return opt.get();
}
final FlowVariable flowVar = new FlowVariable(id, new BeanFactoryVariableValueFactory(type, applicationContext.getAutowireCapableBeanFactory()));
flow.addVariable(flowVar);
return flowVar;
}
Aggregations