Bug 1074672
| Summary: | knowledge-api: cannot build Decision Table from CSV | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Retired] JBoss BRMS Platform 6 | Reporter: | Marek Winkler <mwinkler> | ||||
| Component: | BRE | Assignee: | Edson Tirelli <etirelli> | ||||
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Marek Winkler <mwinkler> | ||||
| Severity: | high | Docs Contact: | |||||
| Priority: | high | ||||||
| Version: | 6.0.1 | CC: | mbiarnes, rrajasek | ||||
| Target Milestone: | CR1 | ||||||
| Target Release: | 6.0.1 | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2014-08-06 19:56:42 UTC | Type: | Bug | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Attachments: |
|
||||||
We will fix this. Just not sure it is a blocker for 6.0.1 because it affects the legacy API. Engineering is ok either way. Low risk, isolated change, we have a chance for customers to depend on this, will cherry pick Fixed. (master) http://github.com/droolsjbpm/drools/commit/c029bfc59 (6.0.x) http://github.com/droolsjbpm/drools/commit/645d0e5cb Ticket cherry-picked into 6.0.1.CR1. Commit: 378e199cd2b481e078c907bf468d12ae750574de Verified on BRMS 6.0.1 CR1. |
Created attachment 872834 [details] Maven project with reproducer Description of problem: When using Drools legacy knowledge-api, it is not possible to build a Decision Table from a CSV resource, because the builder thinks that its type is XLS, even if the type is set in the DecisionTableConfiguration as follows: DecisionTableConfiguration dtconf = KnowledgeBuilderFactory.newDecisionTableConfiguration(); dtconf.setInputType(DecisionTableInputType.CSV); KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(); kbuilder.add(ResourceFactory.newClassPathResource("sample.csv", getClass()), ResourceType.DTABLE, dtconf); The stacktrace I get indicates that Drools try to parse the file as a XLS: java.lang.IllegalArgumentException: Your InputStream was neither an OLE2 stream, nor an OOXML stream at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:75) at org.drools.decisiontable.parser.xls.ExcelParser.parseFile(ExcelParser.java:81) ... Version-Release number of selected component (if applicable): BRMS 6.0.1 ER2 How reproducible: Please run mvn clean test in the attached maven project. Actual results: Compilation fails with error saying "Your InputStream was neither an OLE2 stream, nor an OOXML stream". Expected results: The test passes (compilation succeeds).