Drools & Guvnor 使用心得

Step:

1. New Package

2. Upload POJO Model jar(remove unused imported types)

3. New Rule(I have tested business rule/technical rule)

4. Create snapshot for deployment, enter "TestDrl"

 

  1)直接调用Guvnor的URL

  KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
  UrlResource urlResource = (UrlResource) ResourceFactory.newUrlResource("http://localhost:8080/guvnor-5.5.0.Final-tomcat-6.0/org.drools.guvnor.Guvnor/package/org.sample/TestDrl");
  urlResource.setBasicAuthentication("enabled");
  urlResource.setUsername("admin");
  urlResource.setPassword("admin");
  kbuilder.add(urlResource, ResourceType.PKG);

 2) 先下载binary package,然后在文件系统中引用

kbuilder.add(ResourceFactory.newFileResource("d:\\org.sample.pkg"), ResourceType.PKG);

 

Drools & Guvnor 使用心得_第1张图片

你可能感兴趣的:(Java)