Page Flow : .Navigate and .Next

Topics: Web Client Software Factory
Oct 27, 2006 at 10:29 AM
It's been a while since I looked at the UIP Application Block and I don't really know how much has changed with this implementation of page flow, so:

Can someone give me a quick run down on the two methods above.

.Navigate("nodeName")
.Next()

Will the Navigate call fail if the "nodeName" you are trying to get to is not a valid transition from your current node?

The .Next() method can only really be used in a linear wizard type process, is that what its there for?

Thanks,

Stephen ...
Oct 27, 2006 at 4:49 PM
Hi Stephen,

We're still working on the page flow features, but let me share with you our thinking. We want to allow the page flow provider the ability to define and determine the next page transition. If you are using Windows Workflow Foundation, you can use the designer to define your page flows, and the transitions between pages can be determined by various rules in the page flow definition. As long as the page flow provider has enough context (e.g. state) to evaluate the rules, it can appropriately determine the next page. So MoveNext() doesn't mean the next page in a linear flow, but rather "move to the page that makes sense based upon the page flow definition and the current application context." It's the job of your controller to put the appropriate information into the page flow provider's context/environment so that it can determine the transition.

But not every provider may have the ability to evaluate the next page in this fashion, or developers may prefer to code the requests for page transitions within their controller code. The Navigate(event) method allows you to initiate a specific transition. As with UIP, there is a level of indirection - the page flow provider looks up the event, and then determines the page based upon configuration information.

In the scenario where you request a transition using an event that is not defined, what would be your ideal response? An exception back to the controller, the ability to define an "error" state that determines the transition, or something else?

Thanks,
Tim
Oct 30, 2006 at 8:20 AM
Tim,

Firstly, with Next(), if the controller has not put enough information into State what will happen? I suppose this should follow the same rules as the "unknown event" scenario you described at the end of your post.

All our steps have configured actions, which can result in a straight transition, or execution of a UI Command (containing process logic equiv. to that in your controller classes), the outcome of which will result in another action based on configuration.

Currently, within our framework, if a UI Command returns an outcome that has not been defined then he flow returns to the calling page. i.e. no redirect. This is something we would like to change so that we can atleast configure the framework to throw an exception in these cases.

With the Navigate() call, does it take the next step/view/node name as the parameter or is it the name of a transition from your current step? I had assumed it was the name of the next step in the process meaning that the process steps where embedded in the controller code.

Background to our Framework...

Within our framework, we call GenericController.ExecuteAction(<actionName>) from the view resulting in:

- The controller looking up configuration to determine if this should result in execution of a UI Command or Transition.

- If the Action results in a Transition then the controller uses the configured process map to determine the next step and its associated url.

- If the Action results in a UI Command then the controller dynamically loads and executes the command.

- The response fo the Command will contain an Outcome which the controller uses to determine the next Action to be triggered. This can be a transition or UI command ...

"I'm in danger of this turning into a pretty unstructured description of the entirety of our Framework but you get the idea(?)."

One thing which we have introduced which you may consider, is allowing the definitions of Preconditions for a step/node. In our framework we use these configured preconditions to check state for appropriate contents before loading it. i.e. Before loading the customer view page, make sure we have a customer in State, these Preconditions are subject to the same "outcome-to-action" mapping as our commands.

I rambled a bit there but if you spotted anything of interest let me know.

Stephen ...
Nov 16, 2006 at 12:32 AM
I'd second that. And it would be nice to have server side only navigations instead of response redirect.