Thursday, January 3, 2008

Workflow InfoPath forms stuck on "Installing" issue fix

I receantly worked through a workflow that implented InfoPath forms. InfoPath forms are really handy because of the designer capabilites. You can drag and drop controls and no code is really required. The hosting SharePoint aspx page runs all the code and so you don't have to have the InforPath form doing any of the required code.
I was done with my workflow and I deployed my solution to the target site collection. When I tried to bind the workflow to a document library I would get an error. The error was saying that the infoPath form was not workflow enabled. I also changed my web.config file to spit out a stack trace and this is what I got.

Value cannot be null.
Parameter name: g at System.Guid..ctor(String g)
at Microsoft.Office.Workflow.WrkAssocPage.AssociationOnLoad(EventArgs ea)
at Microsoft.Office.Workflow.CstWrkflIPPage.OnLoad(EventArgs ea)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,Boolean

includeStagesAfterAsyncPoint)


I soon figured out that either something was wrong with my WrkAssocPage.aspx or the hosting aspx pages or there was really no info path form sent to those hosting pages.

So, I checked SharePoing Central Admin to see the status of my InfoPath templates. Go to "SharePoint Central Admin >>Application Management>>" at the bottom of the page you will see Info path form Templates link. Check the status of your IP templates. Mine were stuck on status, "Installing" and they were marked as "NOT" workflow enabled.

If this is happening to you. This is what fixed it for me. Recall the steps you took to save the IP template.
1) you should have set the security setting to "domain".
2) you should have changed the controls ot only be web enabled. (controls that are not web enabled, ie. rich texbox field, will cause this problem)

3) and the MOST IMPORTANT, when you publish your IP you should save it to your Visual Studio project folder of your workflow. After you choose the location the publish wizard will ask you to enter an "access path". DO NOT FILL IT OUT! leave it blank, it will then give you a half error, just click 'OK', and finish with the wizard.

if you fill out an 'access path', well, the IP form will remain in that 'installing' state, and it will not be usable.

IF you have already deployed your solution and you are experiencing this problem there are a couple of things you have to do first.

1) deactivate the feature from the site collection
a) go to your site
b) go to 'Site Actions'
c) go to the 'Administration section' under 'Site Collection Features
d) find the feature(ie, your workflow feature) and deactivate it.
2) unistall the feature using stsadm.exe
a) stsadm.exe -o unistallfeature -filename


3)Delete the IP templates you published to the project folder
I just tired to republish the templates and it would not allow me to. Because it did not
ovewrite the old ones.
4) Publish the templates again to the project folder.


hope this saves you a lot of grief. The one thing I can suggest is to change the web config file of your site collection to spit out the stacktrace for better error reporting. I found a how to here:

http://www.sharepointblogs.com/michael/archive/2007/06/28/sharepoint-under-the-hood-see-real-error-description-and-callstack-stack-trace.aspx



Good luck

Juan

No comments: