kfs2(a)chryslerfinancial.com wrote:
Part of the reason we are using rules is the flexibility. Mainly we
can deploy changes to the rules without redeploy the whole
application. We are populating the fact model by using work items in
the flow that hit the database. The problem I see here is that this
is not flexible as the java code for the work items is not in the rule
package.
Can java code be included in the rule package somehow? Or should we
just dynamically load a separate jar? I rather have the rules and
java code all in one package.
There is no public api for this, but it's
possible for you to hack
something if you like, but you'd have to get dirty. There are two ways.
If you look at how we compile JAXB generated classes using XJC, it shows
how you can compile .java code
http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-pipeline/drool...
Specifically this part:
JavaDialect dialect = (JavaDialect) pkgReg.getDialectCompiletimeRegistry().getDialect(
"java" );
dialects.add( dialect );
dialect.addSrc( convertToResource( entry.getKey() ),
That .java code will then be compiled to .class and be contained inside the Package.
Mark
Thanks
Kent Symanzik
------------------------------------------------------------------------
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users