private static void GetTrackingData(XmlNode wfRecord, ref WorkFlowInfo wInfo)
        {
            foreach (XmlNode xmlNode in wfRecord.ChildNodes)
            {
                if (xmlNode.Name == WorkFlowTrackRecord.XMLTagName)
                {
                    BaseTrackRecord wFTrackRecord = new WorkFlowTrackRecord();

                    foreach (XmlAttribute att in xmlNode.Attributes)
                    {
                        ConvertXmlNodeAttribValueToObjProp(att, ref wFTrackRecord);
                    }
                    //trackingData.WorkFlowRecords.Add((WorkFlowTrackRecord)wFTrackRecord);
                    wInfo.TrackingRecords.Add(wFTrackRecord);
                }
                else if (xmlNode.Name == ActivityTrackRecord.XMLTagName)
                {
                    BaseTrackRecord actTrackRecord = new ActivityTrackRecord();

                    foreach (XmlAttribute att in xmlNode.Attributes)
                    {
                        ConvertXmlNodeAttribValueToObjProp(att, ref actTrackRecord);
                    }
                    //trackingData.ActivityRecords.Add((ActivityTrackRecord)actTrackRecord);
                    wInfo.TrackingRecords.Add(actTrackRecord);
                }
            }
        }
        /// <summary>
        /// get workflow info details for a workflow
        /// </summary>
        /// <param name="xmlTrackingFilePath">path from where to load workflow info details</param>
        /// <returns></returns>
        public WorkFlowInfo GetWorkflow(string xmlTrackingFilePath)
        {
            WorkFlowInfo wInfo = null;
            XmlDocument  xDoc  = new XmlDocument();

            using (FileStream fs = File.OpenRead(xmlTrackingFilePath))
            {
                xDoc.Load(fs);
            }


            XmlNodeList wfRecords = xDoc.GetElementsByTagName(WorkFlowInfo.XMLTagName, string.Empty);

            if (wfRecords.Count > 0)
            {
                _xmlTrackingFilePath = xmlTrackingFilePath;
                wInfo          = new WorkFlowInfo(_xmlTrackingFilePath);
                wInfo.WfStatus = (WorkflowStatus)Enum.Parse(typeof(WorkflowStatus), wfRecords[0].Attributes["wfStatus"].Value);
                //wInfo.SetupId = wfRecords[0].Attributes["SetupId"].Value;
                wInfo.InstanceGuid              = Path.GetFileNameWithoutExtension(xmlTrackingFilePath);
                wInfo.WfPersistanceDb           = (wfRecords[0].Attributes["WfPersistanceDb"] != null) ? wfRecords[0].Attributes["WfPersistanceDb"].Value : string.Empty;
                wInfo.TrackingFileLastWriteTime = File.GetLastWriteTime(xmlTrackingFilePath);

                GetTrackingData(wfRecords[0], ref wInfo);
            }

            xDoc = null;

            return(wInfo);
        }