Package org.jbpm.pvm.internal.session

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


  public void schedule(Timer timer) {
    log.debug("scheduling "+timer);

    // flush timer to database
    DbSession dbSession = Environment.getCurrent().get(DbSession.class);
    dbSession.save(timer);
    dbSession.flush();

    // retrieve timer as entity bean, contact timer service
    try {
      LocalTimer timerBean = timerHome.findByPrimaryKey(((TimerImpl)timer).getDbid());
      timerBean.schedule();
View Full Code Here


  public Object execute(Environment environment) throws Exception {
    AsyncContinuations.restoreState(execution);
   
    execution.performAtomicOperationSync(AtomicOperation.EXECUTE_ACTIVITY);

    DbSession dbSession = environment.get(DbSession.class);
    dbSession.delete(this);

    return null;
  }
View Full Code Here

    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

  public Object execute(Environment environment) throws Exception {
    AsyncContinuations.restoreState(execution);

    execution.performAtomicOperationSync(AtomicOperation.TRANSITION_START_ACTIVITY);
   
    DbSession dbSession = environment.get(DbSession.class);
    dbSession.delete(this);

    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);
    ClientExecution execution = dbSession.findExecutionById(executionId);
    if (execution==null) {
      throw new JbpmException("execution "+executionId+" doesn't exist");
    }
    for (String variableName : variableNames) {
      Object value = execution.getVariable(variableName);
View Full Code Here

   
    execution.setState((String) asyncExecutionInfo.get(KEY_STATE));

    execution.performAtomicOperationSync(AtomicOperation.EXECUTE_EVENT_LISTENER);
   
    DbSession dbSession = environment.get(DbSession.class);
    dbSession.delete(this);

    return null;
  }
View Full Code Here

    execution.setState(Execution.STATE_ACTIVE_ROOT);
   
    Signal signal = new Signal(signalName, parameters);
    execution.performAtomicOperationSync(signal);
   
    DbSession dbSession = environment.get(DbSession.class);
    dbSession.delete(this);

    return null;
  }
View Full Code Here

    }
    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

      this.parentTaskDbid = Long.parseLong(parentTaskId);
    }
  }

  public Task execute(Environment environment) throws Exception {
    DbSession dbSession = environment.get(DbSession.class);
    TaskImpl task = (TaskImpl) dbSession.createTask();
    task.setSuperTaskDbid(parentTaskDbid);
    return task;
  }
View Full Code Here

  public Object execute(Environment environment) throws Exception {
    log.debug("handling job "+jobDbid+" exception: "+exception.getMessage());
   
    // load the job from the db
    DbSession dbSession = environment.get(DbSession.class);
    if (dbSession==null) {
      throw new JbpmException("no job-session configured to handle job");
    }
    JobImpl<?> job = (JobImpl<?>) dbSession.get(JobImpl.class, jobDbid);
    // serialize the stack trace
    StringWriter sw = new StringWriter();
    exception.printStackTrace(new PrintWriter(sw));
    if (job != null) {
      // decrement the number of retries
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.