SPD workflow reuse solution in Moss

Source: Internet
Author: User

As we all know, workflows designed with SharePoint designer in Moss cannot be easily reused. The reason is that after a workflow is designed, the Workflow Document Library ID, Workflow Document Library ID, and workflow history list are attached) the ID has been hardcoded into the corresponding file. If a task activity is involved in a workflow, the task list ID and the corresponding workflow task content type ID are also recorded in the corresponding file. Therefore, workflows cannot be reused directly. If you really want to reuse the designed workflow, I think the following steps are a feasible solution.

1. design the workflow and confirm that the current workflow is working properly (there is usually an existing workflow to be deployed on another site, and no such solution is available ).

2. If the current workflow involves the task list and the content type is created in the task list, collect data from user activity is usually used. We need to package these generated content types into a site range feature. We recommend that you use ctexplorer. This tool seems to be only able to export a single content type, but it doesn't matter. We can copy and paste Multiple content types into the same feature. This feature needs to be activated and applied to the site first, because the latter feature needs to use these content types.

3. use the SharePoint solution generator that comes with vsewss to export the current site. The purpose is that we can easily obtain the relevant workflow files and put these workflows (at least one) into the second feature, its directory structure:

Now, you need to add two files in each workflow folder, one of which is exportedlistinformation. XML records the title, ID, and description of the document library and auxiliary list used by the current workflow. Title (of course, the document library and the secondary list used in the two sites should be the same, title and column information) and ID are particularly important. BecauseCodeYou need to use the title to find the document library and list of the new site, and then replace the relevant ID. Format:

Another file is workflowtasklistcontenttypes. XML, which records the task content type ID used in the current workflow. Note that the Name node content is not very important, mainly to improve readability. If no new task content type is generated, we can leave it blank, but we need to put a file in it. The format is as follows:

4. use feature handler in the feature of the attached workflow file. Note, we need to generate the document library and auxiliary list affiliated to the current workflow in the current worker Er (we recommend that you generate the document library and list on the new site by using code ). In addition, the worker is responsible for adding the workflow file to the new site, adding the task content type to the task list, and obtaining the ID of the new document library and list, and the new content type ID in the task list, which is replaced by two configured XML files.

5. there are two feature types mentioned above. The first is the content type used to create the site level, and the second is the site level. It is used to add workflow files and replace IDs, and bind the workflow to the target document library. Therefore, the first feature needs to be activated first. We can use activationdependency to set the associated feature of the second feature to the ID of the first feature.

6. after all the feature values are activated, we still need to do some manual processing. Some workflow variables, such as the string type, may include URL hard encoding and the variables of the personnel type may be in different fields, you still need to modify it with SharePoint designer. Finally, perform a test.

The content type export tool ctexplorer and sample code are downloaded from here, hoping to help you.

 

Tip: You can use designer in SharePoint 2010 to design reusable workflows. Here is a video that uses SharePoint designer 2010 to design reusable workflows.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.