[rules-users] How to convert .drl file to XML ...

Michael Anstis michael.anstis at gmail.com
Tue Oct 11 06:42:17 EDT 2011


Any particular XML schema?

The simplest answer would be to wrap your package DRL into an XML element:-

<package>
package com.rules
import com.model.Bank;

rule "Your First Rule"

        when
                $b1:Bank(name=="Manohar", accntno=="533")
        then

                $b1.setBalance(5000);
                $b1.setDeposit($b1.getBalance()+1000);

end

rule "Your Second Rule"

        when
                $b1:Bank(name=="Ajay", accntno=="536")
        then


                $b1.setBalance(6000);
                $b1.setDeposit($b1.getBalance()+2000);

end
</package>

I suspect however you are after a little more?

With kind regards,

Mike

2011/10/11 Manohar Kokkula <manohar.kokkula at tcs.com>

> Hi All!
>
> I'm trying to convert a .drl file to xml
> But im not sure how to approach for this,
> Please help me regarding the same.
> *Here is my drl file:*
>
> package com.rules
> import com.model.Bank;
>
> rule "Your First Rule"
>
>         when
>                 $b1:Bank(name=="Manohar", accntno=="533")
>         then
>
>                 $b1.setBalance(5000);
>                 $b1.setDeposit($b1.getBalance()+1000);
>
> end
>
> rule "Your Second Rule"
>
>         when
>                 $b1:Bank(name=="Ajay", accntno=="536")
>         then
>
>
>                 $b1.setBalance(6000);
>                 $b1.setDeposit($b1.getBalance()+2000);
>
> end
>
>
>
>
>
> Thanks and Regards
> Manohar Kokkula
> Mailto: manohar.kokkula at tcs.com
>
> =====-----=====-----=====
> Notice: The information contained in this e-mail
> message and/or attachments to it may contain
> confidential or privileged information. If you are
> not the intended recipient, any dissemination, use,
> review, distribution, printing or copying of the
> information contained in this e-mail message
> and/or attachments to it are strictly prohibited. If
> you have received this communication in error,
> please notify us by reply e-mail or telephone and
> immediately and permanently delete the message
> and any attachments. Thank you
>
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20111011/c4220ec0/attachment.html 


More information about the rules-users mailing list