<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">It is supported, but you must be
careful when you compile the DRL resources. <br>
You will have to compile the declares first and ensure that the
classloader is set correctly.<br>
The easiest way to achieve this is to use the
CompositeKnowledgeBuilder:<br>
<br>
<font face="monospace">KnowledgeBuilder kbuilder =
KnowledgeBuilderFactory.newKnowledgeBuilder();<br>
kbuilder.batch()<br>
.add( ResourceFactory.newByteArrayResource(
declares.getBytes() ), ResourceType.DRL )<br>
.add( ResourceFactory.newByteArrayResource(
rules.getBytes() ), ResourceType.DRL )<br>
.build();<br>
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();<br>
kbase.addKnowledgePackages(
kbuilder.getKnowledgePackages() );</font><br>
<br>
Adjust the number and type of resources as needed.<br>
<br>
Notice that this feature is only available in more recent
versions. If you want/need to use<br>
an older one, could you please specify which version and post the
snippet of code<br>
you are using to build the KB?<br>
Thanks!<br>
<font face="monospace"><br>
</font>Davide<br>
<br>
<br>
On 12/18/2013 05:40 PM, wtang wrote:<br>
</div>
<blockquote cite="mid:1387413651817-4027359.post@n3.nabble.com"
type="cite">
<pre wrap="">I have a .drl rule file with many declare in it to define my own types. I
compile this file every time. I want to separate the declare types out of
its own file since the types don't change and just leave the rules in the
original .drl file.
I create my own declares.drl and pulled all the declare from the rule.drl
file and inside the rule.drl file I just did import. While my declares.drl
file compile with no errors, I am getting types not resolve error from my
.drl file event thought I have the import.
Does drool support the separation of types into its own file and rule file
just refer to those declared types?
--
View this message in context: <a class="moz-txt-link-freetext" href="http://drools.46999.n3.nabble.com/separating-drl-declare-type-from-actual-drl-rule-into-each-own-file-tp4027359.html">http://drools.46999.n3.nabble.com/separating-drl-declare-type-from-actual-drl-rule-into-each-own-file-tp4027359.html</a>
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
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>