This blog is subject the DISCLAIMER below.
Showing posts with label Workflow. Show all posts
Showing posts with label Workflow. Show all posts

Sunday, September 16, 2007

Windows Workflow 2

In this post we will go deeper inside Windows Workflow and how to create a project from Workflow type.

You need to have VS2008 or VS2005 + VS2005 extensions for Workflow

From VS -> new project->Workflow Let’s understand the different types of Workflow projects

Empty Workflow Project: An empty workflow project that you start to add some of Visual C#/Visual Basic.net items the output of this type is .dll

Sequential Workflow Console Application: Workflow project from Sequential type if you don’t know what Sequential Workflow is please read http://fci-h.blogspot.com/2007/09/windows-workflow-1.html Workflow types section the output if this type is console application .exe

Sequential Workflow Library: Workflow project from Sequential type if you don’t know what Sequential Workflow is please read http://fci-h.blogspot.com/2007/09/windows-workflow-1.html Workflow types section the output if this type is .dll

State Machine Workflow Console Application: Workflow project from State Machine type if you don’t know what State Machine Workflow is please read http://fci-h.blogspot.com/2007/09/windows-workflow-1.html Workflow types section the output if this type is console application .exe

State Machine Workflow Library: Workflow project from State Machine type if you don’t know what State Machine Workflow is please read http://fci-h.blogspot.com/2007/09/windows-workflow-1.html Workflow types section the output if this type is .dll

Workflow Activity Library: This type let you create a custom activity to be used in more than project you can imagine it as component; I’ll talk about it later the output if this type is .dll

So, I’ll work on Sequential Workflow Console Application and explain some of Workflow ControlsOnce we selected Workflow project from Sequential Workflow Console Application type; VS opens a window to design our Workflow and as we see there is a start and end elements.

Let’s begin with “Code” Control: to use drag it and drop between the start and the end element of the Workflow as shown we will notice an exclamation mark inside red ball it notifies us that there is no method to be invoked at runtime, so click on code figure and go to its properties and then specify “Execute Code” and write HelloWorldMethod, we’ll find VS switch to .cs file and has generated a HelloWorldMethod method so I’ll write this code Console.WriteLine(“Hello World”);This method considered as the event that raised when the “Code” executed.

Tip: you use “Code” control only if you want to execute something just one time.

“While” Control: used for looping, it has Condition which has two types; Code condition and Declarative code condition. So, I’ve dragged a “while” control inside my design and dragged the “code” control that created before inside it, cool? Yes that’s very easy.

Condition like “Code” control’s condition, that’s the event that raised when “while” control executed I’ve two ways of condition
1- Code condition: specify the code to run, usually we don’t write code more than stopping it like here I increased counter and set “While” to stop when counter = 10 by assign Result = true.
2- Declarative Rule Condition: when selecting Declarative Rule Condition I must set the Condition name, a new window opens then select new a new windows opens to set my condition I wrote counter<10 href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjchIAg6y5_O1FUcneZzafwuXjK8ek9ZZ5zMzBJzOTjvxldxyGt7GhyphenhyphenZ29b2Zg49OeONKgXym11ZBjB3dq-pYQeA8uT2X-N7hNEW1G-VKl2JlTPHLvtLgos2mO_XQNYJV5BT-Wl/s1600-h/9.jpg">

.. more.

Monday, September 03, 2007

Windows Workflow 1

I’ll write (en shaa ALLAH) about Workflow, and especially on its objects that listed in VS toolbox when working with Workflow project.

So, let me introduce workflow to you (If you know, escape next paragraph) Workflow is part of .net framework 3.0 formerly known “WinFx”, .net framework 3.0 consists of WCF (Windows Communication Foundation), WPF (Windows Presentation Foundation), WF (Windows Workflow) and Windows CardSpace (CardSpace) and built on .net framework 2.0.

In this series I’ll focus on Workflow and spot light on Workflow rich controls and Workflow engine.In brief Workflow empowers you as software engineer to deliver workflow-based application using Workflow engine and Workflow controls that enable business managers, software engineers, software developers, and each one in the project to interact and understand the most complex business process.So, I’ll explain the architecture of Workflow for better understand on
This image from “Introduction to Developing with Windows® Workflow Foundation and Visual Studio® 2005” http://www.microsoftlearning.com/

1-You can use Workflow controls from VS to draw Workflows for most complex business processes.
2-Workflow contains a lot of built-in activities that commonly used in business processes such as send mail, handle errors, etc…
3-You can create your custom activity.
4-Activity framework contains common functions that used by a lot of activity such as compilation, validation and so on.
5-Workflow runtime, the components that run workflow instance.
6-Persistence services used to save Workflow instances in database or another location.
7-Transaction services to guarantee that data remains consistent all the time.
8-Tracking services help to determine and record which activity in specific Workflow run and when it run it helps in optimizing Workflow.
9-Scheduling services to control the way Workflow runtime creates threads for workflow instances.

Workflow types:
1-Sequential Workflow: has specific start, specific end and activities in predefined order may have loops, conditional tests and so on.
2-State machine Workflow: has specific start, specific end and states that change Workflow transitions that change a workflow instance from one state to another.

.. more.