private FlowVariable parseVariable(Element element) { ScopeType scope = parseScope(element, ScopeType.FLOW); if (StringUtils.hasText(element.getAttribute(BEAN_ATTRIBUTE))) { BeanFactory beanFactory = getLocalFlowServiceLocator().getBeanFactory(); return new BeanFactoryFlowVariable(element.getAttribute(NAME_ATTRIBUTE), element .getAttribute(BEAN_ATTRIBUTE), beanFactory, scope); } else { if (StringUtils.hasText(element.getAttribute(CLASS_ATTRIBUTE))) { Class variableClass = (Class) fromStringTo(Class.class).execute(element.getAttribute(CLASS_ATTRIBUTE)); return new SimpleFlowVariable(element.getAttribute(NAME_ATTRIBUTE), variableClass, scope); } else { BeanFactory beanFactory = getLocalFlowServiceLocator().getBeanFactory(); return new BeanFactoryFlowVariable(element.getAttribute(NAME_ATTRIBUTE), null, beanFactory, scope); } } }