jboss - How to store new .drl file to BRMS rule engine server? -


i have scenario in project make dynamic rule , store brms rule server. i've try using kiefilesystem write string object become drl file, still cannot store rule rule engine server when open business central.

here code java main class :

// called artifact repository brms server string url = "http://192.168.0.1:8080/business-central/maven2/com/test/1.0/test-1.0.jar"; kieservices ks = kieservices.factory.get(); kierepository kr = ks.getrepository(); urlresource urlresource = (urlresource) ks.getresources().newurlresource(url);  urlresource.setusername("username"); urlresource.setpassword("password"); urlresource.setbasicauthentication("enabled");  inputstream = urlresource.getinputstream(); kiemodule kmodule = kr.addkiemodule(ks.getresources().newinputstreamresource(is));  kiefilesystem kfs = ks.newkiefilesystem(); string rule = "package com.test; \n" + "rule \"rule_1\" \n" + "when \n" + "then \n" + "system.out.println(\"rule_1 fired\"); \n" + "end"; kfs.write("src/main/resources/rules/generatedrule.drl", rule); kiebuilder kb = ks.newkiebuilder(kfs).setdependencies(kmodule).buildall(); 

when run program, cannot find generated rule in rule directory project in business central.

thank you


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -