[rules-users] Drools server link to Guvnor repository

SebRR sebastien.raickman at gmail.com
Tue Mar 15 06:02:43 EDT 2011


Hi all,

I would like to connect to drools-server with HTTPClient with the following
config:






	
	
	
	    
            
								
	
	
		




where my changeset.xml is adding a snapshot deployed with Guvnor.

But I am not able to trig the rule with the following client:

BatchExecutionCommandImpl command = new BatchExecutionCommandImpl();
command.setLookup("ksession1");
InsertObjectCommand insertObjectCommand = new InsertObjectCommand("TEST");
FireAllRulesCommand fireAllRulesCommand = new FireAllRulesCommand();
command.getCommands().add(insertObjectCommand);
command.getCommands().add(fireAllRulesCommand);

String xml = BatchExecutionHelper.newXStreamMarshaller().toXML(command);

HttpClient httpClient = new HttpClient();
httpClient.getHostConfiguration().setHost("host", 8080);

PostMethod postMethod = new
PostMethod("/drools-5.1.1-server/kservice/rest/execute");
postMethod.setRequestEntity(new StringRequestEntity(xml, null, null));


try {

       httpClient.executeMethod(postMethod);
       int code = postMethod.getStatusCode();
       System.out.println(code);
       String rep = postMethod.getResponseBodyAsString();
       System.out.println(rep);

} catch(Exception e) {...}

Do someone have any idea how to achieve this?

Thanks

Sebastien


--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-server-link-to-Guvnor-repository-tp2681116p2681116.html
Sent from the Drools - User mailing list archive at Nabble.com.



More information about the rules-users mailing list