JBoss Community

Re: Get assets from Guvnor application?

created by Kiran A in jBPM - View the full discussion

Not sure if you have already found this out. This is what I did:

 

1. Define a change-set.xml in your classpath and define your assets - either from guvnor or files or classpath ....

 

<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/webdav/packages/com.mycompany/myProcess.bpmn2' type='BPMN2'/>

 

  <resource source="classpath:com/mycompany/process/myOtherProcess.bpmn2" type="BPMN2" />

</add>

</change-set>

 

 

2. Build your knowledge base as a regular classpath resource to your change-set.xml

                     KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();

                     kbuilder.add(ResourceFactory.newClassPathResource("com/mycompany/change-set.xml"), ResourceType.CHANGE_SET);

                     kbase = kbuilder.newKnowledgeBase();

 

Alternately, you can go to your guvnor package - build the package, and add the ChangeSet.xml as a URL resource and avoid step (1). Hope this helps.

Reply to this message by going to Community

Start a new discussion in jBPM at Community