Hi Dominik,
Aleks goes over the basics of his Process implementation toward the end of this post - http://forum.springframework.net/vie...?t=392&start=0.
Basically, a process is a user workflow (registration, checkout, etc.). Session is encapsulated within the process. The process also is responsible for moving a user from view to view.
To use it, there are a few steps to follow... Below is a sample registration process...
1. web.config process definition
Code:
<object id="registration" type="Spring.Web.Process.AnthemProcess, Spring.Web.Anthem" singleton="false">
<property name="Controller" ref="registrationController" />
<property name="DefaultView" value="RegistrationForm" />
<property name="Views">
<dictionary>
<entry key="registrationConfirmation" value="RegistrationConfirmation" />
</dictionary>
</property>
</object>
2. web config controller definition
Code:
<object id="registrationController" type="zblock.Registration.RegistrationController" singleton="false">
<property name="Member" ref="member" />
</object>
3. web.config definitions for model objects
Code:
<object id="member" type="zblock.Membership.Member, zblock">
</object>
4. web.config view definitions
Code:
<object type="RegistrationForm.aspx" parent="standardPage">
</object>
<object type="RegistrationConfirmation.aspx" parent="standardPage">
</object>
The important thing, as Aleks mentions in his post, is to browse to Registration.aspx... You should then see the view you defined under the DefaultView property of the process...
Your controller methods should return strings that get passed into the SetView method of a Page's Process to determine which view to display next...
Code:
Process.SetView(Controller.RegisterMember());
In the above example, RegisterMember would return the string "registrationConfirmation" on a successful registration. Note that this is the key to the confirmation form view defined in the registration process...
Finally, the Anthem process works well out of the box, but if you wanted to use your own, you need only implement the two abstract methods of AbstractProcess
Code:
public class AnotherProcess : AbstractProcess
{
protected override void NavigateToCurrentView()
{
HttpContext.Current.Response.Redirect(this.ProcessUrl + "?" + ProcessIdParamName + "=" + this.Id);
}
protected override void NavigateToStartView()
{
HttpContext.Current.Response.Redirect(this.ProcessUrl + "?" + ProcessIdParamName + "=" + this.Id);
}
}
Hope that helps (and is accurate!)...
-- John