Re: [drools-user] excel worksheet caching

2006-01-16 Thread Pascal Chanteux
Hi,

I am using excel 2000. I've got a lot of problems while parsing the excel
files. An exception of type '

Caused by: *java.lang.ArrayIndexOutOfBoundsException
*

at java.lang.System.arraycopy(*Native Method*)

at org.apache.poi.hssf.record.UnknownRecord.init(*UnknownRecord.java:62*)
 ' occurs often when I modify a well formatted excel file.

I am looking for a way to avoid these exception. Can I use a newer version
of the apache POI ?

Thanks,

Pascal

On 1/14/06, Michael Neale [EMAIL PROTECTED] wrote:

 no there is no caching. What version of excel are you using?

 I have added CSV support as it is less prone to strange variances in the
 file format which xls is. Unfortunately Excel 97 format is very much  a
 closed format, so it can be a little hard to account for all versions
 saveing in strange states.

 Hopefully Microsoft will open up the new OfficeXML format enough, and that
 coupled with ODF (OpenDocument) will provide a better general purpose
 format
 (but it will take time to be widely available).

 On 1/14/06, Pascal Chanteux [EMAIL PROTECTED] wrote:
 
  Hi ,
 
  Is there any form of caching during the parsing/loading of an excel
  worksheet ?
  I have an excel worksheet for my drools test. The result of my test case
  is
  correct. Everything is OK.
  When I change something in the content of my cell, I have this exception
 :
 
  *org.drools.decisiontable.parser.DecisionTableParseException: An error
  occurred processing the decision table.
  at org.drools.decisiontable.DecisionTableLoader.loadDRLFromStream(
  DecisionTableLoader.java:124)
  at org.drools.decisiontable.DecisionTableLoader.getReader(
  DecisionTableLoader.java:108)
  at org.drools.decisiontable.DecisionTableLoader.loadFromInputStream(
  DecisionTableLoader.java:102)
  ...Caused by: org.apache.poi.hssf.record.RecordFormatException:
 Unable
  to construct record instance, the following exception occured: null
  at org.apache.poi.hssf.record.RecordFactory.createRecord(
  RecordFactory.java
  :237)
  at
  org.apache.poi.hssf.eventusermodel.HSSFEventFactory.genericProcessEvents
  (HSSFEventFactory.java:183)
  at org.apache.poi.hssf.eventusermodel.HSSFEventFactory.processEvents(
  HSSFEventFactory.java:101)
  at org.drools.decisiontable.parser.xls.ExcelParser.parseFile(
  ExcelParser.java:263)
  at org.drools.decisiontable.SpreadsheetDRLConverter.getRuleSheetListener
 (
  SpreadsheetDRLConverter.java:123)
  at org.drools.decisiontable.SpreadsheetDRLConverter.convertToDRL(
  SpreadsheetDRLConverter.java:72)
  at org.drools.decisiontable.DecisionTableLoader.loadDRLFromStream(
  DecisionTableLoader.java:118)
  ... 20 more*
 
  I found a workarround for this, simply by changing the name of the
 ruleset
  in the worksheet. In this case everything works fine again.
 
  Is this normal or I am missing something ?
 
  Thanks,
 
  Pascal
 
 




Re: [drools-user] Re: excel worksheet conditions ignored

2006-01-16 Thread Pascal Chanteux
Hi,
I've explored the drools excel parser (
org.drools.decisiontable.parser.xls.ExcelParser), but I don't see any
references to the FormulaRecord (*org.apache.poi.hssf.record.FormulaRecord*
) . I suppose I need to add some lines of code in the parser if I wanna to
use formula in my Drools decision table ?
Thanks,
Pascal.


On 1/14/06, Michael Neale [EMAIL PROTECTED] wrote:

 sometimes the excel format can cause havok with the apache POI parser
 (depends on exact versions of excel).



 On 1/14/06, Pascal Chanteux [EMAIL PROTECTED] wrote:
 
  The problem seems to be a cell format/formula problem. I need to use the
  'general' format because my cell has a formulas. In this case my
 condition
  is ignored. When I hard code the result of the formula in the cell, it's
  ok.
 
  Is it forbidden to have excel formulas in the cells belonging to the
  condition column ?
 
 
  On 1/13/06, Pascal Chanteux [EMAIL PROTECTED] wrote:
  
   Hi everybody !
  
   I am using drools 2.1 with excel worksheet. Sometimes, some conditions
   columns are completely ignored by the engine, and thus my actions are
   executed without testing the conditions . If I generate a DRL file
 from
  the
   worksheet, I see that my conditions are not included in the generated
  file.
   I can't find the reason for my condition column to be ignored.
   Does anyone has a clue ?
  
   Regards,
  
   Pascal Chanteux.
  
 
 




[drools-user] excel worksheet conditions ignored

2006-01-13 Thread Pascal Chanteux
Hi everybody !

I am using drools 2.1 with excel worksheet. Sometimes, some conditions
columns are completely ignored by the engine, and thus my actions are
executed without testing the conditions . If I generate a DRL file from the
worksheet, I see that my conditions are not included in the generated file.
I can't find the reason for my condition column to be ignored.
Does anyone has a clue ?

Regards,

Pascal Chanteux.