diff --git a/force-app/main/default/classes/Flow/flowUtility.cls b/force-app/main/default/classes/Flow/flowUtility.cls new file mode 100644 index 0000000..4dfd790 --- /dev/null +++ b/force-app/main/default/classes/Flow/flowUtility.cls @@ -0,0 +1,61 @@ +public class flowUtility { + //extracting the Flow ID and storing it in Utility variable flowId + public static void analyzeFlowStart(String line) { + List splitArr = line.split('\\|'); + utilityVariables.flowId = splitArr[splitArr.size() - 2]; + } + + //pushing the method to Stack i.e each flow under a particular object + public static void analyzeFlowName(String line) { + MethodSchema methodUnit = new MethodSchema(); + List splitArr = line.split('\\|'); + methodUnit.methodName = splitArr[splitArr.size() - 1]; + methodUnit.ruleId = utilityVariables.flowId; + addMethodtoStack(methodUnit); + } + + public static void addElement(String line) { + List splitArr = line.split('\\|'); + LogLineSchema logLine = new LogLineSchema(); + logLine.type = 'FLOEL'; + logLine.isFlowElement = true; + logLine.ruleName = splitArr[splitArr.size() -1] +' ' +splitArr[splitArr.size() - 2]; + pushVal(logLine); + } + public static void removeElement() { + + } + public static void addvalue(String line) { + List splitArr = line.split('\\|'); + LogLineSchema logLine = new LogLineSchema(); + logLine.type = 'FLORL'; + logLine.isFlowElement = true; + logLine.ruleName = splitArr[splitArr.size() - 2] +' ' +splitArr[splitArr.size() - 1]; + pushVal(logLine); + } + public static void popMethodUnit(){ + if (!utilityVariables.methodUnitsStack.isEmpty()) { + utilityVariables.methodUnitsStack.pop(); + } + } + //adding the existing flow to method stack and codeunit + private static void addMethodtoStack(MethodSchema methodUnit) { + if (!utilityVariables.codeUnitsStack.isEmpty()) { + CodeUnitContainerSchema currentCodeUnit = (CodeUnitContainerSchema) utilityVariables.codeUnitsStack.peek(); + ExecutedLineAndSubUnitSchema elss = new ExecutedLineAndSubUnitSchema(); + elss.methodUnit = methodUnit; + currentCodeUnit.executedLinesAndSubUnits.add(elss); + utilityVariables.methodUnitsStack.push(methodUnit); + } + } + + private static void pushVal(LogLineSchema log) { + if (!utilityVariables.methodUnitsStack.isEmpty()) { + MethodSchema currentMethodUnit = (MethodSchema) utilityVariables.methodUnitsStack.peek(); + ExecutedLineAndSubUnitSchema elss = new ExecutedLineAndSubUnitSchema(); + elss.logLine = log; + currentMethodUnit.executedLinesAndSubUnits.add(elss); + utilityVariables.currentLog = log; + } + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/Flow/flowUtility.cls-meta.xml b/force-app/main/default/classes/Flow/flowUtility.cls-meta.xml new file mode 100644 index 0000000..998805a --- /dev/null +++ b/force-app/main/default/classes/Flow/flowUtility.cls-meta.xml @@ -0,0 +1,5 @@ + + + 62.0 + Active + diff --git a/force-app/main/default/classes/LogLineSchema/LogLineSchema.cls b/force-app/main/default/classes/LogLineSchema/LogLineSchema.cls index 88d01bb..d0d2a92 100644 --- a/force-app/main/default/classes/LogLineSchema/LogLineSchema.cls +++ b/force-app/main/default/classes/LogLineSchema/LogLineSchema.cls @@ -34,4 +34,9 @@ public class LogLineSchema { //Added for Validation Pass or fail @AuraEnabled public Boolean isValidRulePass; + //Added for Flow ruleName is both for element and rule + @AuraEnabled + public String ruleName; + @AuraEnabled + public Boolean isFlowElement; } diff --git a/force-app/main/default/classes/MethodEntryExit/MethodSchema.cls b/force-app/main/default/classes/MethodEntryExit/MethodSchema.cls index e8845b3..4b20ba9 100644 --- a/force-app/main/default/classes/MethodEntryExit/MethodSchema.cls +++ b/force-app/main/default/classes/MethodEntryExit/MethodSchema.cls @@ -10,7 +10,7 @@ public class MethodSchema { //Total name of the method invoked with class and namespaces @AuraEnabled public String methodTitle; - //18-digit Id of validation rule + //18-digit Id of validation rule also Id for flow @AuraEnabled public String ruleId; //Id of the class from which method Invoked diff --git a/force-app/main/default/classes/UtilityMethods.cls b/force-app/main/default/classes/UtilityMethods.cls index 728fe08..77e2d9f 100644 --- a/force-app/main/default/classes/UtilityMethods.cls +++ b/force-app/main/default/classes/UtilityMethods.cls @@ -260,6 +260,44 @@ public class UtilityMethods { SoqlUtility.processSoqlExit(line); break; } + else if (utilityVariables.currentLineEvent == 'FLOW_CREATE_INTERVIEW_BEGIN') { + flowUtility.analyzeFlowStart(line); + break; + } + else if (utilityVariables.currentLineEvent == 'FLOW_CREATE_INTERVIEW_END') { + flowUtility.analyzeFlowName(line); + break; + } + else if (utilityVariables.currentLineEvent == 'FLOW_ELEMENT_BEGIN') { + flowUtility.addElement(line); + break; + } + else if (utilityVariables.currentLineEvent == 'FLOW_ELEMENT_END') { + flowUtility.removeElement(); + break; + } + else if (utilityVariables.currentLineEvent == 'FLOW_BULK_ELEMENT_BEGIN') { + /* + * 1. Use same methods as FLOW_ELEMENT_BEGIN + */ + flowUtility.addElement(line); + break; + } + else if (utilityVariables.currentLineEvent == 'FLOW_BULK_ELEMENT_END') { + /* + * 1. Use same methods as FLOW_ELEMENT_END + */ + flowUtility.removeElement(); + break; + } + else if (utilityVariables.currentLineEvent == 'FLOW_VALUE_ASSIGNMENT') { + flowUtility.addvalue(line); + break; + } + else if (utilityVariables.currentLineEvent == 'FLOW_START_INTERVIEWS_END') { + flowUtility.popMethodUnit(); + break; + } } } } else { diff --git a/force-app/main/default/classes/utilityVariables.cls b/force-app/main/default/classes/utilityVariables.cls index c3ba598..06bd233 100644 --- a/force-app/main/default/classes/utilityVariables.cls +++ b/force-app/main/default/classes/utilityVariables.cls @@ -17,6 +17,8 @@ public class utilityVariables { //String to Store the previous line event public static String previousLineEvent = null; + public static String flowId = null; + //Track the currentHolding logLine public static LogLineSchema currentLog = null; @@ -61,7 +63,8 @@ public class utilityVariables { '^[0-9:.]+\\s\\([0-9]+\\)\\|(CODE_UNIT_STARTED\\|)[(0-9)(\\[EXTERNAL\\])]+(\\|TRIGGERS)' => 'Trigger-Simple', '^[0-9:.]+\\s\\([0-9]+\\)\\|(CODE_UNIT_STARTED\\|)[(0-9)(\\[EXTERNAL\\])]+(\\|)\\w+(\\|)[\\w.]+\\s(on)\\s(\\w)+\\s(trigger\\sevent\\s)\\w+(\\|__sfdc_trigger\\/)[\\w\\/]+' => 'Trigger-Detailed', '^[0-9:.]+\\s\\([0-9]+\\)\\|(CODE_UNIT_STARTED\\|)[(0-9)(\\[EXTERNAL\\])]+(\\|)\\w+;\\w+;\\w+(\\|)[\\w\\.]+' => 'Trigger-Event', - '^[0-9:.]+\\s\\([0-9]+\\)\\|(CODE_UNIT_STARTED\\|)[(\\[EXTERNAL\\])(0-9)]+(\\|Validation)\\:[\\w]+\\:[\\w\\d]+' => 'Validation-Generic' + '^[0-9:.]+\\s\\([0-9]+\\)\\|(CODE_UNIT_STARTED\\|)[(\\[EXTERNAL\\])(0-9)]+(\\|Validation)\\:[\\w]+\\:[\\w\\d]+' => 'Validation-Generic', + '^[0-9:.\\s\\(\\)]+(\\|)(CODE_UNIT_STARTED)(\\|)(\\[EXTERNAL\\])(\\|)Flow:[a-zA-Z_]+' => 'Flow-Generic' }, 'STATEMENT_EXECUTE' => new Map{ '^[0-9:.]+\\s\\([0-9]+\\)\\|(STATEMENT_EXECUTE\\|)\\[[0-9]+\\]' => 'Statement-Execute' @@ -116,8 +119,32 @@ public class utilityVariables { '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' + 'SOQL_EXECUTE_END'=>new Map{ + '^[0-9:.]+\\s\\([0-9]+\\)\\|(SOQL_EXECUTE_END\\|)\\[[0-9]+\\]+(\\|).*' => 'SOQL-End' + }, + 'FLOW_CREATE_INTERVIEW_BEGIN'=>new Map{ + '^[0-9:.\\s\\(\\)]+(\\|)(FLOW_CREATE_INTERVIEW_BEGIN)(\\|)([0-9a-zA-Z])+(\\|)([0-9a-zA-Z])+(\\|)([0-9a-zA-Z])+' => 'Flow-Generic-Start' + }, + 'FLOW_CREATE_INTERVIEW_END'=>new Map{ + '^[0-9:.\\s\\(\\)]+(\\|)FLOW_CREATE_INTERVIEW_END(\\|)[a-z0-9\\-]+(\\|)[a-zA-Z\\s_]+' => 'Flow-Generic-End' + }, + 'FLOW_ELEMENT_BEGIN'=>new Map{ + '^[0-9:.\\s\\(\\)]+(\\|)(FLOW_ELEMENT_BEGIN)(\\|)[0-9a-z\\-]+(\\|)[a-zA-Z]+(\\|)[a-zA-Z_]+' => 'Flow-Element-Begin-Generic' + }, + 'FLOW_ELEMENT_END'=>new Map{ + '^[0-9:.\\s\\(\\)]+(\\|)(FLOW_ELEMENT_END)(\\|)[0-9a-z\\-]+(\\|)[a-zA-Z]+(\\|)[a-zA-Z_]+' => 'Flow-Element-End-Generic' + }, + 'FLOW_BULK_ELEMENT_BEGIN'=>new Map{ + '[0-9:.\\s\\(\\)]+(\\|)(FLOW_BULK_ELEMENT_BEGIN)(\\|)[a-zA-Z]+(\\|)[a-zA-Z_]+' => 'Flow-Bulk-Element-Begin-Generic' + }, + 'FLOW_BULK_ELEMENT_END'=>new Map{ + '^[0-9:.\\s\\(\\)]+(\\|)(FLOW_BULK_ELEMENT_END)(\\|)[a-zA-Z]+(\\|)[a-zA-Z_]+(\\|)[0,1](\\|)[0,1]' => 'Flow-Bullk-Element-End-Generic' + }, + 'FLOW_VALUE_ASSIGNMENT'=>new Map{ + '^[0-9:.\\s\\(\\)]+(\\|)(FLOW_VALUE_ASSIGNMENT)(\\|)[0-9a-z\\-]+(\\|)[A-Za-z_]+(\\|)[a-z]+' => 'Flow-Value-Assignment' + }, + 'FLOW_START_INTERVIEWS_END'=>new Map{ + '^[0-9:.\\s\\(\\)]+(\\|)FLOW_START_INTERVIEWS_END(\\|)[0-1]' => 'Flow-Start-Interviews-End' } }; @@ -207,6 +234,14 @@ public class utilityVariables { String name = 'Validation on '; name += splitArr[splitArr.size() - 2]; codeUnitDetails.codeUnitName = name; + } else if (pattern == 'Flow-Generic') { + enteredCondtion = true; + codeUnitDetails.codeUnitType = 'Flow'; + codeUnitDetails.isTrigger = false; + List splitArr = line.split(':'); + String name = 'Flow on '; + name += splitArr[splitArr.size() - 1]; + codeUnitDetails.codeUnitName = name; } if (!enteredCondtion) { /** diff --git a/force-app/main/default/lwc/UtilityComponents/lwc/tile/tile.css b/force-app/main/default/lwc/UtilityComponents/lwc/tile/tile.css new file mode 100644 index 0000000..d5c0fa4 --- /dev/null +++ b/force-app/main/default/lwc/UtilityComponents/lwc/tile/tile.css @@ -0,0 +1,4 @@ +lightning-card{ + --slds-c-card-header-spacing-block-end:0px; + --slds-c-card-header-spacing-block-start:0px; +} \ No newline at end of file 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 9b916c9..5b33b06 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 @@