title: Flow scope navigation to start page does not work
body: <p>It is not so much a question, more of a note.
  With Glassfish4, in a JEE7 application I tried to use the flow scope using programmatic flow definition (java class annotated with @Produces @FlowDefinition).</p>
  
  <p>I navigated to the start page of the flow with a h:commandButton (just as it is done in the JEE7 tutorial example <a href="https://svn.java.net/svn/javaeetutorial~svn/trunk/examples/web/jsf/checkout-module" rel="nofollow">https://svn.java.net/svn/javaeetutorial~svn/trunk/examples/web/jsf/checkout-module</a>.
  When I pressed the button it stayed on the same page, where the button was, instead of going to the flow's start page. </p>
  
  <p>After many hours of suffering, I realized that the problem is in the beans.xml, in my beans.xml I had this:</p>
  
  <pre><code>bean-discovery-mode="annotated"
  </code></pre>
  
  <p>which is the recommended setting according to the documentation (<a href="http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/javaee/beans_1_1.xsd" rel="nofollow">http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/javaee/beans_1_1.xsd</a>).
  When I changed this to </p>
  
  <pre><code>bean-discovery-mode="all"
  </code></pre>
  
  <p>it started to work. </p>
  
  <p>Somehow CDI does not recognize the flow definition as an annotated class. I tried to make it a @Named class, or a @ApplicationScoped class, but non of these helped.
  I don't know if it is the intended behavior, or a bug.</p>
  
  <p>Hope it saves a few ours to someone.</p>