public Map<String, ProcessDefinition> deployXpdl(final byte[] xpdlFile) throws DeploymentException { FacadeUtil.checkArgsNotNull(xpdlFile); return this.deploy(new Deployment(xpdlFile, null)); }
public Map<String, ProcessDefinition> deployXpdl(final URL xpdlURL) throws DeploymentException { FacadeUtil.checkArgsNotNull(xpdlURL); return this.deploy(new Deployment(xpdlURL, null)); }
public Map<String, ProcessDefinition> deploy(final URL xpdlURL, final Class< ? >[] classes) throws DeploymentException { return this.deploy(new Deployment(xpdlURL, Tool.getClasses(classes))); }
private Map<String, ProcessDefinition> deployArchive(final byte[] barFile) throws DeploymentException { File tmpDir = null; Map<String, ProcessDefinition> processes = null; try { tmpDir = this.explodeArchive(barFile, "tmpBonitaBar"); final List<File> xpdlFiles = this.getMatchingFiles(tmpDir, ".xpdl"); if (xpdlFiles.isEmpty()) { throw new DeploymentException("The given bar archive does not contain any '.xpdl' file"); } if (xpdlFiles.size() > 1) { throw new DeploymentException("The given bar archive contains many '.xpdl' files"); } URL xpdlURL; try { xpdlURL = xpdlFiles.get(0).toURL(); if (ManagementAPIImpl.LOG.isLoggable(Level.FINE)) { ManagementAPIImpl.LOG.fine("Xpdl file currently deployed: " + xpdlURL); } } catch (final MalformedURLException e) { throw new DeploymentException("Error when deploying the bar file", e); } processes = this.deploy(new Deployment(xpdlURL, this.getClasses(tmpDir))); } finally { if (tmpDir != null) { Misc.deleteDir(tmpDir); } } return processes; }