Showing posts with label MOSS 2007 Workflow. Show all posts
Showing posts with label MOSS 2007 Workflow. Show all posts

Friday, 28 August 2009

InfoPath 2007 - Design Checker Error "Binding a non-repeating control to a repeating field or group is not supported by InfoPath Forms Services."

For read-only purposes, I had expression boxes in my InfoPath 2007 form (browser-enabled) that referred to (via XPath) repeating items within the form - but using an XPath sum(). Even though sum always returns a single value, InfoPath (erroneously) detects the use of the repeating table (i.e. I am trying to sum the total purchase order items). It then shows the following error in the Design Checker:

Binding a non-repeating control to a repeating field or group is not supported by InfoPath Forms Services. To fix this problem, remove the control or replace it with a repeating control, such as repeating section or table."


I automatically assumed that this would be the same as other "errors" and would prevent the publication and activation of this form. This is not the case. In fact, the Design Checker should really should show as a warning, as you can safely ignore the "error" and publish anyway.




Sunday, 14 June 2009

InvalidOperationException "The event receiver context for Workflow is invalid" Problems with onTaskChanged in a SharePoint Workflow

As also mentioned here:

http://thorprojects.com/blog/archive/2006/11/30/invalidoperationexception-quote-the-event-receiver-context-for-workflow-is-invalid-quote-problems-with-ontaskchanged-in-a-sharepoint-workflow.aspx

If your OnTaskChanged activity is failing and your SharePoint ULS logs are showing something like the following:

