You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Justin Stewart <ju...@lmco.com> on 2007/08/10 18:21:25 UTC

Question: servicemix-drools with route/modify

Hi, all.
I'm feeding an XML message into a drools service-unit, which acts as a
routing engine.

If a piece of the XML message is missing, I have a rule (number 1) that will
route the message to a service that will fill it in.  The message should
then be re-evaluated by the rules.  Since the missing piece is filled in,
other rules will fire (including number 2 as shown).  I expect that I should
be able to do this through the following on a "then" clause:

rule "Rule number 2"
	when
		me : Exchange( status == Exchange.ACTIVE, in : in != null )
		eval( in.xpath("//*[local-name() = 'TheMissingPart']") )
	then
		jbi.route("service:urn:CompletionService");
end

rule "Rule number 1"
	when
		me : Exchange( status == Exchange.ACTIVE, in : in != null )
		eval(!( in.xpath("//*[local-name() = 'TheMissingPart']") ))
	then
		jbi.route("service:urn:MissingPartService");
		modify(me);
end

The missing part is being filled in by the MissingPartService, but the rules
are never re-executed on the new message exchange, which I figured should
happen using the "modify(me)" call.
Can anyone shed light on this issue?

Thanks.
Justin
-- 
View this message in context: http://www.nabble.com/Question%3A-servicemix-drools-with-route-modify-tf4249723s12049.html#a12094551
Sent from the ServiceMix - User mailing list archive at Nabble.com.