<!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 text="#000000" bgcolor="#ffffff">
Am 30.05.2011 13:52, schrieb Küng Sabrina:
<blockquote
cite="mid:AED21423F4C7054AA86A199405DBB14D014E8800FDD9@GESMAILEVS4.skyguide.corp"
type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<meta name="GENERATOR" content="MSHTML 8.00.6001.19046">
<div><span class="725554911-30052011"><font size="2" face="Arial">Hello</font></span></div>
<div><span class="725554911-30052011"></span> </div>
<div><span class="725554911-30052011"><font size="2" face="Arial">How
can I write a rule, that can be used in several other
packages resp. rulesets without copying the code?</font></span></div>
</blockquote>
<br>
Hi Sabrina,<br>
<br>
the basic solution is to pre-compile the rule into a *.pkg file and
load this file into any number of KnowledgeBase instances, then
execute your sessions against the respective knowledge base(s). If
you want to use declared types from a shared source code file, make
sure to compile them into a binary and always load them from this
single binary, since AFAICT otherwise the underlying java beans will
belong to different ClassLoaders and thus lead to problems (AFAICT)
at runtime.<br>
<br>
I'm working on a maven plugin which supports binary reuse of drools
rules, plus automatic dependency resolution between JARs and
pre-compiled knowledge modules. <br>
<br>
The web site for this plugin is located here, but is currently
really out of date: <a
href="http://passion.forco.de/content/maven-drools-plugin">http://passion.forco.de/content/maven-drools-plugin</a><br>
<br>
A working plugin should be available shortly, and of course
documentation will be updated accordingly. You might want to
bookmark this page or subscribe to the RSS feed.<br>
<br>
Best regards<br>
<br>
Ansgar<br>
<br>
<br>
<blockquote
cite="mid:AED21423F4C7054AA86A199405DBB14D014E8800FDD9@GESMAILEVS4.skyguide.corp"
type="cite">
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
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>