Pull request #5: RED-155: Bump config service version to make sure, dictionaries and
Merge in RED/redaction-service from feature/RED-155 to master * commit 'c80cae3fc361a651e120626daf26d39de1dc656f': No need to write or add rules to file in classpath. RED-155: Bump config service version to make sure, dictionaries and rules are pulled correctly.
This commit is contained in:
commit
fa7693e88b
@ -39,7 +39,7 @@
|
||||
<dependency>
|
||||
<groupId>com.iqser.red.service</groupId>
|
||||
<artifactId>configuration-service-api-v1</artifactId>
|
||||
<version>0.9.0</version>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.drools</groupId>
|
||||
|
||||
@ -29,8 +29,6 @@ public class DroolsExecutionService {
|
||||
@Autowired
|
||||
private KieContainer kieContainer;
|
||||
|
||||
private String currentDrlRules;
|
||||
|
||||
private long rulesVersion = -1;
|
||||
|
||||
public Section executeRules(Section section) {
|
||||
@ -64,22 +62,15 @@ public class DroolsExecutionService {
|
||||
KieServices kieServices = KieServices.Factory.get();
|
||||
InputStream input = new ByteArrayInputStream(drlAsString.getBytes(StandardCharsets.UTF_8));
|
||||
KieFileSystem kieFileSystem = kieServices.newKieFileSystem();
|
||||
kieFileSystem.write("src/main/resources/drools/rules.drl", kieServices.getResources()
|
||||
.newInputStreamResource(input));
|
||||
kieFileSystem.write(kieServices.getResources().newInputStreamResource(input));
|
||||
KieBuilder kieBuilder = kieServices.newKieBuilder(kieFileSystem);
|
||||
kieBuilder.buildAll();
|
||||
KieModule kieModule = kieBuilder.getKieModule();
|
||||
kieContainer.updateToVersion(kieModule.getReleaseId());
|
||||
currentDrlRules = drlAsString;
|
||||
} catch (Exception e) {
|
||||
throw new RulesValidationException("Could not update rules", e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public String getRules() {
|
||||
|
||||
return currentDrlRules;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user