}
private synchronized void loadFlows(FacesContext context, FlowHandler flowHandler) throws IOException {
javax.enterprise.inject.spi.BeanManager beanManager = (javax.enterprise.inject.spi.BeanManager)
Util.getCDIBeanManager(context.getExternalContext().getApplicationMap());
FlowDiscoveryCDIContext flowDiscoveryContext = (FlowDiscoveryCDIContext) beanManager.getContext(FlowDefinition.class);
List<Producer<Flow>> flowProducers = flowDiscoveryContext.getFlowProducers();
WebConfiguration config = WebConfiguration.getInstance();
for (Producer<Flow> cur : flowProducers) {
Flow toAdd = cur.produce(beanManager.<Flow>createCreationalContext(null));
if (null == toAdd) {