Step by Step Tutorial. Creating Workflows for Windows Sharepoint Services and MOSS2007 (part 13/20). Fixing and running the ASPXCollectFeedback sample (sdk)
By Serge Luca
I’ve received tons of emails related to workflows & aspx forms.
Indeed, I’ve faced many situations where Infopath forms in Sharepoint workflows are not flexible enough or not stable enough; therefore we need the full power and stability of the Asp.net framework (and moreover, some applications need to be based on the free WSS without Infopath Form server).
For instance, many people want to see the history list in the task edit form, they want to use Silverlight in the workflow forms,… ; I’ve recently worked on a project where the association form must automatically associate several informations to each CreateTask activity, the form uses reflection to retrieve each CreateTask activity… I’ll show you some other examples in the next posts.
The first natural step for a Sharepoint developer is to check the WSS/MOSS sdk to find a good sample. There is a pretty good one , the ASPXCollectFeedback, which unfortunately doesn’t work as expected unless we fix it; that’s what I’m going to do in this post : fixing this sample. I’m very surprised that no one in the Google/LiveSearch universe has complained about this sample (this sample was provided since 2006…). Let’s fix this for the Sharepoint community.
Open the solution
Install the downloadable WSS sdk 1.4, backup the projects located in c:\Program Files\2007 Office System developer Resources\ASPXCollectFeedback\ and open the CollectfeedbackWorkflow.sln solution.(fig 1).
[Fig 1.ASPXCollectFeedback Project location in the WSS 1.4 sdk ]
The problems and the solutions
Problem 1. One project (TaskWorkflowContentType) is not compiled by default.
Solution: very easy, right click on the solution property page, select Configuration Properties-Configuration and check the Build option of the TaskWorkflowContentType project (fig 2).
[Fig2.Build options ]
Rebuild the solution.
Problem 2. Gacutil in install.bat
- The sdk sample is based on VS2005 where gacutil was in a different location.
- Edit the InstallAll.bat file to take the gacutil.exe location into account ("%programfiles%\Microsoft SDKs\Windows\v6.0A\Bin\gacutil.exe").
- Update installAll.bat with your site collection url to the stsadm instructions.
- Now, run the InstallAll.bat. Normally the workflow and its associated features haven been installed and activated.
- You can associate the workflow with a list and start the workflow on a list item.
Problem 3.The custom task form doesn’t show up in display mode
- Indeed when you click on the workflow task, only the standard task list shows up instead TaskWCT.aspx (the custom form) (fig 3).
[Fig 3.The standard task form shows up instead of the custom form]
- The reason for this is the Content type manifest file provides only a custom edit behavior , but no custom display behavior.The standard one is used instead.
- Indeed, if you click on the Edit Item menu, the custom aspx form will show up (fig 4):
[Fig 4.Custom task form]
- To fix this, edit the manifest file TaskWorkflowContentType.xml in the TaskWorkflowContentType project and add a display option (fig 5) :
[Fig 5.Adding a custom Display behavior]
- Make sure your new content type definition will replace the previous one by deactivating/uninstalling the existing content type and verify that the old content type is removed it by looking at the content type site gallery.
Problem 4. “Require Manage Lists permission to start the worklow” option is not used :
The association page doesn’t take the “Require manage Lists permissions to start the workflow” option into account (Fig 6).
[Fig 6. This Permission is not used correctly in the sample]
To fix this, you need to add an additional hidden field in the WFAssoc.aspx page (Fig 7);
<input type="hidden" name="ManualPermManageListRequired" value='<% SPHttpUtility.NoEncode(SPHttpUtility.HtmlEncode(Request.Form["ManualPermManageListRequired"]),Response.Output); %>’>
(More details about this in my next tutorial)
[Fig 7. Missing hidden field]
- Run InstallAll.bat and re-associate and test your workflow.
- In the next post I will describe the project.
Problem 5. The List Content Type case is not handled
Indeed there are 3 kinds of workflow associations:
- Workflow association to a list
- Workflow association to a content type
- Workflow association to a content type in a specific list (this one is missing in the sample)
In the SPWorkfowAssociation class provides the following methods:
public static SPWorkflowAssociation CreateListAssociation (
public static SPWorkflowAssociation CreateSiteContentTypeAssociation (
public static SPWorkflowAssociation CreateListContentTypeAssociation (
Anyway, I will fix this problem in a next post.
This hands-on training is the property of Redwood S.L sprl and may not be organized in class or in group without the prior written permission of Serge Luca. Should you wish to organize this hands-on training in your company or institution, please contact Serge Luca first to enter into a licence agreement. Each trainer or teacher using this hands-on training should have a licence agreement. Please ask your trainer or Serge Luca whether he or she has entered into a licence agreement with Redwood S.L sprl.
The hyperlink to this hands-on training may be placed on your website for free, on the condition that the name Serge Luca is clearly mentioned in the reference. Please send us a mail containing the link to the web page our reference is used on.