After you have completed this chapter, you will learn:
1. Use workflow in your application
2. Understand the basic functions of the "WorkflowRuntime" object
3. Know how to start and stop the workflow runtime
4. Ability to use a variety of workflow runtime related events
When you perform a task in a WF environment, you need something to oversee the execution process, which is the object named "WorkflowRuntime". WorkflowRuntime to start a separate workflow task. During the execution of your task, WorkflowRuntime will also respond to the corresponding events for different situations. Also, WorkflowRuntime can add an additional service to your execution environment to keep track of it.
WF Architecture Overview See the following figure:
WF executes in parallel with your application. In fact, we need your application as a host. A host application can be a Windows Forms application, a console application, a asp.net Web application, or even a Windows Server. WF runtime is executed with your application in a. NET application domain, with only one WorkflowRuntime instance per application domain trying to create a second WorkflowRuntime instance in an application domain, and the result is to throw a " InvalidOperationException "Exception.
Workflow application-"workflows"-meaning refers to the logical set of activities created. These logical activities are used to accomplish the workflow tasks you need. When you host the workflow runtime, you are actually manipulating the activities in the workflow and letting workflow run them. The result is to generate a workflow instance, the workflow instance is a currently executing workflow task that can complete a logical set of activities on its own, recalling the first chapter, the activity can execute the code you provide and make the appropriate decisions about the input data. In the next chapter we will describe the workflow examples, and the following chapters will introduce the activities.