[rules-users] Fire specific rules deployed in guvnor that reside in the same package

ciberg2 joaoguerra72 at gmail.com
Tue Apr 9 12:54:12 EDT 2013


Hi, I have Guvnor running with a package that has several BPMN processes and
now I'm adding rules to it.

The rules are made in Excel files and built into the package.

I have a web application in JAVA that fires the rules and if I have only one
rule in the package it works fine.
But if I deploy more than one rule to the package the result is a list with
the result of applying the input to all the rules that exist in the package.

I tried using this as URL with no success, drools applies the input to all
the rules in the package:
http://127.0.0.1:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/merap/LATEST/rule1

How should I organize the rules? One package for each? It doesn't seem a
good solution to me. 
Is it possible to fire only a specific rule? If yes, how?

I use this code:
   public static KnowledgeBase readKnowledgeBase()
	    throws Exception {
	UrlResource resource = (UrlResource) ResourceFactory
	
.newUrlResource("http://127.0.0.1:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/myPackage/LATEST");
	resource.setBasicAuthentication("enabled");
	resource.setUsername("guest");
	resource.setPassword("guest");
	KnowledgeBuilder kbuilder = KnowledgeBuilderFactory
		.newKnowledgeBuilder();
	kbuilder.add(resource, ResourceType.PKG);
	KnowledgeBase kbase = kbuilder.newKnowledgeBase();
	kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
	return kbase;
    }


Thank you



--
View this message in context: http://drools.46999.n3.nabble.com/Fire-specific-rules-deployed-in-guvnor-that-reside-in-the-same-package-tp4023266.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list