<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<a class="moz-txt-link-abbreviated" href="mailto:kfs2@chryslerfinancial.com">kfs2@chryslerfinancial.com</a> wrote:
<blockquote
cite="mid:OF1E787492.CF3D06F2-ON8525755C.0065738C-8525755C.006721EE@wkamerica.notes.chrysler.com"
type="cite"><br>
<font face="sans-serif" size="2">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. </font>
<br>
<br>
<font face="sans-serif" size="2">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.</font>
<br>
</blockquote>
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.<br>
If you look at how we compile JAXB generated classes using XJC, it
shows how you can compile .java code<br>
<a class="moz-txt-link-freetext" href="http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-pipeline/drools-transformer-jaxb/src/main/java/org/drools/runtime/pipeline/impl/DroolsJaxbHelperProviderImpl.java">http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-pipeline/drools-transformer-jaxb/src/main/java/org/drools/runtime/pipeline/impl/DroolsJaxbHelperProviderImpl.java</a><br>
<br>
Specifically this part:<br>
<pre>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
</pre>
<blockquote
cite="mid:OF1E787492.CF3D06F2-ON8525755C.0065738C-8525755C.006721EE@wkamerica.notes.chrysler.com"
type="cite"><br>
<font face="sans-serif" size="2">Thanks </font>
<br>
<br>
<font face="sans-serif" size="2">Kent Symanzik<br>
</font>
<pre wrap="">
<hr size="4" width="90%">
_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
</blockquote>
<br>
</body>
</html>