Examples of DbSession


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

  public TaskCreated(TaskImpl task) {
    this.task = task;
  }

  public void process() {
    DbSession dbSession = Environment.getFromCurrent(DbSession.class);
    HistoryTaskImpl historyTask = new HistoryTaskImpl(task);
    dbSession.save(historyTask);
   
    if (task.getSuperTask()!=null) {
      HistoryTaskImpl superHistoryTask = dbSession.get(HistoryTaskImpl.class, task.getSuperTask().getDbid());
      superHistoryTask.addSubTask(historyTask);
    }
  }
View Full Code Here

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

    }
    this.executionId = executionId;
  }

  public Execution execute(Environment environment) throws Exception {
    DbSession dbSession = environment.get(DbSession.class);
    return dbSession.findExecutionById(executionId);
  }
View Full Code Here

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

  public TaskUpdated(TaskImpl task) {
    this.task = task;
  }

  public void process() {
    DbSession dbSession = Environment.getFromCurrent(DbSession.class);
    HistoryTaskImpl historyTask = dbSession.get(HistoryTaskImpl.class, task.getDbid());
    historyTask.updated(task);
  }
View Full Code Here

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

    }
    this.taskId = taskId;
  }

  public Void execute(Environment environment) throws Exception {
    DbSession dbSession = environment.get(DbSession.class);
    TaskImpl task = dbSession.get(TaskImpl.class, Long.parseLong(taskId));
    task.setVariables(variables);
  
    return null;
  }
View Full Code Here

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

  }

  protected void updateHistoryActivityInstance(HistoryActivityInstanceImpl historyActivityInstance) {
    super.updateHistoryActivityInstance(historyActivityInstance);

    DbSession dbSession = Environment.getFromCurrent(DbSession.class);
    HistoryTaskImpl historyTask = (HistoryTaskImpl) dbSession.get(HistoryTaskImpl.class, task.getDbid());
    historyTask.setState(reason);
    historyTask.setEndTime(Clock.getCurrentTime());
  }
View Full Code Here

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

    RepositorySession repositorySession = environment.get(RepositorySession.class);
    List<ProcessDefinition> processDefinitions = repositorySession.createProcessDefinitionQuery()
      .deploymentId(deploymentId)
      .list();
   
    DbSession dbSession = environment.get(DbSession.class);

    for (ProcessDefinition processDefinition: processDefinitions) {
      String processDefinitionId = processDefinition.getId();
      List<String> processInstanceIds = dbSession.findProcessInstanceIds(processDefinitionId);
     
      if (cascade) {
        for (String processInstanceId: processInstanceIds) {
          dbSession.deleteProcessInstance(processInstanceId, true);
        }

        dbSession.deleteProcessDefinitionHistory(processDefinitionId);
       
      } else {
        if (!processInstanceIds.isEmpty()) {
          throw new JbpmException("cannot delete deployment "+deploymentId+": still executions for "+processDefinition+": "+processInstanceIds);
        }
View Full Code Here

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

  }

  public Map<String, Object> execute(Environment environment) throws Exception {
    Map<String, Object> variables = new HashMap<String, Object>();

    DbSession dbSession = environment.get(DbSession.class);
    ClientExecution execution = dbSession.findExecutionById(executionId);
    for (String variableName : variableNames) {
      Object value = execution.getVariable(variableName);
      variables.put(variableName, value);
    }
View Full Code Here

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

    }
    this.executionId = executionId;
  }

  public Set<String> execute(Environment environment) throws Exception {
    DbSession dbSession = environment.get(DbSession.class);
    ClientExecution execution = dbSession.findExecutionById(executionId);
    return execution.getVariableKeys();
  }
View Full Code Here

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

      if (superProcessExecution!=null) {
        log.trace(toString()+" signals super process execution");
        superProcessExecution.signal();
      }
     
      DbSession dbSession = Environment.getFromCurrent(DbSession.class, false);
      if (dbSession!=null) {
        dbSession.deleteProcessInstance(id, false);
      }
    }
  }
View Full Code Here

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

  /** @see Execution#suspend() */
  public void suspend() {
    super.suspend();
    this.propagation = Propagation.EXPLICIT;
    DbSession dbSession = Environment.getFromCurrent(DbSession.class, false);
    if (dbSession!=null) {
      dbSession.cascadeExecutionSuspend(this);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.