Package org.jbpm.pvm.internal.repository

Examples of org.jbpm.pvm.internal.repository.DeploymentImpl


    return task;
  }

  public static DeploymentRef adoptDeployment(Deployment dpl)
  {
    DeploymentImpl d0 = (DeploymentImpl)dpl;
    DeploymentRef dRef = new DeploymentRef(
        dpl.getId(), d0.isSuspended()
    );

    String name = d0.getName();
    dRef.getResourceNames().addAll(d0.getResourceNames());

    // strip path info
    if(name.indexOf("/")!=-1)
    {
      name = name.substring(name.lastIndexOf("/")+1, name.length());
    }

    dRef.setName(name);
    dRef.setTimestamp(d0.getTimestamp());

    return dRef;
  }
View Full Code Here


  }

  public Object execute(Environment environment) throws Exception {
    RepositorySession repositorySession = environment.get(RepositorySession.class);
   
    DeploymentImpl deployment = (DeploymentImpl) repositorySession.getDeployment(deploymentId);
    if (deployment==null) {
      throw new JbpmException("deployment "+deploymentId+" doesn't exist");
    }
   
    deployment.suspend();
   
    // removing deployment from the cache
    // next time it's used, it will be redeployed
    // at that time, the suspended property will be propagated to the
    // process definitions
View Full Code Here

    this.deploymentId = deploymentId;
  }

  public Object execute(Environment environment) throws Exception {
    RepositorySession repositorySession = environment.get(RepositorySession.class);
    DeploymentImpl deployment = (DeploymentImpl) repositorySession.getDeployment(deploymentId);
    deployment.resume();
    return null;
  }
View Full Code Here

        }
      }
    }
   
    Session session = environment.get(Session.class);
    DeploymentImpl deployment = (DeploymentImpl) session.load(DeploymentImpl.class, Long.parseLong(deploymentId));
    log.debug("deleting deployment "+deploymentId);
    session.delete(deployment);
   
    RepositoryCache repositoryCache = environment.get(RepositoryCache.class);
    repositoryCache.set(deploymentId, null);
View Full Code Here

                .add(Restrictions.eq("key", DeploymentImpl.KEY_PROCESS_DEFINITION_ID))
                .list();

            for (DeploymentProperty deploymentProperty : deploymentProperties) {
              String objectName = deploymentProperty.getObjectName();
              DeploymentImpl deployment = deploymentProperty.getDeployment();
              deployment.setProcessLanguageId(objectName, "jpdl-4.0");
            }
            return null;
          }
        });
      }
View Full Code Here

        }
      }
    }
   
    Session session = environment.get(Session.class);
    DeploymentImpl deployment = (DeploymentImpl) session.load(DeploymentImpl.class, Long.parseLong(deploymentId));
    log.debug("deleting deployment "+deploymentId);
    session.delete(deployment);
   
    RepositoryCache repositoryCache = environment.get(RepositoryCache.class);
    repositoryCache.remove(deploymentId);
View Full Code Here

    this.deploymentId = deploymentId;
  }

  public Set<String> execute(Environment environment) throws Exception {
    RepositorySession repositorySession = environment.get(RepositorySession.class);
    DeploymentImpl depImpl = repositorySession.getDeployment(deploymentId);
    return depImpl.getResourceNames();
  }
View Full Code Here

  }

  public Object execute(Environment environment) throws Exception {
    RepositorySession repositorySession = environment.get(RepositorySession.class);
   
    DeploymentImpl deployment = (DeploymentImpl) repositorySession.getDeployment(deploymentId);
    if (deployment==null) {
      throw new JbpmException("deployment "+deploymentId+" doesn't exist");
    }
   
    deployment.suspend();
   
    // removing deployment from the cache
    // next time it's used, it will be redeployed
    // at that time, the suspended property will be propagated to the
    // process definitions
View Full Code Here

    this.deploymentId = deploymentId;
  }

  public Object execute(Environment environment) throws Exception {
    RepositorySession repositorySession = environment.get(RepositorySession.class);
    DeploymentImpl deployment = (DeploymentImpl) repositorySession.getDeployment(deploymentId);
    deployment.resume();
    return null;
  }
View Full Code Here

      // make the process language version available for bindings
      // to allow for specific parsing behaviour per version
     
      // first check if the langid is available as a deployment property
      DeploymentImpl deployment = (DeploymentImpl) parse.contextMapGet(Parse.CONTEXT_KEY_DEPLOYMENT);
      if (deployment!=null) {
        String processLanguageId = deployment.getProcessLanguageId(name);
        if (processLanguageId==null) {
          // if it is not available as a deployment property, check if the
          // jpdlparser attribute specifies a specific jpdl version.
          // this is the case for certain compatibility tests in our test suite
          String jpdlParser = XmlUtil.attribute(documentElement, "jpdlparser");
          if (jpdlParser!=null) {
            processLanguageId = "jpdl-"+jpdlParser;

          } else {
            // if none of the above, check if this is a parser test run for a specific verion
            // specify the jpdltestversion with "mvn -Djpdlparser=jpdl-4.3 clean install"
            // that way, the whole test suite will be use the specified parser
            jpdlParser = System.getProperty("jpdlparser");
            if (jpdlParser!=null) {
              processLanguageId = "jpdl-"+jpdlParser;

            } else {
              // if this process has a namespace, then use the namespace
              // to see what jpdl parser version should be used
              String namespaceUri = documentElement.getNamespaceURI();
              if (namespaceUri!=null) {
                processLanguageId = "jpdl-"+namespaceUri.substring(16, 19);

              } else {
                // if none of the above, just deploy it as the current library version
                processLanguageId = CURRENT_VERSION_PROCESS_LANGUAGE_ID;
              }
            }
          }
          // saving the process language will make sure that 
          // the right parser version is used after an upgrade of jbpm
          // as the old format xml will still be in the db
          deployment.setProcessLanguageId(name, processLanguageId);
        }
        parse.contextMapPut(Parse.CONTEXT_KEY_PROCESS_LANGUAGE_ID, processLanguageId);
      }

      String packageName = XmlUtil.attribute(documentElement, "package");
View Full Code Here

TOP

Related Classes of org.jbpm.pvm.internal.repository.DeploymentImpl

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.