Thursday, October 11, 2012

Content Approval Workflow Using Reusable Workflows

A)Reusable Workflow associated with Content Type In SharePoint Designer
1)Create the Site columns(similar columns that are created after content approval is enabled on Library) and add those  Site Columns to Content type Inherited from Document Content Type

2)In Document Library , Enable the Custom Document Content type as created in above step
and delete the existing document Content Type

3)Enable the Content Approval on this Document Library
Library Settings -->Versioning-->Select allow content approval option

4)In SharePoint Designer ,In Workflows tab,create new Reusable workflow(this is only the deployable workflow , so avoid creating list workflows , If unknowingly you have created List workflow see this trick, another trick)
Associate this Workflow to Content Type (created in step1)
One more..

5)Add this workflow to  Content Type Created in Step A 1
Edit the Custom Document Content Type, in workflow Settings  , Add the workflow instance using reusable workflow template as created above.

6)Save this Reusable workflow as Template in SPD  and download the required wsp from Site assets Library

B)Deploy reusable workflow to Production site
1)Save the site as Template (Test site where content type is created and associated with workflow )and Import into Visual Studio(select site columns ,Custom Document Content type  and Document Instance while importing.
Deploy this solution on production site (or create feature dependency).

2)Upload the wsp created in step A 5 and activate the Workflow  feature .
Or (Import  as Workflow in visual studio and create dependent feature on step B 1)

3)By default Document Workflow will not be associated with Custom Content Type.
When you import Reusable workflow ,Add the feature receiver which will  associate
Custom Document Content Type with this Workflow
Download the Source
In this source ,Association and Initiations forms are removed .you can add those if required.

C)Difference in Content Approval and Approval Workflow

Note -->For association of Content Type and importing wsp to Visual Studio, you can read this post

No comments: