Package org.jbpm.pvm.internal.session

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


    this.variable = variable;
  }

  @Override
  public void process() {
    DbSession dbSession = EnvironmentImpl.getFromCurrent(DbSession.class);
    HistoryVariableImpl historyVariable = dbSession.get(HistoryVariableImpl.class, variable.getDbid());
    historyVariable.updated(variable);
  }
View Full Code Here


    HistoryEvent.fire(new ProcessInstanceCreate(), this);
  }

  protected void save() {
    this.dbid = DbidGenerator.getDbidGenerator().getNextId();
    DbSession dbSession = EnvironmentImpl.getFromCurrent(DbSession.class, false);
    if (dbSession!=null) {
      dbSession.save(this);
    }
  }
View Full Code Here

   
    setState(state);

    this.propagation = Propagation.EXPLICIT;
   
    DbSession dbSession = EnvironmentImpl.getFromCurrent(DbSession.class, false);

    if (parent!=null) {
      parent.removeExecution(this);
      if (dbSession!=null) {
        dbSession.delete(this);
      }
     
    } else { // this is a process instance
      HistoryEvent.fire(new ProcessInstanceEnd(), this);
      fire(Event.END, getProcessDefinition());

      if (superProcessExecution!=null) {
        log.trace(toString()+" signals super process execution");
        superProcessExecution.signal();

      } else if (dbSession!=null) {
        dbSession.deleteProcessInstance(id, false);
      }
    }
  }
View Full Code Here

  /** @see Execution#suspend() */
  public void suspend() {
    super.suspend();
    this.propagation = Propagation.EXPLICIT;
    DbSession dbSession = EnvironmentImpl.getFromCurrent(DbSession.class, false);
    if (dbSession!=null) {
      dbSession.cascadeExecutionSuspend(this);
    }
  }
View Full Code Here

  }

  /** @see Execution#resume() */
  public void resume() {
    super.resume();
    DbSession hibernatePvmDbSession = EnvironmentImpl.getFromCurrent(DbSession.class, false);
    if (hibernatePvmDbSession!=null) {
      hibernatePvmDbSession.cascadeExecutionResume(this);
    }
  }
View Full Code Here

    }
    this.taskId = taskId;
  }

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

    }
    return (Set) subTasks;
  }

  public TaskImpl createSubTask() {
    DbSession dbSession = EnvironmentImpl.getFromCurrent(DbSession.class);
    TaskImpl subTask = (TaskImpl) dbSession.createTask();
    if (subTasks == null) {
      subTasks = new HashSet<TaskImpl>();
    }
    addSubTask(subTask);
    return subTask;
View Full Code Here

    commandService.execute(this);
  }

  public Object execute(Environment environment) {
    // reload the execution
    DbSession dbSession = environment.get(DbSession.class);
    if (dbSession==null) {
      throw new JbpmException("no "+DbSession.class.getName()+" available in the environment for reloading the execution");
    }
    execution = dbSession.get(ExecutionImpl.class, execution.getId());
    exceptionHandler.executeHandler(execution, exception);
    return null;
  }
View Full Code Here

public class ActivityStart extends HistoryEvent {

  private static final long serialVersionUID = 1L;

  public void process() {
    DbSession dbSession = EnvironmentImpl.getFromCurrent(DbSession.class);

    long processInstanceDbid = execution.getProcessInstance().getDbid();

    HistoryProcessInstance historyProcessInstanceImpl = (HistoryProcessInstance)
        dbSession.get(HistoryProcessInstanceImpl.class, processInstanceDbid);
   
    HistoryActivityInstanceImpl historyActivityInstance =
        createHistoryActivityInstance(historyProcessInstanceImpl);
   
    String activityType = execution.getActivity().getType();
    historyActivityInstance.setType(activityType);
   
    dbSession.save(historyActivityInstance);
   
    execution.setHistoryActivityInstanceDbid(historyActivityInstance.getDbid());
  }
View Full Code Here

    }
    this.commentId = commentId;
  }

  public Object execute(Environment environment) throws Exception {
    DbSession dbSession = environment.get(DbSession.class);
    HistoryDetailImpl comment = (HistoryDetailImpl) dbSession.get(HistoryDetailImpl.class, Long.parseLong(commentId));
    if (comment!=null) {
      dbSession.delete(comment);
     
    } else {
      throw new JbpmException("comment "+commentId+" doesn't exist");
    }
    return null;
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.