[jboss-jira] [JBoss JIRA] Commented: (JBRULES-2438) loading multiple sheets of single Excel book by one change-set xml

Tihomir Surdilovic (JIRA) jira-events at lists.jboss.org
Thu Feb 25 22:34:10 EST 2010


    [ https://jira.jboss.org/jira/browse/JBRULES-2438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12516890#action_12516890 ] 

Tihomir Surdilovic commented on JBRULES-2438:
---------------------------------------------

A workaround currently is not use change set:

....
// load sheet1
DecisionTableConfiguration config1 = KnowledgeBuilderFactory.newDecisionTableConfiguration();
config1.setInputType(DecisionTableInputType.XLS);
config1.setWorksheetName("sheet1"); kbuilder.add(ResourceFactory.newClassPathResource("Sample.xls"), ResourceType.DTABLE, config1);
// load sheet2
DecisionTableConfiguration config2 = KnowledgeBuilderFactory.newDecisionTableConfiguration();
config2.setInputType(DecisionTableInputType.XLS);
config2.setWorksheetName("sheet2"); kbuilder.add(ResourceFactory.newClassPathResource("Sample.xls"), ResourceType.DTABLE, config2);
....

> loading multiple sheets of single Excel book by one change-set xml
> ------------------------------------------------------------------
>
>                 Key: JBRULES-2438
>                 URL: https://jira.jboss.org/jira/browse/JBRULES-2438
>             Project: Drools
>          Issue Type: Feature Request
>      Security Level: Public(Everyone can see) 
>          Components: drools-core
>    Affects Versions: 5.0.1.FINAL
>            Reporter: Toshiya Kobayashi
>            Assignee: Mark Proctor
>
> I'm trying to use rules via DecisionTable using change-set.
> I wrote rules in multiple sheets of single Excel book.
> Then I configured my change-set xml like:
> ...
> <add>
> <resource source='classpath:data/dtable.xls' type="DTABLE">
> <decisiontable-conf input-type="XLS" worksheet-name="sheet1" />
> </resource>
> <resource source='classpath:data/dtable.xls' type="DTABLE">
> <decisiontable-conf input-type="XLS" worksheet-name="sheet2" />
> </resource>
> </add>
> ...
> But only rules of sheet1 were loaded.
> As far as I observed source codes, KnowledgeAgentImpl.java puts resource into "Map<Resource, ResourceMapping> resources". But even if multiple resources are configured in change-set, it appears to me like those resources are considered as the same resource and eventually only one resource will be registered.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list