06/14/2009 16:50:22.30 w3wp.exe (0x1548) 0x0208 Windows SharePoint Services Workflow Infrastructure 72ev Medium Value cannot be null. 06/14/2009 16:50:24.12 w3wp.exe (0x1548) 0x0208 Windows SharePoint Services Workflow Infrastructure 72ev Medium Value cannot be null. 06/14/2009 16:50:24.40 w3wp.exe (0x1548) 0x0208 Windows SharePoint Services Workflow Infrastructure 72er Medium System.InvalidOperationException: The event receiver context for Workflow is invalid. at Microsoft.SharePoint.SPEventReceiverDefinition.ValidContext() at Microsoft.SharePoint.SPEventReceiverDefinition.ValidReceiverFields() at Microsoft.SharePoint.SPEventReceiverDefinition.GetSqlCommandToAddEventReceivers(IList`1 erds) at Microsoft.SharePoint.Workflow.SPWinOESubscriptionService.CommitNewSubscriptions(Transaction txn, IList`1 erds) 06/14/2009 16:50:24.41 w3wp.exe (0x1548) 0x0208 Windows SharePoint Services Workflow Infrastructure 72fe High Error in commiting pending workflow batch items: System.InvalidOperationException: The event receiver context for Workflow is invalid. at Microsoft.SharePoint.SPEventReceiverDefinition.ValidContext() at Microsoft.SharePoint.SPEventReceiverDefinition.ValidReceiverFields() at Microsoft.SharePoint.SPEventReceiverDefinition.GetSqlCommandToAddEventReceivers(IList`1 erds) at Microsoft.SharePoint.Workflow.SPWinOESubscriptionService.CommitNewSubscriptions(Transaction txn, IList`1 erds) at Microsoft.SharePoint.Workflow.SPPendingWorkBatch.ProcessWorkItemBatch(Transaction transaction, Work method, IList`1 workItemBatch) at Microsoft.SharePoint.Workflow.SPPendingWorkBatch.Commit(Transaction transaction, ICollection items) 06/14/2009 16:50:24.47 w3wp.exe (0x1548) 0x0208 Windows SharePoint Services Workflow Infrastructure 88xr Unexpected WinWF Internal Error, terminating workflow Id# 82d5bb47-18c9-4fa1-a730-121984a7b435

Then you have probably done the following:

  1. Not assigned a Task Id variable to your OnTaskChanged Handler
  2. Assigned the wrong Task Id variable to the OnTaskChanged Handler.
  3. A combination of 1 and 2

I had mistakenly bound my OnTask changed handler in a Parallel workflow to a new variable rather than the existing TaskId variable I set during the Create Task Handler (so the Task Ids didn't match, hence the exception).

Thursday, 4 June 2009

Fix - "There is an error in XML document (1, 2)" when deserializing an InfoPath 2007 in a SharePoint Workflow



If you are getting the following errors when attempting to deserialize an InfoPath Form for use in a workflow:
  1. "There is an error in XML document (1, 2)" And the the Inner Exception is
  2. <myFields xmlns='http://schemas.microsoft.com/office/infopath/2003/myXSD/2008-01-16T10:47:10'> was not expected.

Then I suggest that you first check the following:


  1. The root element name of your InfoPath form (by default called "myfields") MUST match the class name of your xsd.exe-generated mapping file.

Otherwise the XmlSerializer will be looking for a root "myfields" (the default name) element in your C# class and it won't be able to map it to the equivalent element in your InfoPath Xml.

In other words, the xsd.exe generated wrapper class name must match the root element name of your InfoPath form.

For reference, I had this issue and it was simply because I renamed the class name of my xsd.exe-generated file (but I didn't rename my root Infopath element) and so the Serializer couldn't map the new class name to the old root element name in my InfoPath form.



Wednesday, 3 June 2009

Fix for Error when deploying workflow to SharePoint 2007 - "Failed to install the workflow template to Microsoft Office SharePoint Server."

Today every time I attempted to debug my SharePoint workflow solution using Visual Studio 2008, I would receive the following error:

Failed to install the workflow template to Microsoft Office SharePoint Server.
Value cannot be null.
Parameter name: uriString


I could actually right click and run a deploy on the solution manually but I could not run in debug. It appears that the problem was caused by my install of WSPBuilder (http://wspbuilder.codeplex.com/) as when I disabled it from startup and resaved my SharePoint workflow project in Visual Studio, the debugger started working. A simple restart of VS 2008 did not fix the issue.

Wednesday, 15 April 2009

Warning: Declarative workflows created in SharePoint Designer 2007 will silently fail with MOSS SP1

If you have installed SP1 of WSS 3.0 or MOSS 2007, declarative workflows will not start if you log in as the system account. The fix is here:
http://kbalertz.com/947284/declarative-workflow-start-automatically-after-install-Windows-SharePoint-Services-Service.aspx

I would at least hope for an entry in the Event Log or SharePoint Hive log files rather than a silent failure in this case!

Saturday, 14 March 2009

Windows Workflow Replicator Tasks & The SharePoint 2007 SDK (version 1.4 - August 2008) still doesn't install the ECM Activities into the GAC for you

I'm currently working on an application that creates multiple SharePoint tasks (based on a contact list) as part of a SharePoint workflow. Once all the tasks are completed, the workflow can continue. I recalled that I went through the Contact Replicator sample in the SharePoint 2007 SDK around a year ago and knew that would help me in my endeavours.

However, None of the SDK sample projects compile off the bat. I remember having this issue about a year ago. Again today, I just installed the latest MOSS 2007 SDK (updated August 2008) to find the missing ECM dll issue (or annoyance) is still there. The problems is that none of the sample projects in the SDK will compile until you've:
  1. Built the solution (and allowed Visual Studio 2008 to convert it automatically from 2005 format if neccessary)
  2. Installed the compiled the ECM Acitivty Library Dll and copied it into the gac (copying it into "C:\Windows\assembly" via Windows Explorer or using

    gacutil /i "C:\Program Files\2007 Office System Developer Resources\Samples\Workflow\ECMActivities\bin\Debug\Microsoft.Office.Samples.ECM.Activities.dll"

  3. Close and Reopen any sample projects you had open in Visual Studio.
Seeing as the SDK has a full blown installer, I had hoped the good folks in the the MOSS team would have fixed this problem - but I will have to continue living in hope.

Monday, 6 August 2007

MOSS 2007 Sharepoint Workflow Client Development

Amazingly, the oft recommended development setup for MOSS Workflows is to have Visual Studio 2005 installed on the development server. You actually NEED it on the MOSS server to have debugging work properly!

To develop on a box separate from your Sharepoint Box (using the Windows Workflow Extensions and Visual Studio 2005), you also need to copy the many dlls from the GAC to your development machine GAC.
http://www.paylasimnoktasi.com/en/programmingMOSSonclientmachines.aspx

Alternatively, you could just have a development image with Windows 2003 on it with your full install of VS 2005 and MOSS 2007

David Klein http://www.ssw.com.au/