public void SaveAllInstanceMetaData(Guid instanceId, SaveWorkflowCommand command)
{
try
{
String fileName = String.Format("{0}.meta.xml", instanceId);
String fullPath = Path.Combine(_dataDirectory, fileName);
XElement root = new XElement("Instance");
root.Add(new XAttribute("WorkflowInstanceId", instanceId));
XDocument xml = new XDocument(root);
NetDataContractSerializer serializer =
new NetDataContractSerializer();
XElement section = new XElement("InstanceMetadata");
root.Add(section);
foreach(var entry in command.InstanceMetadataChanges)
{
SaveSingleEntry(serializer, section, entry);
}
SaveInstanceDocument(fullPath, xml);
}
catch(Exception exception)
{
Dev2Logger.Log.Error(exception);
throw new InstancePersistenceException(exception.Message, exception);
}
}