Migrate Flowscope to Glassfish 4.1

时间:2015-10-06 08:27:23

标签: glassfish-4.1 flow-scope

In glassfish 4.0 I have a working JSF application which uses @flowscope. An example of the flow definition follows:

package flow;

import javax.enterprise.inject.Produces;
import javax.faces.flow.Flow;
import javax.faces.flow.builder.FlowBuilder;
import javax.faces.flow.builder.FlowBuilderParameter;
import javax.faces.flow.builder.FlowDefinition;
import javax.inject.Named;

@Named("sintesitransiti")
public class SintesiTransitiFlow {

   private static final long serialVersionUID = -7623501087369765218L;
   @Produces @FlowDefinition
   public Flow defineFlow(@FlowBuilderParameter  FlowBuilder flowBuilder) {
       String flowId = "sintesitransiti";
       flowBuilder.id("", flowId);
       flowBuilder.viewNode("sintesitransiti", "/dir1/sintesitransiti/sintesitransiti.xhtml").markAsStartNode();
       flowBuilder.viewNode("SintesitransitiResult", "/dir1/sintesitransiti/List.xhtml");
       flowBuilder.returnNode("taskFlowReturn1").
               fromOutcome("/index.xhtml");

       return flowBuilder.getFlow();
   }
}    

I upgraded to netbeans 8.02 which is shipped with glassfish 4.1. In the source code I had to change some import, no other changes. The flowscope doesn't work any more. I didn't notice any related error in the server log. It seems to me that the flow annotations are simply discarded. Any suggestion ?

Thanks

1 个答案:

答案 0 :(得分:0)

这是我的错。 不知道为什么,但在开发源代码中我丢失了@Produces注释。