《WF in 24 Hours》读书笔记 - Hour 1 - Understanding Windows Workflow Foundation

2020-11-19 11:34

阅读:795

标签:des   style   class   code   tar   ext   

1.1 Hour 1 - Understanding Windows Workflow Foundation

 

1.1.1 What workflow is in general

  • A workflow is logic-consisting of one or more steps that are 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 that may occur over a period of time, it must track the state of the overall process. Here are 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:
    1. Design-time transparency
    2. State management
    3. Runtime transparency

1.1.2 What Windows Workflow Foundation (WF) is

 

1.1.3 The main components of WF one-by-one

  • Standard Modeling Activities Activities are 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 30 activities. It calls these activities the Base Activity Library (BAL). The activities are 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 arbitrary code to be written, and another group that supplies exception handling.
    1. control flow activities
      1. Sequence: a shell for other activities. It is equivalent to {}in C#. It is a block where activities may be added. A Sequenceactivity can hold a tree of activities.
  1. While: loops while the condition associated with it remains true.
  1. IfElse: holds one or more branches that are each governed by a condition. The first branch to return trueis executed; no other branches are executed.
  1. Listen: allows two or more branches to be added that each wait for an external event.
  2. Parallel: executes two or more branches concurrently. TheParallel activity will wait

for all branches to complete before completing.

  1. Replicator: can process a number of elements specified at runtime and can do 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.
  1. EventHandlingScope: is similar to a Listenactivity but it allows the events to be received multiple times.
  1. data exchange activities
    1. CallExternalMethod: is used to send data from the workflow to the application running the workflow (the host).
    2. HandleExternalEvent: allows data to be sent from the

host to the workflow.

  1. WebServiceOutput and WebServiceInput: expose a workflow as a web service
  1. InvokeWebService: call a web service from a workflow
  2. Send: is used to connect to a WCF endpoint (or any compatible endpoint) from a workflow.
  3. Receive: is used to expose a workflow as a WCF Service.
  4. 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 is better to use a custom activity.
  1. Multiple Workflow Styles
    1. ConditionedActivityGroup: can be placed on both sequential and state machine workflows.
  1. sequential workflows: are recommended for deterministic processes that have a well-defined beginning and end.
  2. State machine workflows: are best suited for dynamic processes that iterate through states without a guaranteed order.
  1. Data-driven workflows: are best suited when the data determines the process execution order.
  2. In essence, a state machine workflow is an inverse sequential workflow. The events are on top and the sequential logic embedded when using a state machine workflow. In a sequential workflow it is the opposite.
  1. Hosting
    • WF is not a standalone application. WF is an engine that executes workflows on behalf of a host application. A Windows Forms, ASP.NET, Windows Service, or other Windows application starts the workflow engine running. The host application is then responsible for managing the life cycle of the workflow engine. The host application must remain active while workflows are running and communicate with the workflow engine. If the host application terminates while workflows are running, they will stop running. The host application needs to know the status of workflows the workflow engine is running on its behalf. It achieves this by subscribing to a number of events the workflow engine makes available to it. Three of the most common are completed,terminated, and idled.
  1. completed event: fired when a workflow completes processing successfully.
  2. terminated event: fired when the workflow completes unsuccessfully.
  3. idled event: the workflow is not complete but inactive.

1.1.4 Installation instructions and requirements

《WF in 24 Hours》读书笔记 - Hour 1 - Understanding Windows Workflow Foundation,搜素材,soscw.com

《WF in 24 Hours》读书笔记 - Hour 1 - Understanding Windows Workflow Foundation

标签:des   style   class   code   tar   ext   

原文地址:http://www.cnblogs.com/ilovewindy/p/3706378.html


评论


亲,登录后才可以留言!