Thursday, November 28, 2013

Re: Multipath/Branch Workflow Wizard

I searched for it some time ago and didn't find anything so I started thinking about the basic design of a wizard that supports multiple paths, optional steps and eventually loops (e.g. "Do you want to create another Item?" -> Yes -> Jump back to step x in branch y).

From an API point of view I would like to have something declarative so I can see the wizard structure and all the decisions for each branch at one place and not scattered around in all wizard steps, e.g.

void initFlow() {
     .thenOptional(<predicate>, page3)
         newBranch(<predicate>, page4A, page5A),
         newBranch(<predicate>, page4B, page5B, page6B)

But its not fully thought out yet (some cases only work by duplicating some declarative code but these cases are relatively rare I would guess) and does not contain loops (may be possible by "tagging" a page with an id and then being able to jump to id's based on predicates). The <predicate> stuff will be nice with Java 8 when you can use lambda's which could result in something like:

   .thenOptional(page1::isAskForDetailsSelected, detailsPage);

-- J.

You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment