我使用 xls 文件作为 Drools 引擎的资源。如果我理解正确的话,当启动时,内部Drools引擎首先将.xls文件转换为.drl文件,然后以正常方式编译并运行。问题是如何以 xls -> drl 的方式捕获中间 .drl 文件。我需要它来排除故障。还有其他方法可以调试 .xls drools 功能吗?
最佳答案
这是我手头上的一些在 5.x 下运行的代码。您可能必须更改 6.x 的导入。
import org.drools.decisiontable.SpreadsheetCompiler;
private void testSpreadsheet( String dtpath ){
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();
}
}
关于drools - 解决流口水问题 xls,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27011437/