Using JBoss Rules (Drools) with XML


General J2EE: Using JBoss Rules (Drools) with XML

  1. Using JBoss Rules (Drools) with XML (1 messages)

    Hi guys, I have a current requirement to build a reasonably scalable messaging system using a proprietary binary format. The binary format is structured very much like XML, so I figured that for communication up my application stack I could pass the XML document (so I can do XQuery/XPath evaluations etc.). The format comes with a large number of "business rules" that must be validated in addition to the message format (schema) itself. I think that using a library such as JBoss Rules (Drools) would be a good choice as it allows me to change these rules as they come in without requiring a compilation. Does anybody have any experience, or know if it is possible to evaluate Drools rules against an XML document, or if it only works on POJO's? I have been surfing the documentation and can't find any reference to the ability to execute rules based on an XML document, however I just thought I would ask. If it only works on POJO's, does anybody know of another similar tool that will perform business rule validation on an XML documentm, or am I better off building this from scratch (and releasing it as Open Source)? Also, to satisfy my application requirements I need to be able to wire together different "pluggable" parts of the system depending on how the customer chooses to deploy the software. I was considering using a product like jBPML (the work flow engine from JBoss), but again need to know if it works with XML documents, or only POJOS. If neither of these work on POJO's I am willing to consider using an XML -> Object mapping tool such as Castor or JAXB but I am worried about the impact this will have on performance. The alternative is of course to read the binary directly into Objects and skip the XML intermediary step, however then I loose the openness of sending XML over the wire between my application (meaning a deployment nighmare when it comes to versioning, and effectively creating another "proprietary" protocol). Has anybody had any experience building a system to similar requirements that could offer me any advice? This is my first project where I am the design lead, and although the combination of XML, Drools and jBPML appears to give me a great amount of flexibility in my deployments, I'm not 100% confident with the idea. Thank you very much for your time, Aidos

    Threaded Messages (1)

  2. SXC[ Go to top ]

    Checkout SXC it is a pluggeable fast XML parser with a Drools module: This allows you to write rules like this: rule "AddresTest" when event : XPathEvent( expression == "/order/address[@country]" ); then System.out.println("Success! - " + drools.getRule().getName()); end SXC uses an old version of Drools, we have just released 4.0.1, so hopefully the SXC team will update soon: Mark