1.1Hour 1-understanding Windows Workflow Foundation1.1.1What workflow are in general
- A workflow is logic-consisting of one, or more steps, that's predicated by one, or more conditions-that a system or person Must perform to complete a function. Because the logic or process automated by a workflow generally consists of more than one step so may occur over a period Of time, it must track the state of the overall process. Here is some examples of workflows:an order process, an expense report, and rescheduling a missed meeting.
- In short, workflow consists of both logic and managing the process state.
- Benefits:
- Design-time Transparency
- State management
- Runtime Transparency
1.1.2What Windows Workflow Foundation (WF) is1.1.3The main components of WF One-by-one
- Standard Modeling Activities Activities is the unit of design and execution in WF. WF comes with a set of modeling constructs that it calls activities and a workflow designer. WF ships with approximately-activities. It calls these activities the Base Activity Library (BAL). The activities is largely segmented as follows:control flow activities, activities that facilitate data exchange between The workflow and the application running the workflow (a Windows Forms application, for example), one that permits Arbitr ary code to is written, and another group that supplies exception handling.
- Control flow Activities
- SEQUENCE:A shell for other activities. It is equivalent to {}in C #. It's a block where activities may added. A sequenceactivity can hold a tree of activities.
- While:loops while the condition associated with it remains true.
- Ifelse:holds one or more branches that is each governed by a condition. The first branch to return Trueis executed; No other branches is executed.
- Listen:allows, branches, and more are added to is, each of the wait for a external event.
- Parallel:executes or more branches concurrently. Theparallel activity would wait
For all branches to complete before completing.
- Replicator:can process A number of elements specified at runtime and can doing so in serial or parallel. It is similar to the C # foreach statement with the additional capability to process in parallel as well as sequentially.
- Eventhandlingscope:is similar to a listenactivity but it allows the events to be received multiple times.
- Data exchange Activities
- Callexternalmethod:is used to send data from the workflow to the application running the workflow (the host).
- Handleexternalevent:allows data to is sent from the
Host to the workflow.
- Webserviceoutput and webserviceinput:expose a workflow as a Web service
- Invokewebservice:call a Web service from a workflow
- Send:is used to connect to a WCF-endpoint (or any compatible endpoint) from a workflow.
- Receive:is used to expose a workflow as a WCF Service.
- Code:points to a handler with standard. NET code. It can be used to add custom functionality to a workflow, although in many cases it's better to use a custom activity.
- Multiple Workflow Styles
- Conditionedactivitygroup:can is placed on both sequential and state machine workflows.
- Sequential Workflows:are recommended for deterministic processes that has a well-defined beginning and end.
- State machine Workflows:are best suited for dynamic processes, that iterate through states without a guaranteed order.
- Data-driven Workflows:are best suited when the data determines the process execution order.
- In essence, a state machine workflow was an inverse sequential workflow. The events is on top and the sequential logic embedded if using a state machine workflow. In a sequential workflow it is the opposite.
- Hosting
- WF is not a standalone application. WF is an engine, the executes workflows on behalf of a host application. A windows Forms, ASP, Windows Service, or other Windows application starts the workflow engine running. The host application is and then responsible for managing, the life cycle of the workflow engine. The host application must remain active while workflows is running and communicate with the workflow engine. If the host application terminates while workflows is running, they would stop running. The host application needs to know the status of workflows, the workflow engine is running on its behalf. It achieves the subscribing to a number of events, the workflow engine makes available to it. Three of the most common is completed,terminated, and idled.
- Completed event:fired when a workflow completes processing successfully.
- Terminated event:fired when the workflow completes unsuccessfully.
- Idled event:the workflow is not complete but inactive.
1.1.4Installation instructions and Requirements