3 Replies Latest reply on Aug 4, 2006 11:37 AM by Richard Leherpeur

    Setting the pageflow dinamically when stating a conversation

    Richard Leherpeur Novice

      Hello,

      I have a use case that requires me to start different pageflow depending on the context.
      One obvious solution is to define as many starting methods with the right annotation and call the according method

      @Begin(pageflow = "flow1")
      public void startFlow1() {
      ...
      }
      
      @Begin(pageflow = "flow2")
      public void startFlow2() {
      ...
      }
      


      That would be fine for just 2 pageflows. But if the number of pageflow grows, that could become a little annoying to have to write a new method each time. Also it is not really flexible and robust.

      So I thought of the following solution:

      @Begin
      public void start(String flowDefinitionName) {
       // whatever has to be done before starting the flow
       ...
      
       Pageflow.instance().begin(flowDefinitionName);
      }
      


      In that case, the same method is always called and we just pass the right pageFllow definition.

      It seems to work but I would like to know if someone sees anything wrong with this? Is there even a better wat of doing this?

      Thanks

      Richard