Skip to main content
 
Go Search
Home
Categories
Bloggers
Update to Creating a MOSS State Machine Workflow Part 2: Initiation and Association Form Trap
By: Matt Morse | Posted: September 29, 2007 at 9:30 PM
In my last post on creating a MOSS State Machine, I walked through the process of creating InfoPath forms for use in a MOSS workflow. 
 
In the process of working on the next post -- the one where the InfoPath forms provide information to the workflow code -- I got tripped up by something that I've run into before and managed to forget. So hopefully by writing it down, I'll remember sooner next time I have the problem. :-)
 
Here's the pearl of wisdom: If you are a creating a workflow and specifying different InfoPath forms for the InitiationForm and AssociationForm, your forms must contain the same XML schema.
 
I'd be interested to understand the "why" of this particular design; Microsoft's documentation seems to be mute on the subject. If you try to run a workflow with different initiation and association forms that contain different XML schemas, your association form will display fine but the initiation form will die with an XML schema error. It seems that MOSS provides the association data to the initiation form as XML and if the schemas don't match, an error occurs. (I'm indebted to Gudjon for pointing me in the right direction on this particular issue.)
Using the same schema for both association and init forms "IS NOT NECESSARY".
By: bighamp | Posted: April 17, 2009 at 5:30 PM
Responding to your comment :Here's the pearl of wisdom: If you are a creating a workflow and specifying different InfoPath forms for the InitiationForm and AssociationForm, your forms must contain the same XML schema. " I think I ran into a simular problem. When I checked to see what data was coming into my Workflow.Properties.InitializationData (or something like that. Sorry in a hurry now), I discovered that whenever a workflow was started without prompting the user for initialization data, that the workflow substitued the association data (i.e. XML for the Association data) instead of the XML for the init data. So in those cases the workflow failed when I had the workflow also checking for intialization data using the InitializationData type. Apparently if the user is not prompted for init data when the workflow is started such as when the workflow is automatically started when a new document or list is created, then WF assumes the association data will also be the initialization data and sends the association data into the workflow.properties.InitializationData or whatever the property is called. In a way this makes sense. I also found out that when using ASP.NET Input forms that Postback could be problems when adding data to the form. (sorry again for being in a hurry and not being able to find the documentation of how I resovled this.) I recall that I resolved this issue in one case by causing the form to postback when a control was selected. I know all this is vauge and iffy, but I thought it might give you some clues. I know this with absolute certainty, I DID NOT USE THE SAME SCHEMA FOR ASSOCIATION AND INIT FORMS AND I STEPPED THROUGH THE CODE ALL THE WAY TO SEE WHAT XML WAS RETURNED FOR BOTH ASSOCIATION AND INIT FORMS. I will look for the code and how I handled it successfully in those situations and send it to you if I have time.
How to?
By: R. de Veen | Posted: March 31, 2008 at 6:13 AM
Can you explane, in Wolkthrough style, how to do this? Or update your blogs.
Bingo!
By: dave | Posted: February 1, 2008 at 12:55 AM
HAH! Thank you! I've been ripping my hair out for two days trying to figure it out. That's it!
Where is step 4?
Posted: October 22, 2007 at 3:00 PM
Your articles have been great so far. When can we expect the end of this series?
 

 About Matt Morse

Practice Manager - SharePointMatt Morse is a practice manager for PointBridge. He has over 10 years of experience in application architecture and development, working in a variety of industries, including banking, manufacturing, ... [more]

 Tag Cloud

 My Articles

 ‭(Hidden)‬ Admin Links