Package org.jbpm.pvm.internal.session

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


    }
    this.taskId = taskId;
  }

  public Set<String> 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+" doesn't exist");
    }
   
    Set<String> outcomes = new HashSet<String>();
View Full Code Here


  public GetTaskCommentsCmd(String taskId) {
    this.taskId = taskId;
  }

  public List<HistoryComment> execute(Environment environment) throws Exception {
    DbSession dbSession = environment.get(DbSession.class);

    List<HistoryComment> comments = dbSession.findCommentsByTaskId(taskId);
    forceInitializationAndClean(comments);
    return comments;
  }
View Full Code Here

  public ExecuteJobCmd(Long jobDbid) {
    this.jobDbid = jobDbid;
  }

  public Job execute(Environment environment) throws Exception {
    DbSession dbSession = environment.get(DbSession.class);
    if (dbSession==null) {
      throw new JbpmException("no db-session configured");
    }
    JobImpl<?> job = (JobImpl<?>) dbSession.get(JobImpl.class, jobDbid);

    // in case of decision jobs, the job might have been deleted
    // before we execute it (they are in a list)
    if (job != null) {
        JobContext jobContext = new JobContext(job);
View Full Code Here

  }

  public ProcessInstance execute(Environment environment) throws Exception {
    ClientExecution execution = null;
   
    DbSession dbSession = environment.get(DbSession.class);
    execution = dbSession.findExecutionById(executionId);
    if (execution==null) {
      throw new JbpmException("execution "+executionId+" does not exist");
    }
   
    execution.signal(signalName, parameters);
View Full Code Here

    this.commentId = commentId;
    this.message = message;
  }

  public HistoryComment execute(Environment environment) throws Exception {
    DbSession dbSession = environment.get(DbSession.class);
    HistoryCommentImpl parentComment = dbSession.get(HistoryCommentImpl.class, Long.parseLong(commentId));
    if (parentComment==null) {
      throw new JbpmException("parent comment doesn't exist: "+commentId);
    }
    HistoryComment replyComment = parentComment.createReply(message);
    return replyComment;
View Full Code Here

    }
    this.taskId = taskId;
  }

  public Set<String> execute(Environment environment) throws Exception {
    DbSession dbSession = environment.get(DbSession.class);
    TaskImpl task = dbSession.get(TaskImpl.class, Long.parseLong(taskId));
    return task.getVariableKeys();
  }
View Full Code Here

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

  public Void execute(Environment environment) throws Exception {
    DbSession dbSession = environment.get(DbSession.class);
    TaskImpl task = (TaskImpl) dbSession.get(TaskImpl.class, taskDbid);
    if (task!=null) {
      task.delete(reason);
      dbSession.delete(task);
      if (deleteHistory) {
        HistoryTaskImpl historyTask = (HistoryTaskImpl) dbSession.get(HistoryTaskImpl.class, taskDbid);
        if (historyTask!=null) {
          dbSession.delete(historyTask);
        }
      }
    } else {
      throw new JbpmException("task "+taskDbid+" doesn't exist");
    }
View Full Code Here

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

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

    this.task = task;
    this.assignee = assignee;
  }

  public void process() {
    DbSession dbSession = Environment.getFromCurrent(DbSession.class);
    HistoryTaskImpl historyTaskInstance = (HistoryTaskImpl)
        dbSession.get(HistoryTaskImpl.class, task.getDbid());
    historyTaskInstance.setAssignee(assignee);
  }
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

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.