private Exception ProcessLoadWorkflowByInstanceKey(
InstancePersistenceContext context,
LoadWorkflowByInstanceKeyCommand command)
{
try
{
Guid instanceId = _dataStore.GetInstanceAssociation(
command.LookupInstanceKey);
if(instanceId == Guid.Empty)
{
throw new InstanceKeyNotReadyException(
String.Format("Unable to load instance for key: {0}",
command.LookupInstanceKey));
}
SharedLoadWorkflow(context, instanceId);
return null;
}
catch(InstancePersistenceException exception)
{
Console.WriteLine(
// ReSharper disable LocalizableElement
"ProcessLoadWorkflowByInstanceKey exception: {0}",
// ReSharper restore LocalizableElement
exception.Message);
return exception;
}
}