"No one is harder on a talented person than the person themselves" - Linda Wilkinson ; "Trust your guts and don't follow the herd" ; "Validate direction not destination" ;

February 16, 2010

Getting ready for Workflows (WWF)

Yea I got a book .NET framework 3.5 in simple steps. I learnt basics of workflow. I am sharing the same in this post.
Workflow notes
WF – Workflow. Graphical Representation that defines a set of tasks or processes that produce a result
Workflow principles
  • Coordinate work done by people and software
  • Long running and stateful
  • Automate business processes
  • Graphically build workflow
Components of workflow. There are six major components of workflow
1. Workflow – Can be either Sequential or State machine workflow.
Sequential workflow
  • Activities executed in well-defined order
  • It may involve branching or looping of activities
State Machine workflow
  • Contains a set of states
  • First state represents start state, Last state represents final state
  • Event driven model
2. Base Activity Library - Collection of activities used to create workflows
3. Custom Activities – Develop custom workflows based on business needs
4. Host process – Workflow cannot run as a standalone product. A host process can be Windows Forms or Web Services or Web Services
5. Runtime Engine – Responsible for executing workflow instance
6. Runtime Services – Important services are
  • Persistence Services – Save the state of workflow
  • Tracking Services – Enable developers to monitor workflow
  • Transaction Services – Provide transaction support needed for data integrity
Example – Simple workflow with conditions
1. Create a simple sequential workflow console application as shown below

2. Add a While loop
3. Add an if else activity for the while loop
4. Add a code activity for if-else/while loop as shown below
5. Add code as shown in below pic, Declare rollNumbers, marks
6. Add a Declarative Rule Condition and enter the condition

7. Add Code for first If-Else

8. Add Code for Second If-Else

9. Add code for code activity as below

10. Build the application. Workflow result as shown in console window

More Reads - WF4: How to Unit Test a Workflow that calls a WCF Service

Happy reading.....

No comments: