Re: [rules-users] Challenge! Using javassist and drools presents an issue with drl
It sounds like the stated goal is to make things easier for non-developers to write rules. What about a dsl? What about using a templating language? I have used velocity in the past for dynamically generating rules based on templates, and I think that there is built in support for templates using mvel. -Original Message- >From: markricard >Sent: Apr 28, 2010 11:53 AM >To: rules-users@lists.jboss.org >Subject: Re: [rules-users] Challenge! Using javassist and drools presents an >issue with drl > > >Perhaps there is an easier way to ask this question > >Rather than having to do an 'import' of a class in a drl text file, is there >a way in the Java code that constructs the KnowledgeBase to via java >dynamically import any class file required by any drl file that is added? > >Instead of the drl having: > >import com.foo.Instance; >rule "Walgreens Test" > > >It just has: > >rule "Walgreens Test" > > > >And in the KnowledgeBuilder does something like this: > >KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(); >kbuilder.addImport("com.foo.Instance"); >... > > > >-- >View this message in context: >http://drools-java-rules-engine.46999.n3.nabble.com/Challenge-Using-javassist-and-drools-presents-an-issue-with-drl-tp763086p763118.html >Sent from the Drools - User mailing list archive at Nabble.com. >___ >rules-users mailing list >rules-users@lists.jboss.org >https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Creating drools rules porgramatically?
Malay, We've been doing something similar to what you are asking for, but using the rule syntax as an intermediate step. We have a datamodel that users can use to express the rules, and we have a templating engine that turns that into the drools syntax. This then gets compiled into packages and built into a rule base. This has worked rather well for us, as it allows us to make updates to logic on the fly by changing the templates. -- Dave -Original Message- >From: Malay Shah >Sent: Jun 17, 2009 12:36 PM >To: rules-users@lists.jboss.org >Subject: [rules-users] Creating drools rules porgramatically? > > >Hi, > >I am looking to create the drools Rule objects programatically, and I >believe there is API to do that in 4.0.7. But, the API looks complex and the >documentation is not sufficient. Could anyone please point me to some >examples of doing this? I basically don't want to write rules in .drl files, >but have a database store the rules and make them strongly typed (by >generating Rule Objects directly from DB). Any help is much appreciated. > >Thanks >Malay > >-- >View this message in context: >http://www.nabble.com/Creating-drools-rules-porgramatically--tp24077426p24077426.html >Sent from the drools - user mailing list archive at Nabble.com. > >___ >rules-users mailing list >rules-users@lists.jboss.org >https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users