This is not a Drools problem, however...<br><br>You are using a Domain Specific Language (DSL) to transform rules into Drools Rule Language (DRL). If you have written the DSL you should know how it works; if you haven&#39;t, then there should be a documentation telling you what the parameters of<br>
   xpathEquals  &quot;/IATA/messageaudit/@messageVersion&quot; &quot;FSU/13/RCS&quot;<br>mean, and this would immediately solve your problem. If you had that documentation (why don&#39;t you have it?), it would say that the first parameter is an XPath expression and the second a value to match at the location the first expression identifies. <br>
<br>Now, when you use SW using XPath with XML, you should know the basics about XPath. If you don&#39;t - w3c has some good tutorials, see the one on XPath, <a href="http://www.w3schools.com/xpath/default.asp">here</a>.<br>
<br>The XPath used denotes an attribute and therefore your rules will only work if messageVersion is an attribute of the element /IATA/messageaudit. In the second XML, all values are elements below that element.<br><br>-W<br>
<br><div class="gmail_quote">On 23 April 2011 11:39, annukaila <span dir="ltr">&lt;<a href="mailto:annu.sifu@gmail.com">annu.sifu@gmail.com</a>&gt;</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;">
Hi<br>
<br>
iam new to drools rules my problem is<br>
<br>
<br>
iam receiving message in xml format so using drools have to route it my<br>
drools rules work when the xml message is the format as below<br>
<br>
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br>
&lt;IATA&gt;<br>
&lt;messageaudit senderId=&quot;125&quot; receiverId=&quot;FFCategory&quot;<br>
dateTimeOfMessage=&quot;19:00&quot;<br>
messageVersion=&quot;FSU/13/RCS&quot; airwaybill=&quot;125-1234565&quot; /&gt;<br>
&lt;fsurcs AwbNumber=&quot;125-1234565&quot; origin=&quot;HYD&quot; destination=&quot;KUL&quot;<br>
totalPieces=&quot;T40&quot; totalWeight=&quot;K200&quot;<br>
statusCodeConsignmentRecieveDFromShipperOrAgent=&quot;RCS&quot;<br>
dayAndMonthOfReceipt=&quot;02June&quot; actualTimeOfGivenStatusEvent=&quot;19:00&quot;<br>
airportCodeOfReceipt=&quot;HYD&quot;<br>
totalOrPartNumberOfPices=&quot;T40&quot; weightOfTotalOrPartOfPieces=&quot;K200&quot;<br>
nameOfAgentOfShipper=&quot;Shipper&quot; osi=&quot;RcsMessage&quot;/&gt;<br>
&lt;/IATA&gt;<br>
<br>
but if the xml is the format as below<br>
<br>
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br>
&lt;IATA&gt;<br>
&lt;messageaudit&gt;<br>
&lt;senderId&gt;125&lt;/senderId&gt;<br>
&lt;receiverId&gt;FFCategory&lt;/receiverId&gt;<br>
&lt;dateTimeOfMessage&gt;19:00&lt;/dateTimeOfMessage&gt;<br>
&lt;messageVersion&gt;FSU/13/RCS&lt;/messageVersion&gt;<br>
&lt;airwaybill&gt;125-1234565&lt;/airwaybill&gt;<br>
&lt;/messageaudit&gt;<br>
&lt;fsurcs&gt;<br>
&lt;AwbNumber&gt;125-1234565&lt;/AwbNumber&gt;<br>
&lt;origin&gt;HYD&lt;/origin&gt;<br>
&lt;destination&gt;KUL&lt;/destination&gt;<br>
&lt;totalPieces&gt;T40&lt;/totalPieces&gt;<br>
&lt;totalWeight&gt;K200&lt;/totalWeight&gt;<br>
&lt;statusCodeConsignmentRecieveDFromShipperOrAgent&gt;RCS&lt;/statusCodeConsignmentRecieveDFromShipperOrAgent&gt;<br>
&lt;dayAndMonthOfReceipt&gt;02June&lt;/dayAndMonthOfReceipt&gt;<br>
&lt;actualTimeOfGivenStatusEvent&gt;19:00&lt;/actualTimeOfGivenStatusEvent&gt;<br>
&lt;airportCodeOfReceipt&gt;HYD&lt;/airportCodeOfReceipt&gt;<br>
&lt;totalOrPartNumberOfPices&gt;T40&lt;/totalOrPartNumberOfPices&gt;<br>
&lt;weightOfTotalOrPartOfPieces&gt;K200&lt;/weightOfTotalOrPartOfPieces&gt;<br>
&lt;nameOfAgentOfShipper&gt;Shipper&lt;/nameOfAgentOfShipper&gt;<br>
&lt;osi&gt;RcsMessage&lt;/osi&gt;<br>
&lt;/fsurcs&gt;<br>
&lt;/IATA&gt;<br>
<br>
<br>
it is not routing the message means not recognizing the drools and my drools<br>
file is as follows<br>
<br>
package com.jboss.soa.esb.routing.cbr<br>
<br>
#list any import classes here.<br>
import org.jboss.soa.esb.message.Message;<br>
import org.jboss.soa.esb.message.format.MessageType;<br>
<br>
expander XPathLanguage.dsl<br>
<br>
#declare any global variables here<br>
global java.util.List destinations;<br>
<br>
rule &quot;Blue Routing Rule using XPATH&quot;<br>
        when<br>
                xpathEquals  &quot;/IATA/messageaudit/@messageVersion&quot; &quot;FSU/13/RCS&quot;<br>
        then<br>
            Log : &quot;Blue Team&quot;;<br>
                Destination : &quot;blue&quot;;<br>
end<br>
<br>
rule &quot;Red Routing Rule using XPATH&quot;<br>
        when<br>
                xpathEquals  &quot;/IATA/messageaudit/@messageVersion&quot; &quot;FSU/13/MAN&quot;<br>
        then<br>
             Log : &quot;Red Team&quot;;<br>
                Destination : &quot;red&quot;;<br>
end<br>
<br>
rule &quot;Green Routing Rule using XPATH&quot;<br>
        when<br>
                xpathEquals  &quot;/IATA/messageaudit/@messageVersion&quot; &quot;FSU/13/DEP&quot;<br>
        then<br>
             Log : &quot;Green Team&quot;;<br>
                Destination : &quot;green&quot;;<br>
end<br>
<br>
<br>
<br>
please help me hoe to rectify this its very urgent for me and please dnt<br>
mind if i did any mistakes<br>
<br>
<br>
thanku<br>
<font color="#888888"><br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/Drools-rules-tp2854688p2854688.html" target="_blank">http://drools.46999.n3.nabble.com/Drools-rules-tp2854688p2854688.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>