[rules-users] KnowledgeAgent: impossible to add a map for a null resource! skiping.

anikulin antonnik94 at gmail.com
Mon Feb 25 12:30:45 EST 2013


Yes, I use SwitchYard in this project, but I don't think that it causes this
problem, cause I didn't use custom switchyard's realization for drools, but
wrote it by myself.

I really used changeset when i started an example as standalone application,
and it was working because i deployed guvnor and application to different
servers.

Are there any differences between implementation of loading resources in
KnowledgeBuilder and KnowledgeAgent? Cause this part of code works fine:

Resource r = ResourceFactory.newClassPathResource("ChangeSet.xml");
KnowledgeBuilder builder = KnowledgeBuilderFactory
				.newKnowledgeBuilder();
builder.add(r, ResourceType.CHANGE_SET);

and this one doesn't

Resource r = ResourceFactory
		 .newClassPathResource("ChangeSet.xml");
KnowledgeAgentConfiguration aconf = KnowledgeAgentFactory
		 .newKnowledgeAgentConfiguration();
aconf.setProperty("drools.agent.scanDirectories", "true");
aconf.setProperty("drools.agent.scanResources", "true");
aconf.setProperty("drools.agent.newInstance", "true");
kagent = KnowledgeAgentFactory.newKnowledgeAgent("changeSetAgent",
		aconf);
kagent.applyChangeSet(r);

Thanks, Anton



--
View this message in context: http://drools.46999.n3.nabble.com/KnowledgeAgent-impossible-to-add-a-map-for-a-null-resource-skiping-tp4022425p4022578.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list