<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Wolfgang,</div><div><br></div>Ok maybe I'm misunderstanding what .package is indented for. Yes I understand how to deserialize a binary serialization of a KnowledgePackage. Let me explain the problem and what I'm trying to solve.&nbsp;<div><br></div><div>The case is that we have rules spread out between many files (not known until run time, these are then serialized and cached based on run keys and reused). Note too that these files have a precedence order from a programming perspective, not from a run perspective. The problem is in adding declared types to be used by these rule sets at a lower level rule (e.g. one that is more generic and more core). Then we put in a set of specialization rules that also need to use this declared type, sometimes this works but sometimes this won't compile because it says the type is not declared. In eclipse we found that if we put a .package file with the declared type in it then this specialization rule set compiles however we can't figure out how to propagate this into the runtime KnowledgeBase. It sounds like what your saying is that I made a wrong assumption. Is this kind of thing not possible? Is there a different mechanism for these generic types besides having them as pre-compiled java POJO's?</div><div><br></div><div><b>Example Rules Source:</b></div><div>I have a <i>blah.drl</i> like the following</div><div><div style="margin: 0px; font-size: 11px; font-family: Monaco; "><div style="margin: 0px; color: rgb(169, 21, 0); ">package<span style="color: #000000"> com.x</span></div><div style="margin: 0px; min-height: 15px; "><br></div><div style="margin: 0px; color: rgb(0, 143, 0); "><span style="color: #a91500">rule</span><span style="color: #000000"> </span>"A Thing"</div><div style="margin: 0px; ">&nbsp; &nbsp; <span style="color: #a91500">when</span></div><div style="margin: 0px; ">&nbsp; &nbsp; <span style="color: #a91500">then</span></div><div style="margin: 0px; "><span class="Apple-tab-span" style="white-space:pre">                </span>Blah blah = <span style="color: #a91500">new</span> Blah();</div><div style="margin: 0px; "><span class="Apple-tab-span" style="white-space:pre">                </span>blah.setX(<span style="color: #008f00">"123"</span>);</div><div style="margin: 0px; "><span class="Apple-tab-span" style="white-space:pre">                </span>blah.setY(<span style="color: #008f00">"321"</span>);</div><p style="margin: 0px; min-height: 15px; "><span class="Apple-tab-span" style="white-space:pre">                </span><br class="webkit-block-placeholder"></p><div style="margin: 0px; "><span class="Apple-tab-span" style="white-space:pre">                </span>System.out.println(<span style="color: #008f00">"X is "</span> + blah.getX());</div><div style="margin: 0px; "><span class="Apple-tab-span" style="white-space:pre">                </span>System.out.println(<span style="color: #008f00">"Y is "</span> + blah.getY());</div><div style="margin: 0px; color: rgb(169, 21, 0); ">end</div></div><div style="margin: 0px; font-size: 11px; font-family: Monaco; min-height: 15px; "><br></div></div><div style="margin: 0px; min-height: 15px; ">and I have a <i>blah.package</i> like the following</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; min-height: 15px; "><div style="margin: 0px; "><div style="margin: 0px; color: rgb(169, 21, 0); ">package<span style="color: #000000"> com.x</span></div><div style="margin: 0px; min-height: 15px; "><br></div><div style="margin: 0px; color: rgb(169, 21, 0); ">declare<span style="color: #000000"> Blah</span></div><div style="margin: 0px; ">&nbsp; x : String</div><div style="margin: 0px; ">&nbsp; y : String</div><div style="margin: 0px; color: rgb(169, 21, 0); ">end</div></div></div><div><br></div><div>Thanks,&nbsp;<br><div apple-content-edited="true"><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px; "><br></span></div><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">-- Paul Ryan</span></div>
<br><div><div>On Sep 13, 2012, at 12:05 AM, Wolfgang Laun &lt;<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">You have serialized a Collection of KnowledgePackage, so I trust you<br>know how to do the reverse. Then, you simple call<br> &nbsp;&nbsp;kBase.addKnowledgePackages( packages )<br><br>-W<br><br><br><br>On 12/09/2012, Paul Ryan &lt;<a href="mailto:pryan@infotrustgroup.com">pryan@infotrustgroup.com</a>&gt; wrote:<br><blockquote type="cite">I guess I should also mention that by default we are using the expert API's<br>so primarily we're creating the knowledge packages using a<br>KnowledgeBuilder.<br><br>Again thanks for any light you can shed on getting files with the extension<br>.package loaded into the knowledge base.<br><br>-- Paul Ryan<br><br>On Sep 11, 2012, at 4:59 PM, Paul Ryan &lt;<a href="mailto:pryan@infotrustgroup.com">pryan@infotrustgroup.com</a>&gt; wrote:<br><br><blockquote type="cite">So drools will respect files with a .package extension as a place for<br>declared types, functions, etc. when used with these in the class path.<br>How can a import these into a KnowledgePackage/KnowledgeBase so they can<br>get compiled along with stuff when this is not in the class path at<br>startup? My use case is such that these are not in the same space and<br>can't be loaded at startup time in most cases.<br><br>Any help is greatly appreciated,<br><br>-- Paul Ryan<br><br><br>_______________________________________________<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>https://lists.jboss.org/mailman/listinfo/rules-users<br></blockquote><br><br>_______________________________________________<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>https://lists.jboss.org/mailman/listinfo/rules-users<br><br></blockquote>_______________________________________________<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>https://lists.jboss.org/mailman/listinfo/rules-users<br></blockquote></div><br></div></body></html>