Re: [rules-users] Rule Templates - Docs Examples?

2009-11-24 Thread Adam Rinehart
Looking at the 5.1 snapshots, these sections have not been updated since the
5.0 release. I'm looking at a 5.1 snapshot I downloaded on 11/2/09.

The relevent sections, specifically 5.1.7 and 5.2, seem to have errors
and/or omissions and those sections should have the information I'm looking
for. Unfortunately I don't know what the correct info should be, so I can't
submit an edit myself.

As an example, from the last part of 5.1.7:
snip

The code to run this is simple:

KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
DecisionTableConfiguration dtconf =
KnowledgeBuilderFactory.newDecisionTableConfiguration();
dtconf.setInputType( DecisionTableInputType.XLS );
dtconf.setWorksheetName( Tables_2 );
kbuilder.add( ResourceFactory.newInputStreamResource( getSpreadsheetStream() ),
  ResourceType.DTABLE,
  dtconf );

CollectionKnowlegePackage kpkg = kbuilder.getKnowlegePackages();

We create an ExternalSpreadsheetCompiler object and use it to merge the
spreadsheet with the rules. The two integer parameters indicate the column
and row where the data actually starts - in our case column 2, row 2 (i.e.
B2)

/snip

The docs discuss creating an ExternalSpreadsheetCompiler in the example to
merge the spreadsheet with the rules template, but the example is for a
standard DecisionTable, without a custom template.

In section 5.2, it goes over templates, but does not discussion optional
values or array values.

I have reviewed the Drools-Example files. There is an example in there of
using array values, but not an example using optional values, which is what
I particularly need.


On Tue, Nov 24, 2009 at 1:17 AM, Wolfgang Laun wolfgang.l...@gmail.comwrote:

 An extensive rewrite of the section dealing with Templates was done in
 the early stages of 5.0, and it ought to be available with current
 snapshot releases. The relevant section is 5.2, Templates.

 -W






 On 11/24/09, Adam Rinehart adam.rineh...@gmail.com wrote:
  I am trying to research using a rule template driven by data from a
  spreadsheet, rather than using a straight decision table.
 
  I understand I need to use the ExternalSpreadsheetCompiler but am finding
 a
  distressing lack of information about the template format.
 
  The 5.0 docs seem to have mistakes; the code example for that section
 looks
  to have been cut  pasted from another section and does not match the
 text
  description of what is going on.
 
  Using google, the best I could find was a blog posting from Steven
 Williams
  on Aug 26, 2008:
 http://blog.athico.com/2008/08/drools-rule-templates.html
 
  In this blog posting, he said it was the first of 3 examples from the
  drools-examples project. But I could not find any additional blog
 postings
  by him on this subject.
 
  Does anyone know of additional documentation or examples on how rule
  templates work?
 
  Specifically, how to do optional columns, and array columns, similar to
 how
  the built in decision tables feature works?
 
  Adam
 
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Rule Templates - Docs Examples?

2009-11-23 Thread Adam Rinehart
I am trying to research using a rule template driven by data from a
spreadsheet, rather than using a straight decision table.

I understand I need to use the ExternalSpreadsheetCompiler but am finding a
distressing lack of information about the template format.

The 5.0 docs seem to have mistakes; the code example for that section looks
to have been cut  pasted from another section and does not match the text
description of what is going on.

Using google, the best I could find was a blog posting from Steven Williams
on Aug 26, 2008: http://blog.athico.com/2008/08/drools-rule-templates.html

In this blog posting, he said it was the first of 3 examples from the
drools-examples project. But I could not find any additional blog postings
by him on this subject.

Does anyone know of additional documentation or examples on how rule
templates work?

Specifically, how to do optional columns, and array columns, similar to how
the built in decision tables feature works?

Adam
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Ant build script and XLS Decision Tables failing

2009-11-03 Thread Adam Rinehart
Has anyone been able to compile an XLS decision table into a package via an
Ant build script?

I've scouring the documentation on the Drools Ant Compiler Task (what little
I could find) and I can't find any documentation on hw to pass configuration
into the ant task for things such as compiling XLS decision tables.

Without a configuration entry, when I try and run the build script
referencing an excel file, it fails with the following error:
Buildfile: C:\Documents and
Settings\Adam\workspace\RivaDroolsExperiment\build-5.1.xml
compileArtifacts:

BUILD FAILED
C:\Documents and
Settings\Adam\workspace\RivaDroolsExperiment\build-5.1.xml:21: RuleBaseTask
failed: null
---
I suspect this message is because the compiler task is failing with a null
pointer exception, which it throws when you don't provide it with a
configuration file. I am running
the build3423-rev29890-20091102-1042 Drools 5.1 Snapshot.

The relevant snippet from the build script:
target name=compileArtifacts
compiler srcdir=${projectPath}src/main/rules
tofile=${projectPath}target/experiment.pkg binformat=package
bintype=knowledge classpathref=model.classpath
include name=Sample.xls /
/compiler
/target
--

Thanks,
Adam
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Best way to get fix from JIRA into local drools install?

2009-11-02 Thread Adam Rinehart
I have been paying attention to
https://jira.jboss.org/jira/browse/JBRULES-2230 because I am hoping to use
decision tables from within a changeset in a project I am developing. Code
to fix this issue was checked in on Oct 18th. What is the best way to use
this updated code?

From what I've been able to find, it sounds like I will need to build my own
local instance of drools; I can't find a source of dot-revisions, or nightly
builds.

So are my options:
1. Grab trunk, manually apply the patch to the one file, build
2. Grab a snapshot of svn and build
3. Is there a nightly build process that I can download a compiled version
from?

Of these 3 which is best, for some definition of best?

Adam
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users