Thư viện tri thức trực tuyến
Kho tài liệu với 50,000+ tài liệu học thuật
© 2023 Siêu thị PDF - Kho tài liệu học thuật hàng đầu Việt Nam

microsoft press windows workflow foundation step by step phần 3 ppsx
Nội dung xem thử
Mô tả chi tiết
70 Part I Introducing Windows Workflow Foundation (WF)
6. In the Name field, type the name of your project or application.
7. In the Location field, type the file system location where you would like your project files
stored.
8. If the Create Directory For Solution check box is not already selected, select it.
9. Click OK. Visual Studio 2005 will now create the basic project for you and bring up the
workflow visual designer user interface.
As with the sequential workflow application, Visual Studio is now ready for us to build a statemachine workflow. We’re not quite ready to actually build a state-machine workflow at this
point in the book. Why? Because we need to trigger the events that cause the workflow to
change state. To do that, we’ll need to understand how workflow instances communicate with
their host applications so that our host application can perform the trigger actions. We’ll
begin looking at host and workflow communication in Chapter 8, “Calling External
Methods,” but it’s in Chapter 10, “Event Activities,” that we learn what we need to know
to drive state-machine workflows.
Chapter 4 Introduction to Activities and Workflow Types 71
Chapter 4 Quick Reference
To Do This
Select the appropriate workflow type Model your system, and look closely at what is controlling
the process. If the workflow is controlling the process,
select a sequential workflow model. If external inputs are
controlling the workflow, select a state-machine workflow.
If complex behavior is to be modeled, a rules-based
approach might be the best. Often a combination of
workflow types will be necessary.
Build a sequential workflow application Start Visual Studio 2005, and select the New and then
Project menu items from the main File menu. From the
resulting New Project dialog box, select the Workflow node
from the Visual C# subtree shown in the Project Types
pane. From the Templates pane, select either the Sequential Workflow Console Application or the Sequential
Workflow Library type.
Build a state-machine workflow application Follow the steps for building a sequential workflow application until you choose the template. In the Templates
pane, select either the State Machine Workflow Console
Application or the State Machine Workflow Library type.
Build a rules-based workflow application Create a sequential workflow application, and then skip to
Chapter 12 to learn how to apply the Policy or rule
condition.
73
Chapter 5
Workflow Tracking
After completing this chapter, you will be able to:
■ Describe workflow-pluggable services
■ Create an event tracking database and populate it with tables and scripts
■ Activate the event-tracking service
■ Create a custom tracking profile
■ View your workflow's tracking information
So far we’ve seen the basic objects that workflows are built from and controlled by. We build
workflow tasks from activities, which when executing are managed by a WorkflowInstance
object. Workflow instances are queued and controlled by the WorkflowRuntime. But Windows
Workflow Foundation (WF) doesn’t just provide us with objects—it also provides us with
services that work alongside our objects.
Pluggable Services
Workflow services are additional software functions that your workflows can, and will, use to
complete their tasks. Some of the services are optional, like the tracking service we’ll work
with in this chapter. Other services are required for your workflow to execute at all.
Workflow services are pluggable. A pluggable service is a service that can be selected a la carte
to perform specific tasks. For example, there are services that manage threading, tracking,
transactions, and so forth. You select the service that’s right for your workflow. You can even
create your own.
So what do these services look like? What do they do for us? Table 5-1 lays out the available
base services and gives you a better idea which services are available and what they do.