"resultExclusions" are passing to ArachneExecutionEngine through DTO https://github.com/OHDSI/ArachneCommons/blob/develop/execution-engine-commons/src/main/java/com/odysseusinc/arachne/execution_engine_common/api/v1/dto/AnalysisSyncRequestDTO.java#L22
Before result send back to client, it's content is filtered according to exclusion patterns, and files that matches these patterns are deleted from results. But if list of exclusion patterns contains exact match, it will be skipped. See filterFiles() method in https://github.com/OHDSI/ArachneCommons/blob/develop/execution-engine-commons/src/main/java/com/odysseusinc/arachne/execution_engine_common/util/CommonFileUtils.java#L119
filterFiles() uses noneMatch() to filter files:
private static boolean noneMatch(List<String> patterns, String fileName) {
return patterns.stream()
.filter(matcher::isPattern)
.noneMatch(e -> matcher.match(e.trim(), fileName));
}
matcher::isPattern returns false for exact matches, so only actual patterns are applied.
To fix this, we should change noneMatch() to something like this:
private static boolean noneMatch(List<String> patterns, String fileName) {
return patterns.stream()
.noneMatch(pattern -> matcher.isPattern(pattern)
? matcher.match(pattern.trim(), fileName)
: pattern.equals(fileName));
}
"resultExclusions" are passing to ArachneExecutionEngine through DTO https://github.com/OHDSI/ArachneCommons/blob/develop/execution-engine-commons/src/main/java/com/odysseusinc/arachne/execution_engine_common/api/v1/dto/AnalysisSyncRequestDTO.java#L22
Before result send back to client, it's content is filtered according to exclusion patterns, and files that matches these patterns are deleted from results. But if list of exclusion patterns contains exact match, it will be skipped. See
filterFiles()method in https://github.com/OHDSI/ArachneCommons/blob/develop/execution-engine-commons/src/main/java/com/odysseusinc/arachne/execution_engine_common/util/CommonFileUtils.java#L119filterFiles()usesnoneMatch()to filter files:matcher::isPatternreturns false for exact matches, so only actual patterns are applied.To fix this, we should change
noneMatch()to something like this: