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