Package org.jbpm.pvm.internal.env

Examples of org.jbpm.pvm.internal.env.Transaction


      release();
     
      // notify the jobExecutor at the end of the transaction
      JobExecutor jobExecutor = environment.get(JobExecutor.class);
      if (jobExecutor!=null) {
        Transaction transaction = environment.get(Transaction.class);
        if (transaction==null) {
          throw new JbpmException("no transaction in environment");
        }
        JobAddedNotification jobNotificator = new JobAddedNotification(jobExecutor);
        transaction.registerSynchronization(jobNotificator);
      }
    }

    return deleteThisJob;
  }
View Full Code Here


  }
 
  public void handle(ExecutionImpl execution, Exception exception) {
    if (isTransactional) {
      Environment environment = Environment.getCurrent();
      Transaction transaction = (environment!=null ? environment.get(Transaction.class) : null);
      if (transaction!=null) {
        log.trace("registering exception handler to "+transaction);
        CommandService commandService = environment.get(CommandService.class);
        if (commandService==null) {
          throw new JbpmException("environment doesn't have a command service for registering transactional exception handler", exception);
View Full Code Here

  /** This transaction will be marked for rollback.  A command will be associated with the
   * Transaction.EVENT_AFTERCOMPLETION (after the job locks of the current transaction are
   * released).  Then the command will update the job with the exception details in a separate
   * transaction. */
  protected void handleJobExecutionException(Environment environment, JobImpl<?> job, Throwable exception) {
    Transaction transaction = environment.get(Transaction.class);
    // transaction.setRollbackOnly();

    CommandService commandService = (CommandService) environment.get(CommandService.class);
    JobExceptionHandler jobExceptionHandler = new JobExceptionHandler(job.getDbid(), exception, commandService);
    transaction.registerSynchronization(jobExceptionHandler);
  }
View Full Code Here

      job.release();
      job.setRetries(decrementedRetries);
    job.setException(sw.toString());
     
      // notify the job executor after the transaction is completed
      Transaction transaction = environment.get(Transaction.class);
      JobExecutor jobExecutor = environment.get(JobExecutor.class);
      if ( (transaction!=null)
           && (jobExecutor!=null)
         ) {
        log.trace("registering job executor notifier with "+transaction);
        transaction.registerSynchronization(new JobAddedNotification(jobExecutor));
      }
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of org.jbpm.pvm.internal.env.Transaction

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.