[rules-users] Dynamic work items
Mark Proctor
mproctor at codehaus.org
Fri Feb 13 17:09:46 EST 2009
kfs2 at 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/drools-transformer-jaxb/src/main/java/org/drools/runtime/pipeline/impl/DroolsJaxbHelperProviderImpl.java
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 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/20090213/3ca7af1c/attachment.html
More information about the rules-users
mailing list