Skip to content

Commit

Permalink
fix: Context columns by where clause with tab level. (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwinBetanc0urt authored Aug 14, 2024
1 parent ab2ac61 commit 0f36ce2
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,21 @@ public static List<String> getContextColumnNames(String context) {
String END = "\\@"; // A literal ")" character in regex

// Captures the word(s) between the above two character(s)
String patternValue = START + "(#|$){0,1}(\\w+)" + END;
final String COLUMN_NAME_PATTERN = START + "(#|$|\\d\\|){0,1}(\\w+)" + END;

Pattern pattern = Pattern.compile(patternValue);
Pattern pattern = Pattern.compile(
COLUMN_NAME_PATTERN,
Pattern.CASE_INSENSITIVE | Pattern.DOTALL
);
Matcher matcher = pattern.matcher(context);
Map<String, Boolean> columnNamesMap = new HashMap<String, Boolean>();
while(matcher.find()) {
columnNamesMap.put(matcher.group().replace("@", "").replace("@", ""), true);
final String columnContext = matcher.group().replace("@", "").replace("@", "");
columnNamesMap.put(columnContext, true);
}
return new ArrayList<String>(columnNamesMap.keySet());
}

public static ReferenceValues getReferenceDefinition(String columnName, int referenceId, int referenceValueId, int validationRuleId) {
String embeddedContextColumn = null;
if(referenceId > 0 && ReferenceUtil.isLookupReference(referenceId)) {
Expand Down

0 comments on commit 0f36ce2

Please sign in to comment.