/// <summary> /// /// </summary> /// <param name="ruleSet"></param> /// <param name="outputFolder"></param> /// <returns></returns> public string ExportRuleSetToFile(RuleArtifact ruleSet, string outputFolder) { TraceManager.SmartTrace.TraceIn(); string fileName = null; try { RuleSetDeploymentDriver rsdd = new RuleSetDeploymentDriver(this.server, this.database); RuleStore store = rsdd.GetRuleStore(); RuleSetInfo rsi = new RuleSetInfo(ruleSet.Name, ruleSet.MajorVersion, ruleSet.MinorVersion); VocabularyInfoCollection referencedVocabs = store.GetReferencedVocabularies(rsi); RuleSet rs = store.GetRuleSet(rsi); fileName = Path.Combine(outputFolder, ruleSet.XmlFileName); rsdd.ExportRuleSetToFileRuleStore(rsi, fileName); fileName = Path.Combine(outputFolder, ruleSet.HtmlFileName); StreamWriter sw = new StreamWriter(fileName); RuleSetWriter writer = new RuleSetWriter(sw); writer.VocabularyDefinitions = vdefs; writer.WriteRuleSet(rs, referencedVocabs, sw); sw.Flush(); sw.Close(); } catch (Exception ex) { TraceManager.SmartTrace.TraceError(ex); TraceManager.SmartTrace.TraceError("FileName will be set to NULL"); } TraceManager.SmartTrace.TraceOut(); return(fileName); }