<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    Re: Instantiating the KnowledgeBase
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/carek">Piotr Tempes</a> in <i>jBPM</i> - <a href="http://community.jboss.org/message/598492#598492">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>I guess I have similiar problem. I wish to get all proccess definitions (NOT instances) from guvnor, but I don't know how to...</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>above sample code:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-java">KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent(<font color="red">"testKAgent"</font>, aconf);&#160;&#160;&#160;&#160;&#160;&#160; 
&#160;&#160;&#160;&#160;&#160;&#160;&#160; kagent.applyChangeSet( 
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ResourceFactory.newUrlResource(
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <font color="red">"http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor"</font>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; + <font color="red">"/package/defaultPackage/LATEST/ChangeSet.xml"</font>)); 
&#160;
&#160;
And then you take the knowledgeBase from the KnowledgeAgent like <font color="navy"><b>this</b></font> :
KnowledgeBase kbase = kagent.getKnowledgeBase();
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>claims that by applyChangeSet I can have those definitions in agent and than get it from him by getKnowledgeBase, but I don;t have anything like changeSet.xml under that address and even if I would what would be it's content? I tried to read from local changeset.xml:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-xml"><span class="jive-xml-tag"><span>&lt;change-set xmlns='</span><a class="jive-link-external-small" href="http://drools.org/drools-5.0/change-set" target="_blank">http://drools.org/drools-5.0/change-set</a><span>'
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; xmlns:xs='</span><a class="jive-link-external-small" href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a><span>'
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; xs:schemaLocation='</span><a class="jive-link-external-small" href="http://drools.org/drools-5.0/change-set" target="_blank">http://drools.org/drools-5.0/change-set</a><span> </span><a class="jive-link-external-small" href="http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/main/resources/change-set-1.0.0.xsd" target="_blank">http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/main/resources/change-set-1.0.0.xsd</a><span>' &gt;</span></span>
&#160;&#160;&#160; <span class="jive-xml-tag">&lt;add&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag"><span>&lt;resource source='</span><a class="jive-link-external-small" href="http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/webdav/packages/defaultPackage" target="_blank">http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/webdav/packages/defaultPackage</a><span>' type='BPMN2'/&gt;</span></span>
&#160;&#160;&#160; <span class="jive-xml-tag">&lt;/add&gt;</span>
<span class="jive-xml-tag">&lt;/change-set&gt;</span>
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>but that didn't work.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span>I have guvnor running and in browser on address </span><a class="jive-link-external-small" href="http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/webdav/packages/defaultPackage" target="_blank">http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/webdav/packages/defaultPackage</a></p><p>I can see:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code">Contents of this Folder:
drools.package
test.bpmn2
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>test.bpmn2 is correctly displayed in editor and created via guvnor... so everything is fine, except I don't know how can I download to my client from guvnor those definitions... </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>anybody? I would be gratefull for any piece of advice</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/598492#598492">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in jBPM at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>