On Thu, Aug 26, 2010 at 4:48 PM, Andrew Waterman-2 [via Drools - Java
<br>Rules Engine] <<a href="/user/SendEmail.jtp?type=node&node=1362284&i=0" target="_top" rel="nofollow">[hidden email]</a>> wrote:
<br>>
<br>> Okay, cool. So where's the magic location? :)
<br><br>The magic location...is...unless I'm missing something...specified in ra.xml.
<br><br>Here's what that part of ra.xml looks like (lines 39-43 from
<br><a href="http://code.google.com/p/drools-jca/source/browse/trunk/drools-rar/src/main/resources/META-INF/ra.xml):" target="_top" rel="nofollow" link="external">http://code.google.com/p/drools-jca/source/browse/trunk/drools-rar/src/main/resources/META-INF/ra.xml):</a><br><br><config-property>
<br> <config-property-name>changeSetResourceName</config-property-name>
<br> <config-property-type>java.lang.String</config-property-type>
<br> <config-property-value>rules/KnowledgeBases.xml</config-property-value>
<br><!-- this can be any classpath resource you want -->
<br></config-property>
<br><br>So in this example somewhere in the resource adapter's classpath
<br>(which in my case is usually in a jar file in the lib directory of an
<br>.ear file that houses the .rar file), you should have
<br>rules/KnowledgeBases.xml. This can be named anything you want;
<br>there's nothing special about the name.
<br><br>That file, as I posted before, is your changeset, and following the
<br>XSD that I didn't write :-) looks like this:
<br><br><?xml version="1.0" encoding="UTF-8"?>
<br><change-set xmlns="<a href="http://drools.org/drools-5.0/change-set" target="_top" rel="nofollow" link="external">http://drools.org/drools-5.0/change-set</a>"
<br>xmlns:xs="<a href="http://www.w3.org/2001/XMLSchema-instance" target="_top" rel="nofollow" link="external">http://www.w3.org/2001/XMLSchema-instance</a>"
<br>xs:schemaLocation="<a href="http://drools.org/drools-5.0/change-set" target="_top" rel="nofollow" link="external">http://drools.org/drools-5.0/change-set</a><br><a href="http://anonsvn.jboss.org/repos/labs/labs/jbossrules/tags/5.0.1.26597.FINAL/drools-api/src/main/resources/change-set.xsd" target="_top" rel="nofollow" link="external">http://anonsvn.jboss.org/repos/labs/labs/jbossrules/tags/5.0.1.26597.FINAL/drools-api/src/main/resources/change-set.xsd</a>">
<br> <add>
<br> <resource source="classpath:rules/rules.drl" type="DRL"></resource>
<br> </add>
<br></change-set>
<br><br>The <resource source=""/> part is up to you and has to be a URL. One
<br>of the allowed URL protocols I discovered is classpath:, so that's
<br>what I used in my stuff. You could use file:, ftp:, http:, whatever;
<br>the URL could (and probably should) point to a Guvnor package as well.
<br> Then you have the added benefit that if that package ever changes,
<br>the KnowledgeAgent will automatically pick it up.
<br><br>I hope that helps.
<br><br>Best,
<br>Laird
<br>
<br><hr align="left" width="300">
View this message in context: <a href="http://drools-java-rules-engine.46999.n3.nabble.com/Drools-and-Java-EE-tp1323225p1362284.html">Re: Drools and Java EE</a><br>
Sent from the <a href="http://drools-java-rules-engine.46999.n3.nabble.com/Drools-User-f47000.html">Drools - User mailing list archive</a> at Nabble.com.<br>