An Avanade Blogging Community

Welcome to An Avanade Blogging Community Sign in | Join | Help
in Search

Johan's Avanade Blog

SharePoint 2007 Workflow with InfoPath

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

Published Friday, March 21, 2008 9:39 AM by johanr

Comments

 

johanr said:

A little update here!
In the Issues Faced part, I indicated that I had troubles to republish the InfoPath form.  My bad!  I hadn't properly setup the .bat file, so the feature was not deactivated and re-activated... ;)
So now, it works great!
March 28, 2008 11:33 AM
Anonymous comments are disabled

This Blog

Post Calendar

<March 2008>
SuMoTuWeThFrSa
2425262728291
2345678
9101112131415
16171819202122
23242526272829
303112345

Syndication