public void fireExternalTaskAvailableEvent() { Context.getCommandContext() .getTransactionContext() .addTransactionListener(TransactionState.COMMITTED, new TransactionListener() { @Override public void execute(CommandContext commandContext) { ProcessEngineImpl.EXT_TASK_CONDITIONS.signalAll(); } }); } }
protected boolean isTransactionNotActive() { return !Context.getCommandContext().getTransactionContext().isTransactionActive(); }
public Void execute(CommandContext commandContext) { DbEntityManagerFactory dbEntityManagerFactory = new DbEntityManagerFactory(Context.getProcessEngineConfiguration().getIdGenerator()); DbEntityManager entityManager = dbEntityManagerFactory.openSession(); JobEntity job = entityManager.selectById(JobEntity.class, JOB_ENTITY_ID); job.setLockOwner(lockOwner); entityManager.forceUpdate(job); monitor.sync(); // flush the changed entity and create a lock for the table entityManager.flush(); monitor.sync(); // commit transaction and remove the lock commandContext.getTransactionContext().commit(); return null; }
public Void execute(CommandContext commandContext) { DbEntityManagerFactory dbEntityManagerFactory = new DbEntityManagerFactory(Context.getProcessEngineConfiguration().getIdGenerator()); DbEntityManager entityManager = dbEntityManagerFactory.openSession(); JobEntity job = entityManager.selectById(JobEntity.class, JOB_ENTITY_ID); job.setLockOwner(lockOwner); entityManager.forceUpdate(job); monitor.sync(); // flush the changed entity and create a lock for the table entityManager.flush(); monitor.sync(); // commit transaction and remove the lock commandContext.getTransactionContext().commit(); return null; }
public void fireExternalTaskAvailableEvent() { Context.getCommandContext() .getTransactionContext() .addTransactionListener(TransactionState.COMMITTED, new TransactionListener() { @Override public void execute(CommandContext commandContext) { ProcessEngineImpl.EXT_TASK_CONDITIONS.signalAll(); } }); } }
protected boolean isTransactionNotActive() { return !Context.getCommandContext().getTransactionContext().isTransactionActive(); }
transactionContext.addTransactionListener(TransactionState.COMMITTED, jpaTransactionCommitListener); transactionContext.addTransactionListener(TransactionState.ROLLED_BACK, jpaTransactionRollbackListener);
protected boolean isTransactionNotActive() { return !Context.getCommandContext().getTransactionContext().isTransactionActive(); }
transactionContext.addTransactionListener(TransactionState.COMMITTED, jpaTransactionCommitListener); transactionContext.addTransactionListener(TransactionState.ROLLED_BACK, jpaTransactionRollbackListener);
public Void execute(CommandContext commandContext) { commandContext.getTransactionContext().addTransactionListener(TransactionState.ROLLED_BACK, rolledBackListener); commandContext.getTransactionContext().addTransactionListener(TransactionState.COMMITTED, committedListener); return null; }
public Void execute(CommandContext commandContext) { commandContext.getTransactionContext().addTransactionListener(TransactionState.ROLLED_BACK, rolledBackListener); commandContext.getTransactionContext().addTransactionListener(TransactionState.COMMITTED, committedListener); throw new RuntimeException("Booum! Rollback!"); }
public void notify(final DelegateExecution execution) throws Exception { final String runId = (String) execution.getVariable(PerfTestConstants.RUN_ID); CommandContext commandContext = Context.getCommandContext(); if (runId != null && commandContext != null) { commandContext.getTransactionContext() .addTransactionListener(TransactionState.COMMITTED, new TransactionListener() { public void execute(CommandContext commandContext) { // signal run after the transaction was committed PerfTestRunner.signalRun(runId); } }); } }
protected void notifyAcquisition(CommandContext commandContext) { JobExecutor jobExecutor = Context.getProcessEngineConfiguration().getJobExecutor(); MessageAddedNotification messageAddedNotification = new MessageAddedNotification(jobExecutor); TransactionContext transactionContext = commandContext.getTransactionContext(); transactionContext.addTransactionListener(TransactionState.COMMITTED, messageAddedNotification); } }
protected void notifyAcquisition(CommandContext commandContext) { JobExecutor jobExecutor = Context.getProcessEngineConfiguration().getJobExecutor(); MessageAddedNotification messageAddedNotification = new MessageAddedNotification(jobExecutor); TransactionContext transactionContext = commandContext.getTransactionContext(); transactionContext.addTransactionListener(TransactionState.COMMITTED, messageAddedNotification); } }
public void execute(HistoryCleanupJobHandlerConfiguration configuration, ExecutionEntity execution, CommandContext commandContext, String tenantId) { HistoryCleanupHandler cleanupHandler = initCleanupHandler(configuration, commandContext); if (configuration.isImmediatelyDue() || isWithinBatchWindow(commandContext) ) { cleanupHandler.performCleanup(); } commandContext.getTransactionContext() .addTransactionListener(TransactionState.COMMITTED, cleanupHandler); }
@Override public void execute(DelegateExecution execution) throws Exception { Context.getCommandContext().getTransactionContext().addTransactionListener(TransactionState.COMMITTING, new TransactionListener() { @Override public void execute(CommandContext context) { throw new RuntimeException("exception in transaction listener"); } }); }
public void execute(HistoryCleanupJobHandlerConfiguration configuration, ExecutionEntity execution, CommandContext commandContext, String tenantId) { HistoryCleanupHandler cleanupHandler = initCleanupHandler(configuration, commandContext); if (configuration.isImmediatelyDue() || isWithinBatchWindow(commandContext) ) { cleanupHandler.performCleanup(); } commandContext.getTransactionContext() .addTransactionListener(TransactionState.COMMITTED, cleanupHandler); }