RED-9472: seperation of system rules
adding logs for bug investigation
This commit is contained in:
parent
a0b34894ee
commit
f22a7c450e
@ -63,6 +63,7 @@ public class RuleBuilderController implements RuleBuilderResource {
|
||||
}
|
||||
try {
|
||||
var droolsValidation = droolsValidationService.testRules(new RuleValidationModel(RuleFileType.ENTITY.name(), mergingResult.getMergedRules()));
|
||||
log.info("result of validation: " + droolsValidation);
|
||||
droolsValidationResponse = DroolsValidationResponse.builder()
|
||||
.syntaxErrorMessages(droolsValidation.getSyntaxErrorMessages()
|
||||
.stream()
|
||||
@ -99,7 +100,7 @@ public class RuleBuilderController implements RuleBuilderResource {
|
||||
} catch (Exception e) {
|
||||
throw new RulesValidationException("Could not test rules: " + e.getMessage(), e);
|
||||
}
|
||||
log.info("result after validation: {}",rulesUpdateRequest);
|
||||
log.info("result after validation: {}", rulesUpdateRequest);
|
||||
return new ResponseEntity<>(rulesUploadResponse, HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@ -69,25 +69,24 @@ public class RuleBuilderService {
|
||||
.map(String::trim)
|
||||
.collect(Collectors.toSet());
|
||||
ruleFileBluePrintExisting.setImports(uniqueImports.stream()
|
||||
.collect(Collectors.joining("")));
|
||||
.collect(Collectors.joining("")));
|
||||
Set<String> uniqueGlobals = Arrays.stream((ruleFileBluePrintExisting.getGlobals() + mergedRuleFileBlueprint.getGlobals()).replaceAll("\n", "").split("import"))
|
||||
.map(String::trim)
|
||||
.collect(Collectors.toSet());
|
||||
ruleFileBluePrintExisting.setGlobals(uniqueGlobals.stream()
|
||||
.collect(Collectors.joining("")));
|
||||
.collect(Collectors.joining("")));
|
||||
ruleFileBluePrintExisting.setFunctions(Stream.concat(ruleFileBluePrintExisting.getFunctions()
|
||||
.stream(),
|
||||
mergedRuleFileBlueprint.getFunctions()
|
||||
.stream())
|
||||
.distinct()
|
||||
.toList());
|
||||
.stream(),
|
||||
mergedRuleFileBlueprint.getFunctions()
|
||||
.stream())
|
||||
.distinct()
|
||||
.toList());
|
||||
ruleFileBluePrintExisting.setDeclarations(Stream.concat(ruleFileBluePrintExisting.getDeclarations()
|
||||
.stream(),
|
||||
mergedRuleFileBlueprint.getDeclarations()
|
||||
.stream())
|
||||
.distinct()
|
||||
.toList());
|
||||
log.info("merged rules: {}", RuleFileFactory.buildRuleString(ruleFileBluePrintExisting, false, false));
|
||||
.stream(),
|
||||
mergedRuleFileBlueprint.getDeclarations()
|
||||
.stream())
|
||||
.distinct()
|
||||
.toList());
|
||||
return RuleMergingResult.builder()
|
||||
.mergedRules(RuleFileFactory.buildRuleString(mergedRuleFileBlueprint, false, false))
|
||||
.addedGlobalsOffset(mergedRuleFileBlueprint.getGlobals().length())
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user