Answered by:
Is this scenario possible using Workflow

Question
-
Hi All,
I need to do a project for Exit interview process where the employee applys his resignation and flow starts moving from his immediate manager, IT department, Commercial dept, ... HR dept to get their clearance.
During each stage the employee will need to know about the status of his resignation application. I feel it's possible using workflow, but not sure whether it's sequential/state machine.
Kindly guide me with samples.
ThanksTuesday, January 5, 2010 8:46 AM
Answers
-
Hi Pad,
As with most scenarios it can be achieved using both alternatives. However, using a state machine workflow offers you the most flexibility. For example, if you have a state for each phase (immediate manager , IT Dept , Comm Dept , HR Dept ) and you need to go back to the IT Dept based upon a business rule in the HR Dept clearance, then this is easily achieved using the state machine. The desired effect in sequential workflow can become unwieldy and difficult to maintain as I am sure you can imagine. WF4 offers a flowchart workflow to achieve this goal.
For me a state machine offers the more flexible and maintainable solution. Each state initialization could perform activities such as email stakeholder, permission setting etc. If you are 100% certain you would never need to go back to an earlier department then I would go for a sequential workflow.
Building a Sequential Workflow
http://msdn.microsoft.com/en-us/library/dd692925.aspx
Building a State Machine Workflow
http://msdn.microsoft.com/en-us/library/dd692929.aspx
Hope this helps.
MattJ- Proposed as answer by MattJordan Thursday, January 7, 2010 5:13 PM
- Marked as answer by Andrew_ZhuModerator Monday, January 11, 2010 2:47 PM
Wednesday, January 6, 2010 12:15 PM
All replies
-
Hi Pad,
As with most scenarios it can be achieved using both alternatives. However, using a state machine workflow offers you the most flexibility. For example, if you have a state for each phase (immediate manager , IT Dept , Comm Dept , HR Dept ) and you need to go back to the IT Dept based upon a business rule in the HR Dept clearance, then this is easily achieved using the state machine. The desired effect in sequential workflow can become unwieldy and difficult to maintain as I am sure you can imagine. WF4 offers a flowchart workflow to achieve this goal.
For me a state machine offers the more flexible and maintainable solution. Each state initialization could perform activities such as email stakeholder, permission setting etc. If you are 100% certain you would never need to go back to an earlier department then I would go for a sequential workflow.
Building a Sequential Workflow
http://msdn.microsoft.com/en-us/library/dd692925.aspx
Building a State Machine Workflow
http://msdn.microsoft.com/en-us/library/dd692929.aspx
Hope this helps.
MattJ- Proposed as answer by MattJordan Thursday, January 7, 2010 5:13 PM
- Marked as answer by Andrew_ZhuModerator Monday, January 11, 2010 2:47 PM
Wednesday, January 6, 2010 12:15 PM -
Thanks a lot MattJ,
Your reply has given me lead on how to proceed with my project. Surely I will check these links and get back to this forum for any further clarifications.
Thanks a lot once again.Wednesday, January 6, 2010 1:17 PM -
If you use 4.0, you can also reference some samples under: http://msdn.microsoft.com/en-us/library/dd483313(VS.100).aspx and download the code from here: http://www.microsoft.com/downloads/details.aspx?FamilyID=35ec8682-d5fd-4bc3-a51a-d8ad115a8792&displaylang=en
I hope this helps too.
Thank you,
Khalid M.
KM- Proposed as answer by KMOUSS Wednesday, January 6, 2010 7:49 PM
Wednesday, January 6, 2010 7:49 PM -
Hi Both,
In the scenario stated above, let's assume the flow moves like this....
Employee --> Manager (approves) --> IT (Rejects) --> Employee.
Now, can we make the workflow move to the IT directly with out going to Manager again. How can this be done.
Please suggest.
ThanksMonday, January 11, 2010 12:16 PM -
Your workflow does not automatically transition from one state to another. It is transitioned within a state (there is a workflow activity - SetState) and as part of that transitioning you could have some conditional logic (for example, if x go to Manager, if y go to Reject). When deciding on whether to transition to the manager state you would always have some logic that would make sure you didn't go into manager again (e.g. a flag that has been set that has been serialized as part of the workflow).
MattJMonday, January 11, 2010 12:25 PM