This content has been marked as final.
Show 3 replies
-
1. Re: Content based routing based on message property
beve Dec 26, 2008 5:39 AM (in response to ashok_1979)Hi,
something like this should work:#list any import classes here. import org.jboss.soa.esb.message.Message; import org.jboss.soa.esb.message.Properties; #declare any global variables here global java.util.List destinations; rule "FTPService Rule" when m : Message () props : Properties() from m.getProperties() eval(props.getProperty("CommunicationMode").equals("FTP")) then destinations.add("FTPService"); end
regards,
/Daniel -
2. Re: Content based routing based on message property
ashok_1979 Dec 28, 2008 11:53 PM (in response to ashok_1979)Thanks a ton beve,
It worked :-)
This is my final code#created on: Oct 30, 2006 package com.jboss.soa.esb.routing.cbr #list any import classes here. import org.jboss.soa.esb.message.Message; import org.jboss.soa.esb.message.Properties; #declare any global variables here global java.util.List destinations; rule "FTPService Rule" when m : Message() props : Properties() from m.getProperties() eval(props.getProperty("CommunicationMode").equals("FTP")) then System.out.println("#########Inside FTPService Rule#########"); destinations.add("FTP-destination"); end rule "SMTPService Rule" when m : Message() props : Properties() from m.getProperties() eval(props.getProperty("CommunicationMode").equals("SMTP")) then System.out.println("#######Inside SMTPService Rule#########"); destinations.add("SMTP-destination"); end
I have one question
"Where can i found some good documents to understand the syntax of Drools?"
i had searched on web but couldn't find any good document. -
3. Re: Content based routing based on message property
beve Dec 29, 2008 1:15 AM (in response to ashok_1979)Great, glad to hear that it worked!
Where can i found some good documents to understand the syntax of Drools
This can be found in the Drools user guide : http://www.jboss.org/drools/documentation.html
regards,
/Daniel