コード例 #1
0
        private void Add(string name, AttributeMetadata value)
        {
            Dictionary.Add(name.ToLowerInvariant(), value);

            AttributeNames.Add(name);
            Values.Add(value);
        }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
ファイル: RuleReferenceExtractor.cs プロジェクト: eyedia/idpe
        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(&quot;", "&quot;");

            //if (attributeName.Contains("BookingCustomerId"))
            //    Debugger.Break();

            if (!string.IsNullOrEmpty(attributeName))
            {
                AttributeNames.Add(attributeName);
            }

            string systemAttributeName = Extract(line, "Data.CurrentRow.ColumnsSystem(&quot;", "&quot;");

            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(&quot;", "&quot;");
            if (!string.IsNullOrEmpty(processVariableName))
            {
                ProcessVariablesIncorrectWay.Add(processVariableName);
            }

            processVariableName = Extract(line, "Job.GetProcessVariableValue(\"", "\"");
            if (!string.IsNullOrEmpty(processVariableName))
            {
                ProcessVariables.Add(processVariableName);
            }

            processVariableName = Extract(line, "Job.GetProcessVariableValue(&quot;", "&quot;");
            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);
                    }
                }
            }
        }