[rules-users] How to display Knowledge base / DRL

Wolfgang Laun wolfgang.laun at gmail.com
Mon Jun 17 23:32:56 EDT 2013


I have this lying around, appears to work with 5.1.1 and later.
SpreadsheetCompiler.compile is not in the stable API, but has
been stable in 5.x.

import org.drools.decisiontable.InputType;
import org.drools.decisiontable.SpreadsheetCompiler;

private void testSpreadsheet( String drPath ){
    File dtf = new File( dtPath );
    InputStream is;
    try {
      is = new FileInputStream( dtf );
      SpreadsheetCompiler ssComp = new SpreadsheetCompiler();
      String s = ssComp.compile( is, InputType.XLS );
      System.out.println( "=== Begin generated DRL ===" );
      System.out.println( s );
      System.out.println( "=== End generated DRL ===" );
    } catch (IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
  }


On 18/06/2013, dfreeman at gio.com.au <dfreeman at gio.com.au> wrote:
> Hi, I'm fairly new to Drools and am loading an Excel spreadsheet decision
> table into a Knowledge base. This works but I have problems when I fire the
> rules. Under the older Rulebase model it seemed fairly simple to display
> the
> generated DRL. I am having problems with my current task and feel it would
> be helpful if I could see the generated rules. I'm assuming this is the
> best
> approach. Any help would be appreciated.
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/How-to-display-Knowledge-base-DRL-tp4024340.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>


More information about the rules-users mailing list