Drools: Access rules stored in Guvnor in Java web app
Our Business analyst loads rules in Guvnor. How do I access/load that in code in my Java web app ? They wan开发者_JAVA百科t to be able to change the rules independent of the Java web app.
I have seen code similar to this but I am not sure.
kbuilder.add( ResourceFactory.newInputStreamResource(new StringInputStream(myDrlAsString)), ResourceType.DRL);
kbuilder.add( ResourceFactory.newInputStreamResource(new ByteArrayInputStream(myDrlAsByteArr)), ResourceType.DRL);
Do I have to store the Guvnor rules in some classpath outside the web-app that can then be loaded by the java webapp ?
TIA, Vijay
I found my own answer. java.io.FileInputStream fis =null; fis = new java.io.FileInputStream (new java.io.File( ASSET_FILES[0] ) );
kbuilder.add(ResourceFactory.newInputStreamResource(fis), ResourceType.DRL);
精彩评论