-
1. Re: Get assets from Guvnor application?
tropigeek Oct 14, 2011 10:21 AM (in response to paulcoronel)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
<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.