-
1. Re: Process Definition Deployment using ZipInputStream
jbarrez Jul 30, 2009 3:54 AM (in response to 3)Can you pour this into a Junit test case so that we can test exactly your problem?
-
2. Re: Process Definition Deployment using ZipInputStream
sushantgupta402 Jul 30, 2009 9:50 AM (in response to 3)try the code below
================================
public static void main(String[] args) {
ProcessEngine processEngine = new Configuration()
.buildProcessEngine();
RepositoryService repositoryService = processEngine.getRepositoryService();
FileInputStream fip;
try {
fip = new FileInputStream("C:\\JBPMV4\\bin\\TestProcess.jpdl.zip");
ZipInputStream zip = new ZipInputStream(fip);
String deploymentDbid = repositoryService.createDeployment().addResourcesFromZipInputStream(zip).deploy();
System.out.println("Deployment Db Id: " + deploymentDbid);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
} -
3. Re: Process Definition Deployment using ZipInputStream
jbarrez Jul 31, 2009 6:15 AM (in response to 3)I included a test case for this in the test suite, but the test succeeds. So either I'm testing the wrong thing or you are doing something wrong:
public void testZippedResourceDeployment() { FileInputStream fip = null; try { fip = new FileInputStream("src/test/resources/org/jbpm/test/deploy/process.zip"); ZipInputStream zis = new ZipInputStream(fip); NewDeployment newDeployment = repositoryService.createDeployment(); newDeployment.addResourcesFromZipInputStream(zis); String deployId = newDeployment.deploy(); ProcessDefinition procDef = repositoryService.createProcessDefinitionQuery() .deploymentId(deployId) .uniqueResult(); assertNotNull(procDef); assertEquals("ImageTest", procDef.getName()); repositoryService.deleteDeploymentCascade(deployId); } catch (IOException e) { fail(e.getMessage()); } finally { if (fip != null) { try { fip.close(); } catch (IOException e) { fail(e.getMessage()); } } } }