Could you really compile that rule with "return($step)" as its last statment? Rule bodies result in void methods, so...<br><br>Anyway, you'll need to provide an "out" identifier with the "insert" command to get the inserted object back in your results:<br>
<insert out-identifier="TheFirstStep"><br><br>The CommandFactory provides a separate call for that.<br><br>-W<br><br><div class="gmail_quote">On 22 July 2011 23:52, lhorton <span dir="ltr"><<a href="mailto:LHorton@abclegal.com">LHorton@abclegal.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I am new to calling Rest services and using drools-server. I configured the<br>
camel-server.xml and knowledge-services.xml rest service to use xstream<br>
marshalling, added my rules and pojo model to the war, and deployed it on<br>
tomcat. I wrote a java http client to run the rest service. This is the<br>
batch command that I'm sending:<br>
<br>
<set-global identifier="logger"><br>
<org.apache.commons.logging.impl.Log4JLogger><br>
<br>
<name>com.abclegal.rules.integration.StatusChangeTestIntegration</name><br>
</org.apache.commons.logging.impl.Log4JLogger><br>
</set-global><br>
<insert><br>
<com.abclegal.domain.step.VenueValidationStep><br>
<id>0</id><br>
<parentTaskId>0</parentTaskId><br>
<status>PENDING</status><br>
<activatable>false</activatable><br>
<abortable>false</abortable><br>
<completable>false</completable><br>
</com.abclegal.domain.step.VenueValidationStep><br>
</insert><br>
<fire-all-rules/><br>
</batch-execution><br>
<br>
this is the rule:<br>
<br>
rule "Activate VenueValidationStep"<br>
dialect "mvel"<br>
when<br>
$step : VenueValidationStep(activatable == false, status ==<br>
Status.PENDING)<br>
then<br>
logger.debug("activating VenueValidationStep");<br>
modify($step) {<br>
setActivatable(true),<br>
setStatus(Status.ACTIVE);<br>
};<br>
return($step);<br>
end<br>
<br>
when I run the client, I can see on the server log that the global was set<br>
and the correct rule is running (it writes to the log using the global<br>
logger), and i get a 200 response on the http post. However, the response<br>
body is empty except for the enclosing xml tags. it contains only:<br>
<br>
<?xml version='1.0' encoding='UTF-8'?><execution-results/><br>
<br>
The behaviour I would like to happen is that the modified $step would be<br>
returned from the http post.<br>
<br>
Apologies if this is another dumb noob question - I hope it's just something<br>
simple I've missed. thanks for the help.<br>
<font color="#888888"><br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/drools-server-empty-response-body-tp3192475p3192475.html" target="_blank">http://drools.46999.n3.nabble.com/drools-server-empty-response-body-tp3192475p3192475.html</a><br>
Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</font></blockquote></div><br>