How to enter in a Flow from p:menuitem ? ?

Post Reply
musicrizz13
Posts: 2
Joined: 01 Jun 2020, 16:16

20 Sep 2020, 21:57

I need help !

primefaces 8.0 - diamond layout 1.2 - tomEE 8 web profile

I want to enter in a Flow from a p:menuitem .

Code: Select all

<p:menuitem id="om_pp" 
                    value="Inserisci Nuovo Proprietario" 
                    icon="pi pi-user-plus"
                    outcome="proprietarioFlow"/>   <!-- FlowID -->
But , I have a error : Could not resolve NavigationCase for outcome: proprietarioFlow !!

This is my Flow definition:

Code: Select all

public class ProprietarioFlow implements Serializable {

    private static final long serialVersionUID = 1L;

    @Produces
    @FlowDefinition
    public Flow defineFlow(@FlowBuilderParameter FlowBuilder flowBuilder) {

        String vdlDocBase = "/dashboard/admin/";

        flowBuilder.id("", Costanti.FLOW_ID_PROPRIETARIO);

        flowBuilder.viewNode(Costanti.FLOW_ID_PROPRIETARIO,
                vdlDocBase.concat(Costanti.FLOW_ID_PROPRIETARIO).concat(".xhtml"))
                .markAsStartNode();

        flowBuilder.inboundParameter("pageToReturn", "#{flowBean_proprietario.pageToReturn}");

        flowBuilder.returnNode("conferma").fromOutcome("#{flowBean_proprietario.conferma}");

        flowBuilder.returnNode("annulla").fromOutcome("#{flowBean_proprietario.annulla}");

        return flowBuilder.getFlow();
    }

}
Thank you !

musicrizz13
Posts: 2
Joined: 01 Jun 2020, 16:16

21 Sep 2020, 09:59

I have found a problem .

The previous code work perfectly .

The problem is in the damned beans.xml :

Code: Select all

<beans version="1.2"   bean-discovery-mode="annotated"
       xmlns="http://xmlns.jcp.org/xml/ns/javaee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_1_2.xsd">
</beans>
if bean-discovery-mode="annotated" , the @Produces method will never be called !!
the solution is or change bean-discovery-mode="annotated" with bean-discovery-mode="all"
or even better put only <beans/> in the beans.xml.

mert.sincan
Posts: 4345
Joined: 29 Jun 2013, 12:38

26 Sep 2020, 16:53

Glad to hear, thanks a lot for the update!

Best Regards,

Post Reply

Return to “Diamond - PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest