1 Reply Latest reply on Aug 8, 2012 12:11 PM by swiderski.maciej

    how to read the package from guvnor in java

    arselv

      I have desgined a workflow using designer in guvnor and built it

      Now i have to use the workflow in my war.

      Whats the url to get that workflow from guvnor.

      I tried the below code.But its not fetching me the workflow.

       

      KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent( "MyAgent" );

      URL url=new URL("http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/webdav/packages/defaultPackage/first.bpmn2");

      kagent.applyChangeSet( ResourceFactory.newUrlResource(url ) );

      KnowledgeBase kbase = kagent.getKnowledgeBase();

       

      kindly provide an example.

        • 1. Re: how to read the package from guvnor in java
          swiderski.maciej

          you should use a change set file

           

           

          <change-set xmlns='http://drools.org/drools-5.0/change-set'
                      xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'
                      xs:schemaLocation='http://drools.org/drools-5.0/change-set http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/main/resources/change-set-1.0.0.xsd' >
              <add>
                  <resource source='http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/defaultPackage/LATEST' type='PKG' />
              </add>
          </change-set>
          

           

          and the use

           

           

          kagent.applyChangeSet( ResourceFactory.newClasspathResource(PATH_TO_CHANGESET_FILE ) );
          

           

           

          HTH