This project is read-only.

How to use StateMachine Workflow (WF4) in ASP.NET

Aug 4, 2011 at 7:21 PM


I am new to Work flows. Below is a sample application i am planning to develop using WF4 and ASP.NET

1. An employee will raise request for leave. This will be send to Manager

2. Manager will review it and approves or may ask for further clarification; then it will be redirected to employee.

3. HR will review and approves or may ask for further clarification; it will be again redirected to the employee

Below are few queries related to the App:

1. How can we go directly to a specific transition from ASP.NET in workflow


Manager approves..but HR denied. In this case employee will give some clarification and resubmits. In this case there is no need for Manager approval. So, we have to redirect directly to HR.


1. Is the requirement possible through WF4 using StateMachine in ASP.NET



Aug 9, 2011 at 8:30 AM

In this case, the StateMachine would have two States (Manager and HR), and one final State (Approved).  The Manager Approval would be a Transition between Manager and HR, and the HR Approval would be the transition between "HR" and "Approved" stated.

The HR submission would be a "Trigger" between "HR Approval" and "Approved".  Submission would trigger the evaluation of the submission and this "Receive" and "Evaluate" would be a part of Transition.Trigger.  The "Condition" of the Transition would decide if the submission is rejected or accepted.  If it is accepted, the StateMachine would transition to the "Approved" state automatically.  If it is rejected, that the instance remains in the "HR" state, until the next request comes, the Trigger would be reactivated again to re-evaluate the submission.