-
Feature Request
-
Resolution: Done
-
Major
-
6.0.0.CR2
-
None
-
None
To get the DRL generated from decision table one has to currently use following code:
File dtable = new File("../resources/dtable.xls"); KieResources kieResources = KieServices.Factory.get().getResources(); Resource dtableResource = kieResources.newFileSystemResource(dtable); SpreadsheetCompiler compiler = new SpreadsheetCompiler(); String drl = compiler.compile(dtableResource.getInputStream(), InputType.XLS);
It would be nice to have this functionality out-of-the-box, similarly like 'drools.dump.dir' which is used to dump the Java classes generated from DRL.
Using the 'drools.dump.dir' property seems like the best option. The name is general enough and users would have to use/remember yet another config. property.
Looking at how the options are being used I see basically three possible solutions here (I maybe missing some other options):
- get the value of `drools.dump.dir` manually using the ChainedProperties.
- add this config. option into DecisionTableConfiguration. This would prevent the backwards compatibility issues when changing the DecisionTableProvider interface, but I am not entirely sure it is the right place for this kind of config.
- pass the entire KnowledgeBuilderConfiguration object into DecisionTableProvider.loadFromInputStream(). This seems like the best option from the clean-code point of view, but it would mean that the DecisionTableProvider interface would have to altered.