Package org.jbpm.pvm.internal.session

Examples of org.jbpm.pvm.internal.session.RepositorySession


  }
 
  public ProcessInstance execute(Environment environment) throws Exception {
    ClientProcessDefinition processDefinition = null;
   
    RepositorySession repositorySession = environment.get(RepositorySession.class);
    processDefinition = (ClientProcessDefinition) repositorySession.findProcessDefinitionByKey(processDefinitionKey);
    if (processDefinition==null) {
      throw new JbpmException("no process definition with key "+processDefinitionKey);
    }
   
    ClientProcessInstance processInstance = processDefinition.createProcessInstance(executionKey);
View Full Code Here


    this.variables = variables;
    this.executionKey = executionKey;
  }

  public ProcessInstance execute(Environment environment) throws Exception {
    RepositorySession repositorySession = environment.get(RepositorySession.class);

    ClientProcessDefinition processDefinition = (ClientProcessDefinition)
    repositorySession.findProcessDefinitionById(processDefinitionId);
    if (processDefinition==null) {
      throw new JbpmException("no process definition with id '"+processDefinitionId+"'");
    }
   
    ClientProcessInstance processInstance = processDefinition.createProcessInstance(executionKey);
View Full Code Here

  protected Map<Object, String> outcomeVariableMappings;

  public void execute(ActivityExecution execution) {
    ExecutionImpl executionImpl = (ExecutionImpl) execution;
   
    RepositorySession repositorySession = Environment.getFromCurrent(RepositorySession.class);
   
    ClientProcessDefinition processDefinition = null;
   
    if (subProcessId!=null) {
      processDefinition = repositorySession.findProcessDefinitionById(subProcessId);
    } else {
      processDefinition = repositorySession.findProcessDefinitionByKey(subProcessKey);
    }
   
    ExecutionImpl subProcessInstance = (ExecutionImpl) processDefinition.createProcessInstance(null, execution);
   
    for (String swimlaneName: swimlaneMappings.keySet()) {
View Full Code Here

      // replace any non-word character with an underscore
      processDefinitionKey = processDefinitionName.replaceAll("\\W", "_");
      processDefinition.setKey(processDefinitionKey);
    }
   
    RepositorySession repositorySession = Environment.getFromCurrent(RepositorySession.class);

    List<ProcessDefinition> existingProcesses = repositorySession.createProcessDefinitionQuery()
        .processDefinitionName(processDefinitionName)
        .list();
   
    for (ProcessDefinition existingProcess: existingProcesses) {
      if (!processDefinitionKey.equals(existingProcess.getKey())) {
        deployment.addProblem("invalid key '"+processDefinitionKey+"' in process "+processDefinition.getName()+".  Existing process has name '"+processDefinitionName+"' and key '"+processDefinitionKey+"'");
      }
    }

    existingProcesses = repositorySession.createProcessDefinitionQuery()
        .processDefinitionKey(processDefinitionKey)
        .list();
   
    for (ProcessDefinition existingProcess: existingProcesses) {
      if (!processDefinitionName.equals(existingProcess.getName())) {
View Full Code Here

      id = processDefinition.getKey()+"-"+processDefinition.getVersion();
      if (log.isTraceEnabled()) log.trace("created id '"+id+"' for "+processDefinition);
      processDefinition.setId(id);
    }
   
    RepositorySession repositorySession = Environment.getFromCurrent(RepositorySession.class);
    ProcessDefinition existingProcessDefinition = repositorySession.createProcessDefinitionQuery()
        .processDefinitionId(id)
        .uniqueResult();
    if (existingProcessDefinition != null) {
      deployment.addProblem("process '" + id + "' already exists");
    }
View Full Code Here

 
  protected void checkVersion(ProcessDefinitionImpl processDefinition, DeploymentImpl deployment) {
    int version = processDefinition.getVersion();
    String key = processDefinition.getKey();
    if (version==ProcessDefinitionImpl.UNASSIGNED_VERSION) {
      RepositorySession repositorySession = Environment.getFromCurrent(RepositorySession.class);
     
      ProcessDefinition latestDeployedVersion = repositorySession
          .createProcessDefinitionQuery()
          .processDefinitionKey(key)
          .orderDesc(ProcessDefinitionQuery.PROPERTY_VERSION)
          .page(0, 1)
          .uniqueResult();
View Full Code Here

      // replace any non-word character with an underscore
      processDefinitionKey = processDefinitionName.replaceAll("\\W", "_");
      processDefinition.setKey(processDefinitionKey);
    }
   
    RepositorySession repositorySession = EnvironmentImpl.getFromCurrent(RepositorySession.class);

    List<ProcessDefinition> existingProcesses = repositorySession.createProcessDefinitionQuery()
        .processDefinitionName(processDefinitionName)
        .list();
   
    for (ProcessDefinition existingProcess: existingProcesses) {
      if (!processDefinitionKey.equals(existingProcess.getKey())) {
        deployment.addProblem("invalid key '"+processDefinitionKey+"' in process "+processDefinition.getName()+".  Existing process has name '"+processDefinitionName+"' and key '"+processDefinitionKey+"'");
      }
    }

    existingProcesses = repositorySession.createProcessDefinitionQuery()
        .processDefinitionKey(processDefinitionKey)
        .list();
   
    for (ProcessDefinition existingProcess: existingProcesses) {
      if (!processDefinitionName.equals(existingProcess.getName())) {
View Full Code Here

      id = processDefinition.getKey()+"-"+processDefinition.getVersion();
      if (log.isTraceEnabled()) log.trace("created id '"+id+"' for "+processDefinition);
      processDefinition.setId(id);
    }
   
    RepositorySession repositorySession = EnvironmentImpl.getFromCurrent(RepositorySession.class);
    ProcessDefinition existingProcessDefinition = repositorySession.createProcessDefinitionQuery()
        .processDefinitionId(id)
        .uniqueResult();
    if (existingProcessDefinition != null) {
      deployment.addProblem("process '" + id + "' already exists");
    }
View Full Code Here

 
  protected void checkVersion(ProcessDefinitionImpl processDefinition, DeploymentImpl deployment) {
    int version = processDefinition.getVersion();
    String key = processDefinition.getKey();
    if (version==ProcessDefinitionImpl.UNASSIGNED_VERSION) {
      RepositorySession repositorySession = EnvironmentImpl.getFromCurrent(RepositorySession.class);
     
      ProcessDefinition latestDeployedVersion = repositorySession
          .createProcessDefinitionQuery()
          .processDefinitionKey(key)
          .orderDesc(ProcessDefinitionQuery.PROPERTY_VERSION)
          .page(0, 1)
          .uniqueResult();
View Full Code Here

    }
    return url;
  }

  protected DeploymentImpl getDeployment() {
    RepositorySession repositorySession = EnvironmentImpl.getFromCurrent(RepositorySession.class);
    return repositorySession.getDeployment(deploymentId);
  }
View Full Code Here

TOP

Related Classes of org.jbpm.pvm.internal.session.RepositorySession

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.