When we execute rules, behind the scene java code is generated which is actually getting executed, to see this java code you need to set configuration path where you want java code generated by drools to be stored.
PackageBuilderConfiguration configuration = new PackageBuilderConfiguration();
configuration.setDumpDir(new File("XYZ"));
final KnowledgeBuilder kbuilder = KnowledgeBuilderFactory
.newKnowledgeBuilder(configuration);
Set XYZ as a directory path where you would like drools to store generated code. e.g. XYZ = "c:/drools/codegen"
When you run your program the java classes generated for the .drl files are stored at the path XYZ.
This generated code is really helpful to understand the behavior in lot of situations.
PackageBuilderConfiguration configuration = new PackageBuilderConfiguration();
configuration.setDumpDir(new File("XYZ"));
final KnowledgeBuilder kbuilder = KnowledgeBuilderFactory
.newKnowledgeBuilder(configuration);
Set XYZ as a directory path where you would like drools to store generated code. e.g. XYZ = "c:/drools/codegen"
When you run your program the java classes generated for the .drl files are stored at the path XYZ.
This generated code is really helpful to understand the behavior in lot of situations.
Awesome Sir. This helped me view the Java code generated for our DRLs. Thanks a million!
ReplyDelete