Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>In the end I decompiled System.Activities.DurableInstancing. The only setter for WorkflowHostType on SqlWorkflowInstanceStore was in ExtractWorkflowHostType:</p> <pre><code>private void ExtractWorkflowHostType(IDictionary&lt;XName, InstanceValue&gt; commandMetadata) { InstanceValue instanceValue; if (commandMetadata.TryGetValue(WorkflowNamespace.WorkflowHostType, out instanceValue)) { XName xName = instanceValue.Value as XName; if (xName == null) { throw FxTrace.Exception.AsError(new InstancePersistenceCommandException(SR.InvalidMetadataValue(WorkflowNamespace.WorkflowHostType, typeof(XName).Name))); } byte[] bytes = Encoding.Unicode.GetBytes(xName.ToString()); base.Store.WorkflowHostType = new Guid(HashHelper.ComputeHash(bytes)); this.fireRunnableInstancesEvent = true; } } </code></pre> <p>I couldn't clearly disentangle the calling code path, so I had to find out at runtime by attaching WinDbg/SOS to IIS and breaking on HashHelper.ComputeHash. </p> <p>I was able to retreive the XName that goes into the hash calculation, which has a localname equal to the servicefile, and a namespace equal to the [sitename]/[path]/.</p> <p>In the end the WorkflowHostType calculation comes down to:</p> <pre><code>var xName = XName.Get("Flow.xamlx.svc", "/examplesite/WorkflowService/1/"); var bytes = Encoding.Unicode.GetBytes(xName.ToString()); var WorkflowHostType = new Guid(HashHelper.ComputeHash(bytes)); </code></pre> <p>Bottomline: apparently workflows can only be rehydrated when the service filename, sitename and path are all identical (case sensitive) as when they were started</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload