1. Trang chủ
  2. » Công Nghệ Thông Tin

Microsoft Office SharePoint Server 2007 administrators companion phần 10 pps

118 209 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 118
Dung lượng 1,67 MB

Nội dung

1014 Part VI Extending Microsoft Office SharePoint Server 2007 third-party products will start to include this technology. Windows Workflow Foundation is embedded in all the Microsoft Office server products—such as SharePoint Portal Server, Project Server, Navision, and CRM. Other Microsoft products will use Windows Workflow Foundation as well. Microsoft BizTalk Server vNext (the one after BizTalk Server 2006) will also include Windows Workflow Foundation. A workflow is executed on a SharePoint server, which in turn uses Windows Workflow Foundation as the foundation of the execution of a workflow process. SharePoint Server 2007 includes support for workflows in lists, libraries, and content types, and it provides queuing and management of lists and libraries to provide the necessary data to the Work- flow Foundation runtime as demanded by the workflow’s configuration. Activity Management SharePoint Server 2007 runs the workflow until it reaches a point at which it cannot pro- ceed until a specific event occurs or the workflow ends. This leads to the persistence of such an activity to the database in a single SQL transaction. After that, the activity is dis- carded from memory. For example, a workflow process might halt until a document is approved. If a workflow is not currently processing any activities, it can get into an idle state, which leads to the hydration of a workflow. As a result, the workflow is discarded from memory and persisted to a database. If a new event occurs that is targeted toward a hydrated work- flow, the event handler extracts the workflow ID from the event and passes it into the SharePoint Server 2007 queue manager, which ensures that the correct workflow is started. In other words, SharePoint dehydrates the workflow as needed. The context of workflow events is persisted to tables in the database. The two SQL Server database tables that are most important when it comes to storing information concerning workflows are Content DB.Workflow and ContentDB.WorkflowAssociation. Important You should not create any application that programmatically accesses Content DB.Workflow and ContentDB.WorkflowAssociation directly. Microsoft does not support this, and using these tables in this way can cause severe performance problems. You cannot predict what load you will cause on the system when running this type of application. Instead, use the SharePoint Web services API and the SharePoint object model to accomplish tasks related to workflows. Once workflow event information is stored in the database, it sits there waiting for an active thread of the SharePoint queue manager that is able to pick up the information and process it. Because of this, it is possible to start a workflow on a given Web front-end and continue to work on the workflow on another Web front-end. Chapter 28 Implementing Microsoft Windows Workflow Services 1015 If multiple workflow items are queued for processing by the Workflow Foundation run- time, one item per operating thread is processed until all items are done. If the SharePoint server runs out of bandwidth, the SharePoint Timer Service (also known as the Windows SharePoint Services Timer, or SPTimer) is used to queue items. The SharePoint Timer Ser- vice is a Windows service that handles scheduled jobs. For example, not only is the SharePoint Timer Services responsible for queueing workflow items, it is also responsible for handling workflow Delay activities. Delay activities are parts of a workflow that allow you to build delays in a workflow based on a time-out interval. Workflow items are always processed by hydrated workflows. The decision to hydrate or dehydrate a workflow is made by SharePoint. Currently, it is not possible to influence this decision process and influence settings regarding queueing, load balancing, and time- based execution. Storing Source Files in Document Libraries Workflows designed with SharePoint Designer 2007 do not contain custom code and are not compiled and deployed as assemblies are. Rather, they are stored in the form of source files within Windows SharePoint Services and compiled into memory only when needed. For each SharePoint site, workflows of this type are stored in a separate docu- ment library. This document library contains a folder for each workflow designed in SharePoint Designer 2007. The folder contains all the source files necessary for the work- flow, including the following ones: ■ The workflow markup file, which contains markup that describes the activities included in the workflow. Workflow markup files have the .xoml file extension. ■ The workflow rules file, which contains the business logic of the workflow in the form of declarative rules (instead of code). Workflow rules files have the .xoml.rules file extension. ■ The workflow configuration file, which contains general workflow configuration information. Such files have the .xoml.wfconfig.xml file extension. ■ ASP.NET Web Forms for any custom workflow forms necessary. Web Forms have the .aspx file extension. As you can see in Figure 28-1, SharePoint Designer 2007 shows you all source files that are part of a workflow in the Folder List task pane. 1016 Part VI Extending Microsoft Office SharePoint Server 2007 Figure 28-1 Source files of a workflow Workflow Markup Language Workflows are expressed in .xoml files containing workflow markup language. The .xoml file extension, shown in Figure 28-1, stands for eXtensible Object Markup Language (XOML) and is a serialization format for the Windows Workflow Foundation workflow objects. The schema for .xoml files is identical to the schema that is used for .xaml (eXten- sible Application Markup Language) files. The only difference lies in the names of the file extensions. Note The .xaml (pronounced “zammel”) extension is the user interface markup language for Windows Presentation Foundation. In principle, .xoml files can be created using any text or XML editor you choose, as long as such files adhere to the XOML schema. Nevertheless, it is advisable to use either Share- Point Designer 2007 or Visual Studio 2005 Designer because those products have built- in support for creating workflows. Compiling Source Files SharePoint Designer 2007 contains a just-in-time compiler that is able to compile the workflow source files into a workflow the first time that workflow is started. SharePoint Designer 2007 keeps the compiled workflow in memory to speed up future execution performance. Each time a workflow is started on a list or library item, SharePoint Designer 2007 needs to determine whether the workflow was deployed as an assembly or in the form of a collection of source files. The decision process contains the following steps: Chapter 28 Implementing Microsoft Windows Workflow Services 1017 ■ If a workflow assembly exists, SharePoint Designer 2007 calls that assembly to instantiate the workflow instance. ■ If the workflow was deployed as a collection of source files, SharePoint Designer 2007 has to determine whether it already has a workflow loaded in memory that was compiled based on those source files. ❑ If the workflow was previously compiled, SharePoint Designer 2007 calls the in-memory compiled workflow to instantiate the workflow instance. ❑ If the workflow was not compiled earlier, SharePoint Designer 2007 uses its just-in-time compiler to compile source files into an in-memory workflow, which then will be called to instantiate the workflow instance. How to Implement a Workflow What choices do you have when it comes to implementing workflows? In Share- Point Portal Server 2003, sophisticated workflows were often implemented using third-party products. With the advent of strong support for workflow technology in SharePoint Server 2007, those third-party vendors will probably become less important in the near future. If you want to, you can also create your own workflows using the SharePoint event model. For Windows and ASP.NET applications, developers can use the User Interface Pro- cess Application Block (UIPAB), which can be downloaded for free from http:// www.microsoft.com/downloads/details.aspx?familyid=98C6CC9D-88E1-4490-8BD6- 78092A0F084E&displaylang=en on the Microsoft Web site as a component that can be used in developing workflows. Microsoft Exchange Server 2000 and 2003 and SharePoint Portal Server 2001 included a workflow engine that could be used to create workflows of medium complexity. (This workflow engine was a part of SharePoint Portal Server 2001 and was not supported officially.) BizTalk Server 2006 includes Human Workflow Services (HWS), a technology intended to aid in creating human-oriented workflows, although Human Workflow Services is now considered to be deprecated technology. BizTalk Server includes a Windows SharePoint Services adapter that is able to communicate with SharePoint lists and libraries and can be used to build workflows, although this requires a con- siderable amount of work. Currently, if you are building workflows using Microsoft technology, not just for SharePoint technology, the most appealing options are Windows Workflow Foun- dation and BizTalk Server 2006. Use Windows Workflow Foundation when you are 1018 Part VI Extending Microsoft Office SharePoint Server 2007 creating workflows within an application (human-oriented workflows), and use BizTalk Server 2006 for creating workflows across applications (application-ori- ented workflows). Both products are suitable choices because they speed up the development time for creating workflows considerably and have a bright future. Windows Workflow Authoring Three important groups of users can be distinguished when it comes to creating work- flows: knowledge workers, site administrators and Web designers, and developers. The following list describes the most likely division of responsibilities of these groups: ■ Knowledge workers This group of users consists of people who will create ad hoc workflow solutions based on the predefined workflows already available in Share- Point Designer 2007. The complexity of these workflows will be low. ■ Site administrators and Web designers This group will use SharePoint Designer 2007 to create custom workflows for a specific list or library. The complexity of such workflows will be average. ■ Developers Developers will primarily use Visual Studio 2005 Designer to pro- gram their own workflows, custom code, and activities. Developers can use Visual Studio 2005 Designer to create highly complex workflows. Workflows authored in SharePoint Designer 2007 differ from those created using the Visual Studio 2005 Designer for Windows Workflow Foundation in several important ways: ■ In SharePoint Designer 2007, a workflow cannot be deployed to multiple lists. Such workflows are valid only for the list for which they were created. ■ In SharePoint Designer 2007, you are authoring the workflow directly against a list and the workflow is associated with the list or library at design time. After the asso- ciation is made, workflows are allowed to be run on items within the list or library. Workflows created using Visual Studio 2005 Designer have to be associated explic- itly with a list or library through configuration. The advantage of the latter approach is that a workflow can be associated with multiple lists and libraries. ■ You cannot modify workflows authored in SharePoint Designer 2007. Workflow modifications are explained in the “What Is Different” section later in this chapter. ■ You cannot associate a workflow to a content type using SharePoint Designer 2007. Associating a workflow to a content type means that each list to which a content Chapter 28 Implementing Microsoft Windows Workflow Services 1019 type is added inherits the workflows associated to the content type at that time. Workflow associations update according to the rules of content type push down. In other words, if the administrator makes a change to a content type, he can choose to push down this change. Comparing SharePoint Designer 2007 and Visual Studio 2005 Designer SharePoint Designer 2007 workflows are also referred to as no-code workflows. All activi- ties used within a SharePoint Designer 2007 workflow are well-known safely registered libraries that already have been deployed on the server. Note A safely registered library is a .NET assembly that is registered as an entry on the SharePoint virtual server Web.config <SafeControls> list. Detailed infor- mation about this topic can be found in Chapter 31, “Administrating Code Access Security.” SharePoint Designer 2007 does not allow you to create your own activities, although it is able to generate raw XOML data, which is stored on the SharePoint server. During work- flow execution time, the XOML data is interpreted by the runtime engine, which ensures that all activities used within a workflow are marked as safe. It is possible to use custom activities that are created using Visual Studio 2005, as opposed to using one of the pre- defined activities. Such activities have to be marked on the SharePoint virtual server as being safe. What Is the Same Visual Studio 2005 Designer and SharePoint Designer 2007 both offer the following capabilities: ■ You can create workflows for SharePoint Designer 2007. ■ A workflow markup file is generated. If you are using SharePoint Designer, a work- flow markup file is generated after selecting and configuring the conditions and actions for a workflow. The workflow markup file is generated as soon as you click the Finish button of the Workflow Designer Wizard. Visual Studio 2005 Designer has a graphical tool that helps to create the workflow markup file. Visual Studio 2005 Designer lets you create a graphical model representing the workflow, and the workflow markup file is generated based on this representation. 1020 Part VI Extending Microsoft Office SharePoint Server 2007 ■ Workflows can be started based on certain events, such as the creation of a new document, and they can also be started manually. You can define multiple initiation forms that gather information from users. Initiation forms are displayed when users manually start a workflow on a SharePoint item. ■ You can use custom forms for users to interact with SharePoint tasks. The following three types of forms are used in SharePoint Designer 2007 workflows: ■ Association and initiation forms are displayed to users and need to be filled out before the workflow itself is started. ■ Modification forms present options to users that change the course of the workflow itself as it is running on an item. For example, a user might redirect the task of a document review to another person. ■ Task forms are custom forms that help to create tasks that are the result of the work- flow process, and they can be used to specify detailed information about a task. For example, if a user finishes a document review, this might lead to the creation of a new task. As a result, the original author needs to review the document. The reviewer might use the task form to write some additional comments directed to the author. Note Windows SharePoint Services 3.0 workflows are forms agnostic. This means that you can use any forms technology you want, as long as the forms created are capable of invoking the Windows SharePoint Services object model, generating the data necessary to send to the Windows SharePoint Services object model, and receiving and parsing the required data from the Windows SharePoint Services object model. Currently, you can build workflow forms using ASP.NET or InfoPath. What Is Different The ways in which workflows authored in SharePoint Designer 2007 differ from those created using the Visual Studio 2005 Designer for Windows Workflow Foundation is described in the “Windows Workflow Authoring” section earlier in this chapter. Table 28-1 provides an overview of the differences between Visual Studio 2005 Designer for Windows Workflow Foundation and SharePoint Designer 2007 when it comes to creat- ing workflows. Table 28-1 Workflow Development Tools Differences Visual Studio 2005 Designer for Windows Workflow Foundation Office SharePoint Designer 2007 Code-behind files enable developers to write custom C# or Visual Basic code to express business logic. No code-behind files; workflow rules files declaratively encapsulate business logic instead. Chapter 28 Implementing Microsoft Windows Workflow Services 1021 Considerations If you need to decide whether to create a workflow using SharePoint Designer or Visual Studio 2005 Designer, keep the following points in mind. If you are using Visual Studio 2005 Designer, you can create workflow templates and custom workflow activities, and you can also include code in your workflow and design forms. Also, when you use Visual Studio 2005 Designer, you are not programming a workflow against a specific SharePoint site. At a later time, you will be able to associate the newly created workflow with multiple SharePoint sites. Workflow is authored as a template, which can be associated with multiple sites and lists. Workflow is authored against a specific list and is data-bound to it at design time. Workflow markup files, or markup and code-behind files, are compiled into a workflow assembly. Workflow markup, workflow rules, and supporting files are not compiled into an assembly and are stored directly in a specific document library on a SharePoint site. Workflow template must be associated with each list on which it is to be available. Association happens when the workflow is authored against the specific list; no later association is necessary or possible. You can use any forms technology. For Microsoft technology, this currently comes down to the ability to include ASP.NET and InfoPath forms in SharePoint workflows. ASP.NET forms are automatically generated, and you can then customize them. You can include workflow modifications. Workflow modifications are not available. Workflow modifications are options that you present to your users to change the course of the workflow as it is running on an item. For example, you can allow a user to assign her tasks to another user. You can author custom activities for inclusion in workflows. You must use activities that are already provided on the SharePoint server. Workflow assembly and workflow definition are packaged as a SharePoint Feature and deployed to a SharePoint site. Deployment to a specific list or library happens automatically. Microsoft Visual Studio debugging is available. No step-by-step debugging is available. You can author both sequential and state workflows. You can author only sequential workflows. Table 28-1 Workflow Development Tools Differences Visual Studio 2005 Designer for Windows Workflow Foundation Office SharePoint Designer 2007 1022 Part VI Extending Microsoft Office SharePoint Server 2007 If you use SharePoint Designer 2007 to create a workflow, you are always designing a workflow for a specific SharePoint site. SharePoint Designer 2007 enables you to create declarative, rule-based workflows, and it lets you use pre-existing activities that are already deployed on the SharePoint server in your workflows. You cannot create your own activities or write code-behind pages. However, you can create new activities in Visual Studio 2005 Designer and use these to extend the set of activities located on the SharePoint server. After doing so, you can use those extended activities in SharePoint Designer 2007 workflows. Code-Behind and Code-Beside Files In the discussion about creating workflow applications so far, code-behind files have been mentioned now and then. As an administrator, you probably won’t have to deal with this concept on a daily basis, but it might be useful to take a moment to elaborate on this topic. Code-behind files are a concept best known from the ASP.NET world, where every .aspx page is compiled on request and ultimately inherits from a base class called Page. Code-behind files help to separate user interface code from page controller logic by forming an intermediate class that sits between the .aspx page and the ulti- mate Page base class. Code-behind files are usually compiled into assemblies and placed in the /bin directory of an ASP.NET application. Because the .NET common language runtime (CLR) automatically adds references to assemblies placed in the /bin directory, the .aspx page will have no trouble finding the code-behind class. With the advent of ASP.NET 2.0, the code-behind model has changed to a code- beside model. Using the new concept of partial classes that allow one class to be defined in multiple source files, the .aspx file does not have to inherit from the code- behind file anymore. Instead, the .aspx file and the code-behind file are both partial classes that form a single class after compilation. The result of this is cleaner code. Whenever this chapter refers to code-behind files, we are referring to partial classes that will be merged with other source files during compilation. Chapter 28 Implementing Microsoft Windows Workflow Services 1023 Building a Workflow by Using SharePoint Designer 2007 A custom workflow that is created using SharePoint Designer 2007 can be started in var- ious ways: automatically after a file is created, automatically after a file is changed, or man- ually. Within workflows, you can use actions that are available out of the box, such as assigning a task to someone or sending an e-mail. Note Take some time to think about how the workflow should look before you grab SharePoint Designer 2007. Make sure you have, at the least, a clear picture of the workflow in your mind before you start creating one. Or better yet, create some kind of diagram to represent the workflow. Microsoft Office Visio is a suit- able tool to create workflow diagrams. The whole procedure of building a workflow with SharePoint Designer 2007 can be divided into four steps: 1. Create a workflow. 2. Customize the workflow initiation settings. 3. Configure the predefined conditions and activities. 4. Generate the workflow definition template and deployment. In addition, the workflow designer should understand how SharePoint Designer 2007 controls custom activities but allows the extension of built-in workflows. Each of these topics is discussed in this section. Creating a Workflow To create a new workflow with SharePoint Designer 2007, complete the following steps: 1. Open the SharePoint site where you want to create a workflow using SharePoint Designer 2007. 2. Open the Workflow Designer Wizard by using one of the flowing methods: a. On the File menu, point to New and then select Workflow. b. On the File menu, select New. This will start the New dialog box, shown in Figure 28-2. Click on the Share- Point Content tab, and choose Workflow. Click Blank Workflow to create a new workflow. [...]... available out-of-the-box in SharePoint Server 2007 104 3 Chapter 29 Microsoft Office SharePoint Server 2007 Web Parts Creating and Modifying Web Part Pages 104 5 Arranging Web Parts on a Page 105 1 Connecting Web Parts 105 5 Customizing and Personalizing Web Parts 105 6 Summary of Built-In... Workflow Developer Starter Kit for Windows SharePoint Services 3.0 from http://www .microsoft. com/downloads/details.aspx?familyid=5DDF902D-95B1-4640-B9E4-45440DC388D9&displaylang=en This starter kit 104 1 104 2 Part VI Extending Microsoft Office SharePoint Server 2007 contains Visual Studio project templates for building SharePoint sequential workflow libraries, SharePoint state machine workflow libraries,... create the Web page that is rendered by the client’s browser 104 5 104 6 Part VI Extending Microsoft Office SharePoint Server 2007 Some possible functions of Web Parts on pages and sites are as follows: ■ To consolidate data ■ To display text and images ■ To promote collaboration and communication Note You can use Microsoft Office SharePoint Designer 2007 to create a Web Part page from scratch To understand.. .102 4 Part VI Extending Microsoft Office SharePoint Server 2007 Figure 28-2 SharePoint Content tab in the New dialog box 3 On the Workflow Designer page shown in Figure 28-3, give the workflow a descriptive name and attach the workflow to a list that is available on your SharePoint site A drop-down list shows all lists located on your SharePoint site Figure 28-3 Defining... the these users variable, you can select one or more users in the Select Users dialog box (shown in Figure 28-9) 103 1 103 2 Part VI Extending Microsoft Office SharePoint Server 2007 The following list provides an overview of the six list actions that are available in SharePoint Designer 2007: ■ Update List Item: update item in this list Clicking the this list variable opens the Update List Item dialog... the server after including them within the safe list To do this, complete the following steps: 1 Create the activity or condition in Visual Studio 2005 Designer, compile it as a strong-named assembly, and deploy it to the global assembly cache (GAC) 103 7 103 8 Part VI Extending Microsoft Office SharePoint Server 2007 2 Add the activity or condition to the action safe list in the Web.config file of a SharePoint. .. Workflow Lookup dialog box shown in Figure 28-7 This dialog box gives you the chance to select a list or library from a SharePoint site and look up which values it contains Figure 28-7 Define Workflow Lookup dialog box 102 7 102 8 Part VI ■ Extending Microsoft Office SharePoint Server 2007 Modified In A Specific Date Span: modified between date and date This condition lets you define two date variables... reviewed by a colleague before sending it to the customer 103 5 103 6 Part VI Extending Microsoft Office SharePoint Server 2007 In this section, you will learn how to create a workflow that facilitates this process To keep things simple, you will create a specific document library that contains documents that are relevant to our account managers The SharePoint workflow springs into life as soon as a document... dialog box shown in Figure 28 -10 This dialog box lets you compose a message and makes extensive use of lookup variables to facilitate this process Figure 28 -10 Define E-mail Message dialog box 102 9 103 0 Part VI Extending Microsoft Office SharePoint Server 2007 ■ Set Field In Current Item: set field to value Clicking the field variable results in the display of a drop-down list containing all the columns... “Document Management,” explains which document workflows are available out of the box in SharePoint Designer 2007 You can use SharePoint Designer 2007 to edit the workflow tasks that are shipped with SharePoint Designer 2007 You can find these workflow tasks in the Workflow Tasks folder located in the root of the SharePoint site The following list provides an overview of these workflow tasks: ■ Active.aspx . for Windows Workflow Foundation Office SharePoint Designer 2007 102 2 Part VI Extending Microsoft Office SharePoint Server 2007 If you use SharePoint Designer 2007 to create a workflow, you are. Figure 28-1, SharePoint Designer 2007 shows you all source files that are part of a workflow in the Folder List task pane. 101 6 Part VI Extending Microsoft Office SharePoint Server 2007 Figure. 101 4 Part VI Extending Microsoft Office SharePoint Server 2007 third-party products will start to include this technology. Windows Workflow Foundation is embedded in all the Microsoft Office

Ngày đăng: 14/08/2014, 09:21

TỪ KHÓA LIÊN QUAN