[rules-users] How to use "from" CE in XML format of rules?

Edson Tirelli tirelli at post.com
Wed Mar 21 16:41:00 EDT 2007


   Kioumars,

   The target is to support round-trip between all supported syntaxes. 
It means that "from" should be supported in the XML format too. It was 
simply not implemented yet.
   May I ask you please to open a JIRA for that, just to make sure it is 
not forgotten?

   Also, this is a very easy task, in case someone wants to contribute. 
I guess it is about 4 hours work including test cases for someone that 
does not know the code. It is just a matter of updating the XSD, adding 
one ContentHandler for the "from" CE parsing, and a method to the 
XMLDumper to dump back. All the core functionality is implemented already.

    []s
    Edson


qmars765 at gmx.de wrote:

>Dear list,
>
>I am using 3.1M Release and use the new “from” CE: I invoke a DAO to determine some values from Backend used in the rule: 
>
>rule ” At least 3 RFQs for material type 1”	 
>
>when
>		$pr: PurchaseRequest(materialType == "1", currentStatus == PurchaseRequestStatus.PRE_APPROVE)
>		$dao : PurchaseRequestFacade()		
>		$rfqs: Integer(intValue < 3) from $dao.getRFQsFor($pr)		
>then
>	blockedPRs.add($pr);
>end
>
>So far everything works great, but 
>
>unfortunately I need to have the rules in XML format: the XML Rules will be modified via WEB-UI by Business-Users using XMLBeans API in the WEB-Application. I like the DRL format more and write initially the rules first in DRL and then use the XMLDumper-Class statically to generate the XML Version of the rules. But while converting from DRL to XML, I get following error message for the above rule when parsing "from" CE:
>
>no visitor implementation for : class org.drools.lang.descr.FromDescr : org.drools.lang.descr.FromDescr at 176cad3
>
>
>Is “from” CE not supported in XML format? I just need the above rule in XML, but I don’t know how to write it? I also checked the XSD in the 3.1M release jar distribution, but there is stil the old version of the XSD without the "from" CE. 
> 
>Alternatively if “from” is not supported yet in XML at all, is it a way to formulate the above rule alternatively without “from” without changing the application design too much? 
>
>Or is it a way to manage the rules and their design/parameters in LHS (read, write, modify) in DRL-Format via API? This would be actually my favorite solution :-) I read quickly over the planned Drools BRMS-Blog, But not sure If I can use the BRMS to build a WEB Application on top of it for managing the design of rules?
>
>Many thanks in advance for your help,
>
>Kioumars 
>
>
>  
>


-- 
 Edson Tirelli
 Software Engineer - JBoss Rules Core Developer
 Office: +55 11 3124-6000
 Mobile: +55 11 9218-4151
 JBoss, a division of Red Hat @ www.jboss.com





More information about the rules-users mailing list