This subject has already been described and detailed for a long time, so, the intent of this post is not to add another implementation on the subject, but gives a checklist and shares few issues faced.
This checklist has been done using the following tools:
- MOSS 2007
- Visual Studio 2005
- InfoPath 2007
Setup the Working Environment
1. Open Visual Studio 2005 and create a SharePoint Server Sequential Workflow project.
InfoPath Form
2. Open InfoPath 2007 and create a new Design Form Template.
3. Add controls and fields to the InfoPath form.
4. Check the Compatibility of the form.
5. Change the Security to "Domain".
6. Save the InfoPath file and Publish the form to "DevelopmentFiles/FeatureFiles" folder in the Visual Studio 2005 project that was created in step# 1.
7. Save the InfoPath form as Source File.
Visual Studio Project
8. Execute the xsd.exe tool on the newly created myschema.xsd source file:
Example: xsd.exe myschema.xsd /c
This will generate the class corresponding to the fields used in the InfoPath form.
9. Copy and rename the myschema.cs to the Visual Studio project.
10. Update feature.xml and workflow.xml using Snippets.
11. Code your workflow activities.
Deployment
12. Open the Project Properties, click on Build Events and change "NODEPLOY" to "DEPLOY" in Post-build event command line
13. Sign the assembly and install it to the GAC.
From this point you should be able to access your Workflow from "Site Settings / Galleries / Workflows", and attach it to any List.
If you need to access the Workflow from the SharePoint Designer few more steps are needed.
Setup the Workflow for SharePoint Designer
14. Add an action entry in the WSS.ACTIONS file located in the following path:
C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\1033\Workflow
15. Add an authorizedType entry to the web.config file of the Web Application.
Now, the Workflow action is accessible from the New Workflow menu option.
Issues Faced
- The main issue faced is whenever you have an error in your InfoPath form and you get "The form has been closed" in SharePoint, or whenever you want to update the InfoPath form, the easiest is to delete the InfoPath Template and re-create a new one.
Links:
SharePoint 2007 Workflow with Visual Studio 2005 + InfoPath 2007
Deploying a custom MOSS 2007 workflow