public void Parse() { ParseKey(); //ParseKey(new Manager().GetKey(DataSourceId, SreKeyTypes.CSharpCodeOutputWriter.ToString())); AttributeNames = AttributeNames.DistinctEx(); SystemAttributeNames = SystemAttributeNames.DistinctEx(); ProcessVariablesIncorrectWay = ProcessVariablesIncorrectWay.DistinctEx(); ProcessVariables = ProcessVariables.DistinctEx(); }
public void Parse() { using (StringReader reader = new StringReader(RuleAsXaml)) { string line = string.Empty; do { line = reader.ReadLine(); if (line != null) { Collect(line); } } while (line != null); } AttributeNames = AttributeNames.DistinctEx(); SystemAttributeNames = SystemAttributeNames.DistinctEx(); ProcessVariablesIncorrectWay = ProcessVariablesIncorrectWay.DistinctEx(); ProcessVariables = ProcessVariables.DistinctEx(); }
private void Collect(string line) { string attributeName = Extract(line, "Data.CurrentRow.Columns("", """); if (!string.IsNullOrEmpty(attributeName)) { AttributeNames.Add(attributeName); } string systemAttributeName = Extract(line, "Data.CurrentRow.ColumnsSystem("", """); if (!string.IsNullOrEmpty(systemAttributeName)) { SystemAttributeNames.Add(systemAttributeName); } string processVariableName = Extract(line, "Job.ProcessVariables(\"", "\""); if (!string.IsNullOrEmpty(processVariableName)) { ProcessVariablesIncorrectWay.Add(processVariableName); } processVariableName = Extract(line, "Job.ProcessVariables("", """); if (!string.IsNullOrEmpty(processVariableName)) { ProcessVariablesIncorrectWay.Add(processVariableName); } processVariableName = Extract(line, "Job.GetProcessVariableValue(\"", "\""); if (!string.IsNullOrEmpty(processVariableName)) { ProcessVariables.Add(processVariableName); } processVariableName = Extract(line, "Job.GetProcessVariableValue("", """); if (!string.IsNullOrEmpty(processVariableName)) { ProcessVariables.Add(processVariableName); } }
private void Collect(string line) { List <string> activityNames = new List <string>(new string[] { "AddError", "AddOrUpdateProcessVariable", "AssignAttribute", "WriteTraceToCurrentRow", "PreValidationFailed", "DuplicateCheck", "RestApiCall", "Lookup", "PersistVariable", "GetPersistVariable", "DeletePersistVariable", "ExecuteNonQuery" }); string startedWith = "<{0}:{1}"; string whatTypeOfActivity = string.Empty; foreach (string activityName in activityNames) { if (line.Trim().StartsWith(string.Format(startedWith, prefix, activityName))) { whatTypeOfActivity = activityName; break; } } //if (line.Trim().StartsWith(" <srs:AssignAttribute")) // Debugger.Break(); string attributeName = Extract(line, "Data.CurrentRow.Columns("", """); //if (attributeName.Contains("BookingCustomerId")) // Debugger.Break(); if (!string.IsNullOrEmpty(attributeName)) { AttributeNames.Add(attributeName); } string systemAttributeName = Extract(line, "Data.CurrentRow.ColumnsSystem("", """); if (!string.IsNullOrEmpty(systemAttributeName)) { SystemAttributeNames.Add(systemAttributeName); } string processVariableName = Extract(line, "Job.ProcessVariables(\"", "\""); if (!string.IsNullOrEmpty(processVariableName)) { ProcessVariablesIncorrectWay.Add(processVariableName); } processVariableName = Extract(line, "Job.ProcessVariables("", """); if (!string.IsNullOrEmpty(processVariableName)) { ProcessVariablesIncorrectWay.Add(processVariableName); } processVariableName = Extract(line, "Job.GetProcessVariableValue(\"", "\""); if (!string.IsNullOrEmpty(processVariableName)) { ProcessVariables.Add(processVariableName); } processVariableName = Extract(line, "Job.GetProcessVariableValue("", """); if (!string.IsNullOrEmpty(processVariableName)) { ProcessVariables.Add(processVariableName); } if (whatTypeOfActivity == "Lookup") { string columName = Extract(line, "ColumnName=\"", "\""); string isSytemColumn = Extract(line, "IsSystemColumn=\"", "\""); if (!string.IsNullOrEmpty(columName)) { if (isSytemColumn.ToLower() == "true") { SystemAttributeNames.Add(columName); } else { AttributeNames.Add(columName); } } } }