Help fixing a corrupted .xoml file, please!

Kilitli Help fixing a corrupted .xoml file, please!

  • 22 Şubat 2012 Çarşamba 12:28
     
     

    I have a SPD 2010 Workflow, with some custom activities.  I added a new activity, but coded it incorrectly so that the activity's parameters in the .actions file didn't match the .dll.  I did get an error message in SPD when I added the new activity, but didn't record it because I realized what was wrong and thought I could just fix it and re-deploy.

    But now, my workflow won't open in SPD.  If I open the .xoml file and removed the lines pertainining to the new activity, it still wont open.  If i try to open it in VS2010, I get an error message that it can't deserialize the activity PRIOR to the one I removed.  Can anyone point me to a good resource on how to fix my .xoml?

    • Taşıyan Tim Lovell-SmithModerator 23 Şubat 2012 Perşembe 12:07 xoml implies wf3 (From:Windows Workflow Foundation 4)
    •  

Tüm Yanıtlar

  • 22 Şubat 2012 Çarşamba 14:16
     
     

    A little more info.

    The original issue is that a parameter was missing from my .actions file (TaskUrl)

    Dependency properties:

           public static DependencyProperty __ContextProperty = System.Workflow.ComponentModel.DependencyProperty.Register("__Context",typeof(WorkflowContext),typeof(BuildNPRFormHTML));

           public static DependencyProperty __ListIdProperty = System.Workflow.ComponentModel.DependencyProperty.Register("__ListId",typeof(string),typeof(BuildNPRFormHTML));

           public static DependencyProperty __ListItemProperty = System.Workflow.ComponentModel.DependencyProperty.Register("__ListItem",typeof(int),typeof(BuildNPRFormHTML));

           public static DependencyProperty __ActivationPropertiesProperty =DependencyProperty.Register("__ActivationProperties",typeof(Microsoft.SharePoint.Workflow.SPWorkflowActivationProperties),typeof(BuildNPRFormHTML));

           public static DependencyProperty TemplateURLProperty =DependencyProperty.Register("TemplateURL",typeof(string),typeof(BuildNPRFormHTML));

           public static DependencyProperty ItemURLProperty =DependencyProperty.Register("ItemURL",typeof(string),typeof(BuildNPRFormHTML));

           public static DependencyProperty TaskURLProperty =DependencyProperty.Register("TaskURL",typeof(string),typeof(BuildNPRFormHTML));

           public static DependencyProperty FormattedTextProperty =DependencyProperty.Register("FormattedText",typeof(string),typeof(BuildNPRFormHTML));

    and the parameters in the Actions file:

          <Parameters>

            <ParameterName="__Context"Type="Microsoft.SharePoint.WorkflowActions.WorkflowContext"Direction="In" />

            <ParameterName="__ListId"Type="System.String, mscorlib"Direction="In" />

            <ParameterName="__ListItem"Type="System.Int32, mscorlib"Direction="In" />

            <ParameterName="__ActivationProperties"Type="Microsoft.SharePoint.Workflow.SPWorkflowActivationProperties, Microsoft.SharePoint"Direction="Out" />

            <ParameterName="TemplateURL"Type="System.String, mscorlib"Direction="In" />

            <ParameterName="ItemURL"Type="System.String, mscorlib"Direction="In" />

            <ParameterName="FormattedText"Type="System.String, mscorlib"Direction="Out" />

          </Parameters>

     

    I deployed a corrected .dll (no TaskURL) but have since reverted to the one I was using when I added the bad action.  I also tried fixing the .actions file, but still no luck. 

    I get a "SharePoint Designer cannot display the item" error if I try to edit the workflow via SPD, and a "Could not deserialize object.  The type xxxxxx could not be resolved" when I try to open it in VS2010.  The type which cannot be resolved is the action immediately PRECEEDING the bad action.  If I remove the bad action from the .xoml file, then I get an error on the action which preceded the preceeding action. 

    Any thoughts?

     

     

  • 22 Şubat 2012 Çarşamba 14:26
     
     
    Oh, and if I open it as XML, it will validate OK (msg says "appears to be well nested and well formed).  So it must be the interaction of the .xoml, the .dll and the .actions file, right?  Just not sure how to fix.
  • 22 Şubat 2012 Çarşamba 16:29
     
     Yanıt

    Finally got this to open in SPD.  I think that at times over the past 24 hours, I have had the .dll, .actions file and .xoml in sync, but still couldn't open the workflow due to caching issues.  I ended up removing an entire block of code around the offending action, and made sure to reset the website and clear my website cache before opening SPD. 

    I am relieved; this is a 4000 line .xoml file and I really was horrified at the prospect of re-keying it in!

    • Yanıt Olarak İşaretleyen Sherri Johns 22 Şubat 2012 Çarşamba 16:29
    •