Package org.jbpm.pvm.internal.session

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


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

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


  }

  public Date execute(Environment environment) throws Exception {
    Date nextDueDate = null;
    if (log.isTraceEnabled()) log.trace("getting next due date...");
    DbSession dbSession = environment.get(DbSession.class);
    JobImpl<?> job = dbSession.findFirstDueJob();
    if (job!=null) {
      nextDueDate = job.getDueDate();
    }
    if (log.isTraceEnabled()) log.trace("next due date is "+nextDueDate);
    return nextDueDate;
View Full Code Here

    this.processInstanceId = processInstanceId;
    this.cascade = cascade;
  }

  public Void execute(Environment environment) throws Exception {
    DbSession dbSession = EnvironmentImpl.getFromCurrent(DbSession.class);
    dbSession.deleteProcessInstance(processInstanceId, cascade);
    return null;
  }
View Full Code Here

  }

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

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

    this.taskDbid = Long.parseLong(taskId);
    this.message = message;
  }

  public HistoryComment execute(Environment environment) throws Exception {
    DbSession dbSession = environment.get(DbSession.class);
    HistoryTaskImpl historyTask = dbSession.get(HistoryTaskImpl.class, taskDbid);
    if (historyTask==null) {
      throw new JbpmException("task "+taskDbid+" doesn't exist");
    }
    HistoryCommentImpl comment = new HistoryCommentImpl(message);
    historyTask.addDetail(comment);
    dbSession.save(comment);
    return comment;
  }
View Full Code Here

    this.userId = userId;
    this.take = take;
  }

  public Void execute(Environment environment) {
    DbSession dbSession = environment.get(DbSession.class);
    TaskImpl task = dbSession.get(TaskImpl.class, Long.parseLong(taskId));
    if (task==null) {
      throw new JbpmException("task "+taskId+" does not exist");
    }
    if (take) {
      task.take(userId);
View Full Code Here

    this.processInstanceId = processInstanceId;
    this.state = state;
  }

  public Object execute(Environment environment) throws Exception {
    DbSession dbSession = environment.get(DbSession.class);
    ExecutionImpl processInstance = (ExecutionImpl) dbSession.findProcessInstanceById(processInstanceId);
    processInstance.end(state);
    return null;
  }
View Full Code Here

    }
    this.executionId = executionId;
  }

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

    }
    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

  }

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

    DbSession dbSession = environment.get(DbSession.class);
    TaskImpl task = dbSession.get(TaskImpl.class, Long.parseLong(taskId));
    for (String variableName : variableNames) {
      Object value = task.getVariable(variableName);
      variables.put(variableName, value);
    }
View Full Code Here

TOP

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

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.