Package org.activiti.engine.repository

Examples of org.activiti.engine.repository.DeploymentBuilder


                    resourceName = resource.getFilename();
                }
            }

            try {
                DeploymentBuilder deploymentBuilder = repositoryService
                        .createDeployment().enableDuplicateFiltering()
                        .name(resourceName);

                if (resourceName.endsWith(".bar")
                        || resourceName.endsWith(".zip")
                        || resourceName.endsWith(".jar")) {
                    deploymentBuilder.addZipInputStream(new ZipInputStream(
                            resource.getInputStream()));
                } else {
                    deploymentBuilder.addInputStream(resourceName,
                            resource.getInputStream());
                }

                Deployment deployment = deploymentBuilder.deploy();
                logger.info("auto deploy : {}", resourceName);

                for (ProcessDefinition processDefinition : repositoryService
                        .createProcessDefinitionQuery()
                        .deploymentId(deployment.getId()).list()) {
View Full Code Here


   *         {@link ProcessDefinition#getId()}
   */
  public String deployProcess(String resourceName) {
    logger.fine("Start deploying single process.");
    // deploy processes as one deployment
    DeploymentBuilder deploymentBuilder = processEngine.getRepositoryService().createDeployment();
    deploymentBuilder.addClasspathResource(resourceName);
    // deploy the processes
    Deployment deployment = deploymentBuilder.deploy();
    logger.fine("Process deployed");
    // retreive the processDefinitionId for this process
    return processEngine.getRepositoryService().createProcessDefinitionQuery().deploymentId(deployment.getId()).singleResult().getId();
  }
View Full Code Here

    if (resourceNames.size() == 0) {
      logger.fine("Not creating a deployment");
      return;
    }
    logger.fine("Start deploying processes.");
    DeploymentBuilder deploymentBuilder = processEngine.getRepositoryService().createDeployment();
    for (String string : resourceNames) {
      logger.info("Adding '" + string + "' to deployment.");
      deploymentBuilder.addClasspathResource(string);
    }
    // deploy the processes
    deploymentBuilder.deploy();
    logger.fine("Done deploying processes.");
  }
View Full Code Here

        ProcessEngine eng = JenkowEngine.getEngine();
        RuntimeService rtSvc = eng.getRuntimeService();
        RepositoryService repoSvc = eng.getRepositoryService();

        String wfn = wff+"20.xml"; // TODO 9: workaround for http://forums.activiti.org/en/viewtopic.php?f=8&t=3745&start=10
        DeploymentBuilder db = repoSvc.createDeployment().addInputStream(wfn,new FileInputStream(wff));

        // TODO 4: We should avoid redeploying here, if workflow file of a given version(?) is already deployed?
        Deployment d = db.deploy();
        ProcessDefinition pDef = repoSvc.createProcessDefinitionQuery().deploymentId(d.getId()).singleResult();
        LOGGER.fine("deployedToEngine("+wff+") --> "+pDef);
    }
View Full Code Here

  @Override
  public void handle(SimulationEvent event) {

    List<String> resources = (List<String>) event.getProperty(resourcesKey);

    DeploymentBuilder deploymentBuilder = SimulationRunContext.getRepositoryService().createDeployment();

    for (String resource : resources) {
      log.debug("adding resource [{}] to repository", resource, SimulationRunContext.getRepositoryService());
      deploymentBuilder.addClasspathResource(resource);
    }

    deploymentBuilder.deploy();
  }
View Full Code Here

    Map<String, ResourceEntity> resources = (Map<String, ResourceEntity>) event.getProperty(resourcesKey);

    List<InputStream> inputStreams = new ArrayList<InputStream>();

    try {
      DeploymentBuilder deploymentBuilder = SimulationRunContext.getRepositoryService().createDeployment();

      for (ResourceEntity resource : resources.values()) {
        log.debug("adding resource [{}] to deploymnet", resource.getName());
        InputStream is = new ByteArrayInputStream(resource.getBytes());
        deploymentBuilder.addInputStream(resource.getName(), is);
        inputStreams.add(is);
      }

      deploymentBuilder.deploy();
    } finally {
      for (InputStream is : inputStreams) {
        try {
          is.close();
        } catch (IOException e) {
View Full Code Here

   *         {@link ProcessDefinition#getId()}
   */
  public String deployProcess(String resourceName) {
    logger.debug("Start deploying single process.");
    // deploy processes as one deployment
    DeploymentBuilder deploymentBuilder = processEngine.getRepositoryService().createDeployment();
    deploymentBuilder.addClasspathResource(resourceName);
    // deploy the processes
    Deployment deployment = deploymentBuilder.deploy();
    logger.debug("Process deployed");
    // retreive the processDefinitionId for this process
    return processEngine.getRepositoryService().createProcessDefinitionQuery().deploymentId(deployment.getId()).singleResult().getId();
  }
View Full Code Here

    if (resourceNames.isEmpty()) {
      logger.debug("Not creating a deployment");
      return;
    }
    logger.debug("Start deploying processes.");
    DeploymentBuilder deploymentBuilder = processEngine.getRepositoryService().createDeployment();
    for (String string : resourceNames) {
      logger.info("Adding '" + string + "' to deployment.");
      deploymentBuilder.addClasspathResource(string);
    }
    // deploy the processes
    deploymentBuilder.deploy();
    logger.debug("Done deploying processes.");
  }
View Full Code Here

        if (engine == null) {
          throw new IllegalStateException("Unable to find a ProcessEngine service");
        }

        RepositoryService service = engine.getRepositoryService();
        DeploymentBuilder builder = service.createDeployment();
        builder.name(bundle.getSymbolicName());
        for (URL url : pathList) {
          InputStream is = url.openStream();
          if (is == null) {
              throw new IOException("Error opening url: " + url);
          }
          try {
              builder.addInputStream(getPath(url), is);
          } finally {
              is.close();
          }
        }
        builder.enableDuplicateFiltering();
        builder.deploy();
      } else {
        LOGGER.debug("No activiti process found in bundle {}", bundle.getSymbolicName());
      }
    } catch (Throwable t) {
      LOGGER.error("Unable to deploy activiti bundle", t);
View Full Code Here

        for (final Entry<String, Set<Resource>> group : resourcesMap.entrySet()) {

            final String deploymentName = determineDeploymentName(deploymentNameHint, group.getKey());

            final DeploymentBuilder deploymentBuilder = repositoryService.createDeployment().enableDuplicateFiltering().name(deploymentName);

            for (final Resource resource : group.getValue()) {
                final String resourceName = determineResourceName(resource);

                try {
                    if (resourceName.endsWith(".bar") || resourceName.endsWith(".zip") || resourceName.endsWith(".jar")) {
                        deploymentBuilder.addZipInputStream(new ZipInputStream(resource.getInputStream()));
                    } else {
                        deploymentBuilder.addInputStream(resourceName, resource.getInputStream());
                    }
                } catch (IOException e) {
                    throw new ActivitiException("couldn't auto deploy resource '" + resource + "': " + e.getMessage(), e);
                }
            }
            deploymentBuilder.deploy();
        }

    }
View Full Code Here

TOP

Related Classes of org.activiti.engine.repository.DeploymentBuilder

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.