[rules-users] query regarding drl to xml conversion...
Mark Proctor
mproctor at codehaus.org
Wed Apr 11 09:15:35 EDT 2007
Niloy,
I suggest you make a drl first and then look at the AST it creates in
memory and then make sure that the programmatic descr tree you are
making matches that.
Mark
Niloy Debnath wrote:
> hi,
>
> I'm going to convert a PackageDescr object which has the rules to
> XML file.I'm trying to convert it into xml using dump method of
> XmlDumper class. The problem with that is while the rest of the code
> is fine i cannot get the lhs part. There is no method in fact as far
> as i know to actually specify the lhs. The setLhs method does not help
> in this regard. I tried to construct all the parameters ususally
> specified in the lhs like the ColumnDescr object and FieldBinding
> object but there is no way to bind these to the PackageDescr object.
> So the lhs is coming out as null while the rest of the code is fine
> ...even the rhs..
>
> I am attaching the code and the output again. please go through and
> advise.
>
> thanking you,
>
> Niloy Debnath
> student(comp sc & engg)
>
>
>
> *
> OUTPUT OF TEST2 :*
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <package name="org.drools.examples"
> xmlns="http://drools.org/drools-3.0"
> xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
> xs:schemaLocation="http://drools.org/drools-3.0 drools-3.0.xsd">
> <import name="org.drools.examples.Hell.Message" />
>
> <rule name="Hell">
> <lhs>null
> null
> </lhs><rhs>System.out.println( message );m.setMessage( "Goodbye cruel
> world " );m.setStatus( Message.GOODBYE );modify( m );</rhs>
> </rule><rule name="Good">
> <rule-attribute name="activation-group" value="dekhajak" />
> <lhs><rule-attribute name="activation-group" value="dekhajak" />
> <rule-attribute name="activation-group" value="dekhajak" />
>
> </lhs><rhs>System.out.println( message ); m.setMessage( message );</rhs>
> </rule>
> </package>
> no visitor implementation for : class
> org.drools.lang.descr.PatternDescr :
> org.drools.lang.descr.PatternDescr at 14318bb
> no visitor implementation for : class
> org.drools.lang.descr.PatternDescr :
> org.drools.lang.descr.PatternDescr at 14318bb
> no visitor implementation for : class
> org.drools.lang.descr.PatternDescr :
> org.drools.lang.descr.PatternDescr at 14318bb
> no visitor implementation for : class
> org.drools.lang.descr.PatternDescr :
> org.drools.lang.descr.PatternDescr at 14318bb
>
> ------------------------------------------------------------------------
> Check out what you're missing if you're not on Yahoo! Messenger
> <http://us.rd.yahoo.com/mail/in/ymessenger/*http://in.messenger.yahoo.com/>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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/20070411/686b4750/attachment.html
More information about the rules-users
mailing list