Package org.jbpm.api

Examples of org.jbpm.api.NewDeployment


    }
  }

  protected void deployFile(ProcessEngine processEngine, File processFile) {
    RepositoryService repositoryService = processEngine.getRepositoryService();
    NewDeployment deployment = repositoryService.createDeployment();
    deployment.setName(processFile.getName());
    deployment.setTimestamp(System.currentTimeMillis());
   
    if (processFile.getName().endsWith(".xml")) {
      log("deploying process file "+processFile.getName());
      deployment.addResourceFromFile(processFile);
     
    } else if (processFile.getName().endsWith("ar")) {
      log("deploying business archive "+processFile.getName());
      try {
        FileInputStream fileInputStream = new FileInputStream(processFile);
        ZipInputStream zipInputStream = new ZipInputStream(fileInputStream);
        deployment.addResourcesFromZipInputStream(zipInputStream);
      } catch (Exception e) {
        throw new BuildException("couldn't read business archive "+processFile, e);
      }

    } else {
      throw new BuildException("unsupported extension: "+processFile+"  Only .xml files and .*ar archives are supported");
    }
   
    deployment.deploy();
  }
View Full Code Here


        }

        public String deployProcessDefinition(String processName, InputStream definitionStream, InputStream processMapImageStream) {
            RepositoryService service = getProcessEngine(ProcessToolContext.Util.getThreadProcessToolContext())
                    .getRepositoryService();
            NewDeployment deployment = service.createDeployment();
            deployment.addResourceFromInputStream(processName + ".jpdl.xml", definitionStream);
            if (processMapImageStream != null)
                deployment.addResourceFromInputStream(processName + ".png", processMapImageStream);
            return deployment.deploy();
        }
View Full Code Here

    }
  }

  protected void deployFile(ProcessEngine processEngine, File processFile) {
    RepositoryService repositoryService = processEngine.getRepositoryService();
    NewDeployment deployment = repositoryService.createDeployment();
    deployment.setName(processFile.getName());
    deployment.setTimestamp(System.currentTimeMillis());
   
    if (processFile.getName().endsWith(".xml")) {
      log("deploying process file "+processFile.getName());
      deployment.addResourceFromFile(processFile);
     
    } else if (processFile.getName().endsWith("ar")) {
      log("deploying business archive "+processFile.getName());
      try {
        FileInputStream fileInputStream = new FileInputStream(processFile);
        ZipInputStream zipInputStream = new ZipInputStream(fileInputStream);
        deployment.addResourcesFromZipInputStream(zipInputStream);
      } catch (Exception e) {
        throw new BuildException("couldn't read business archive "+processFile, e);
      }

    } else {
      throw new BuildException("unsupported extension: "+processFile+"  Only .xml files and .*ar archives are supported");
    }
   
    deployment.deploy();
  }
View Full Code Here

TOP

Related Classes of org.jbpm.api.NewDeployment

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.