Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Tham khảo tài liệu 'microsoft press windows workflow foundation step by step phần 4', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Chapter 6 Loading and Unloading Instances 105 6. If you expand the Databases node in Object Explorer you should find the new WorkflowStore database has been added. 7. Next we ll need to execute the scripts I mentioned that .NET 3.0 provides for persistence starting with the schema script. As before the scripts are located in WINDIR Microsoft.NET Framework v3.0 Windows Workflow Founda-tion SQL EN where WINDIR is your Windows directory typically C Win-dows . From SQL Server Management Studio s File menu select Open and then File which brings up the common Open File dialog box. Using the controls in the Open File dialog box locate the schema script SqlPersistenceService_Schema.sql. Select that from the available scripts and click the Open button. Note that you ll need to connect to your database server once again. 106 Part I Introducing Windows Workflow Foundation WF 8. SQL Server Management Studio will load the script into a new window but before we actually run the script remember we ll need to specify which database we want the script to run against. Of course we want to use the WorkflowStore database we just created. Therefore locate the WorkflowStore database in the drop-down list of databases and select it as the target. 9. With the WorkflowStore database designated as the target of the script execute the script by clicking the Execute button on the toolbar. 10. Repeat steps 7 through 9 to execute the SqlPersistenceService_Logic.sql script. This loads the necessary stored procedures into the database. If everything worked as it should we now have a database ready for workflow instance storage. It s time to plug SqlWorkflowPersistenceService into our workflow processing so that we can use the database we just created. Introducing the SqlWorkflowPersistenceService Service If it becomes necessary to persist an executing workflow something must actually perform the persistence action. However saving and restoring workflow instances is optional you don t have to .