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

ciberg2 joaoguerra72 at gmail.com
Wed Apr 10 10:34:10 EDT 2013


I managed to get it working thanks to your (precious) help.

I ended up with this code (I put it here so it can help someone in the
future):
    public static KnowledgeBase readKnowledgeBase(String decisionTable)
	    throws Exception {
	UrlResource resource = (UrlResource) ResourceFactory
	
.newUrlResource("http://localhost:8080/drools-guvnor/rest/packages/myPackage/assets/decisiontable1/binary");
	resource.setBasicAuthentication("enabled");
	resource.setUsername("guest");
	resource.setPassword("guest");
	KnowledgeBuilder kbuilder = KnowledgeBuilderFactory
		.newKnowledgeBuilder();
	kbuilder.add(resource, ResourceType.DTABLE);
	KnowledgeBase kbase = kbuilder.newKnowledgeBase();
	kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
	return kbase;
    }

Changed the URL to
http://localhost:8080/drools-guvnor/rest/packages/myPackage/assets/decisiontable1/binary
and ResourceType to DTABLE.

In my real implementation the name of the asset will be a variable of
course.



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


More information about the rules-users mailing list