diff --git a/force-app/main/default/classes/Soql/SoqlUtility.cls b/force-app/main/default/classes/Soql/SoqlUtility.cls new file mode 100644 index 0000000..78ec77a --- /dev/null +++ b/force-app/main/default/classes/Soql/SoqlUtility.cls @@ -0,0 +1,51 @@ +public class SoqlUtility { + + //11:43:50.1 (6696702)|SOQL_EXECUTE_BEGIN|[3]|Aggregations:0|SELECT Id FROM Opportunity + public static void processSoqlbegin(String line) { + List splitArr = line.split('\\|'); + if (splitArr.size() == 5) { + LogLineSchema lls = new LogLineSchema(); + lls.type = 'SOQLB'; + lls.varName = splitArr[3]; + lls.varValue = splitArr[4]; + lls.lineNumber = splitArr[2]; + addToUnit(lls); + } + } + //11:43:50.1 (14725333)|SOQL_EXECUTE_END|[3]|Rows:7 + public static void processSoqlExit(String line) { + List splitArr = line.split('\\|'); + if (splitArr.size() == 4) { + LogLineSchema lls = new LogLineSchema(); + lls.type = 'SOQLE'; + lls.varName = 'Retrieved'; + lls.varValue = splitArr[3]; + lls.lineNumber = splitArr[2]; + addToUnit(lls); + } + } + private static void addToUnit(LogLineSchema lls) { + /* + * 1. Check the correct codeunit/MethodUnit and add the logLine to the codeunit/MethodUnit + */ + if (!utilityVariables.methodUnitsStack.isEmpty()) { + MethodSchema currentMethodUnit = (MethodSchema) utilityVariables.methodUnitsStack.peek(); + //create a new ExecutingLineAndSubUnitSchema and push it to the current MethodUnit + ExecutedLineAndSubUnitSchema elss = new ExecutedLineAndSubUnitSchema(); + elss.logLine = lls; + //Add elsss to currentMenthodUnit + currentMethodUnit.executedLinesAndSubUnits.add(elss); + //update currentLog + utilityVariables.currentLog = lls; + } else if (!utilityVariables.codeUnitsStack.isEmpty()) { + CodeUnitContainerSchema currentCodeUnit = (CodeUnitContainerSchema) utilityVariables.codeUnitsStack.peek(); + //create a new ExecutingLineAndSubUnitSchema and push it to the current codeUnit + ExecutedLineAndSubUnitSchema elss = new ExecutedLineAndSubUnitSchema(); + elss.logLine = lls; + //Add the elss to the currentCodeUnit + currentCodeUnit.executedLinesAndSubUnits.add(elss); + //update currentLog + utilityVariables.currentLog = lls; + } + } +} diff --git a/force-app/main/default/classes/Soql/SoqlUtility.cls-meta.xml b/force-app/main/default/classes/Soql/SoqlUtility.cls-meta.xml new file mode 100644 index 0000000..998805a --- /dev/null +++ b/force-app/main/default/classes/Soql/SoqlUtility.cls-meta.xml @@ -0,0 +1,5 @@ + + + 62.0 + Active + diff --git a/force-app/main/default/classes/UtilityMethods.cls b/force-app/main/default/classes/UtilityMethods.cls index 6a40691..95c2554 100644 --- a/force-app/main/default/classes/UtilityMethods.cls +++ b/force-app/main/default/classes/UtilityMethods.cls @@ -244,6 +244,19 @@ public class UtilityMethods { */ UserInfoUtility.processUserInfo(line); break; + }else if (utilityVariables.currentLineEvent == 'SOQL_EXECUTE_BEGIN') { + /* + * 1. Use same methods as METHOD_ENTRY + * 2. Process all details and call METHOD_ENTRY methods + */ + SoqlUtility.processSoqlbegin(line); + break; + }else if (utilityVariables.currentLineEvent == 'SOQL_EXECUTE_END') { + /* + * 1. Use same methods as METHOD_EXIT + */ + SoqlUtility.processSoqlExit(line); + break; } } } diff --git a/force-app/main/default/classes/VariableAssignment/VariableAssignUtility.cls b/force-app/main/default/classes/VariableAssignment/VariableAssignUtility.cls index 2a08046..f0cfa86 100644 --- a/force-app/main/default/classes/VariableAssignment/VariableAssignUtility.cls +++ b/force-app/main/default/classes/VariableAssignment/VariableAssignUtility.cls @@ -32,6 +32,8 @@ public class VariableAssignUtility { elss.logLine = lls; //Add elsss to currentMenthodUnit currentMethodUnit.executedLinesAndSubUnits.add(elss); + //update currentLog + utilityVariables.currentLog = lls; } else if (!utilityVariables.codeUnitsStack.isEmpty()) { CodeUnitContainerSchema currentCodeUnit = (CodeUnitContainerSchema) utilityVariables.codeUnitsStack.peek(); //create a new ExecutingLineAndSubUnitSchema and push it to the current codeUnit @@ -39,6 +41,8 @@ public class VariableAssignUtility { elss.logLine = lls; //Add the elss to the currentCodeUnit currentCodeUnit.executedLinesAndSubUnits.add(elss); + //update currentLog + utilityVariables.currentLog = lls; } } } diff --git a/force-app/main/default/classes/utilityVariables.cls b/force-app/main/default/classes/utilityVariables.cls index 08c85fc..5f87921 100644 --- a/force-app/main/default/classes/utilityVariables.cls +++ b/force-app/main/default/classes/utilityVariables.cls @@ -112,6 +112,12 @@ public class utilityVariables { }, 'USER_INFO' => new Map{ '^[0-9:.]+\\s\\([0-9]+\\)\\|(USER_INFO\\|)\\[([0-9]+|(EXTERNAL))\\](\\|\\w+\\|)[A-Za-z0-9\\._%+\\-]+@[A-Za-z0-9\\.\\-]+\\.[A-Za-z]{2,}(\\|.+\\|)(GMT[+0-9:-]+)' => 'User-Info-Generic' + }, + 'SOQL_EXECUTE_BEGIN'=>new Map{ + '^[0-9:.]+\\s\\([0-9]+\\)\\|(SOQL_EXECUTE_BEGIN\\|)\\[[0-9]+\\]+(\\|).*' => 'SOQL-Begin' + }, + 'SOQL_EXECUTE_END'=>new Map{ + '^[0-9:.]+\\s\\([0-9]+\\)\\|(SOQL_EXECUTE_END\\|)\\[[0-9]+\\]+(\\|).*' => 'SOQL-End' } }; diff --git a/force-app/main/default/lwc/UtilityComponents/lwc/tile/tile.html b/force-app/main/default/lwc/UtilityComponents/lwc/tile/tile.html index 5b33b06..9b916c9 100644 --- a/force-app/main/default/lwc/UtilityComponents/lwc/tile/tile.html +++ b/force-app/main/default/lwc/UtilityComponents/lwc/tile/tile.html @@ -1,6 +1,6 @@