if (commandInvocationContext.getThrowable() == null) { fireCommandContextClose(); flushSessions(); commandInvocationContext.trySetThrowable(exception); } finally { if (commandInvocationContext.getThrowable() == null) { transactionContext.commit(); commandInvocationContext.trySetThrowable(exception); if (commandInvocationContext.getThrowable() != null) { fireCommandFailed(commandInvocationContext.getThrowable()); if (shouldLogInfo(commandInvocationContext.getThrowable())) { LOG.infoException(commandInvocationContext.getThrowable()); else if (shouldLogFine(commandInvocationContext.getThrowable())) { LOG.debugException(commandInvocationContext.getThrowable()); LOG.errorException(commandInvocationContext.getThrowable()); commandInvocationContext.trySetThrowable(exception); } finally { closeSessions(commandInvocationContext); commandInvocationContext.trySetThrowable(exception);
ProcessApplicationReference targetProcessApplication = getTargetProcessApplication(nextInvocation.execution); if(requiresContextSwitch(targetProcessApplication)) { if(!nextInvocation.operation.isAsyncCapable()) { invokeNext(); while (! queuedInvocations.isEmpty()) { invokeNext();
public Void call() throws Exception { performNext(); return null; }
CommandInvocationContext commandInvocationContext = new CommandInvocationContext(command); Context.setCommandInvocationContext(commandInvocationContext); commandInvocationContext.trySetThrowable(t); context.close(commandInvocationContext); } else { commandInvocationContext.rethrow();
public void performOperationAsync(AtomicOperation executionOperation, ExecutionEntity execution) { performOperation(executionOperation, execution, true); }
public Object execute(CommandContext commandContext) { CommandExecutor commandExecutor = Context.getProcessEngineConfiguration().getCommandExecutorTxRequired(); try { commandExecutor.execute(innerCommand); fail("exception expected to pop up during execution of inner command"); } catch (IdentifiableRuntimeException e) { // happy path assertNull("the exception should not have been propagated to this command's context", Context.getCommandInvocationContext().getThrowable()); } return null; } });
protected void closeSessions(CommandInvocationContext commandInvocationContext) { for (Session session : sessionList) { try { session.close(); } catch (Throwable exception) { commandInvocationContext.trySetThrowable(exception); } } }
CommandInvocationContext commandInvocationContext = new CommandInvocationContext(command); Context.setCommandInvocationContext(commandInvocationContext); commandInvocationContext.trySetThrowable(t); context.close(commandInvocationContext); } else { commandInvocationContext.rethrow();
public void performOperation(AtomicOperation executionOperation, ExecutionEntity execution) { performOperation(executionOperation, execution, false); }
public void testConcurrentHistoryCleanupJobReconfigurationExecution() throws InterruptedException { getProcessEngine().getHistoryService().cleanUpHistoryAsync(true); ThreadControl thread1 = executeControllableCommand(new ControllableJobExecutionCommand()); thread1.reportInterrupts(); thread1.waitForSync(); ControllableProcessEngineBootstrapCommand bootstrapCommand = new ControllableProcessEngineBootstrapCommand(); ThreadControl thread2 = executeControllableCommand(bootstrapCommand); thread2.reportInterrupts(); thread2.waitForSync(); thread1.makeContinue(); thread1.waitForSync(); thread2.makeContinue(); Thread.sleep(2000); thread1.waitUntilDone(); thread2.waitForSync(); thread2.waitUntilDone(true); assertNull(thread1.getException()); assertNull(thread2.getException()); assertNull(bootstrapCommand.getContextSpy().getThrowable()); assertNotNull(ProcessEngines.getProcessEngines().get(PROCESS_ENGINE_NAME)); }
protected void closeSessions(CommandInvocationContext commandInvocationContext) { for (Session session : sessionList) { try { session.close(); } catch (Throwable exception) { commandInvocationContext.trySetThrowable(exception); } } }
if (commandInvocationContext.getThrowable() == null) { fireCommandContextClose(); flushSessions(); commandInvocationContext.trySetThrowable(exception); } finally { if (commandInvocationContext.getThrowable() == null) { transactionContext.commit(); commandInvocationContext.trySetThrowable(exception); if (commandInvocationContext.getThrowable() != null) { fireCommandFailed(commandInvocationContext.getThrowable()); if (shouldLogInfo(commandInvocationContext.getThrowable())) { LOG.infoException(commandInvocationContext.getThrowable()); else if (shouldLogFine(commandInvocationContext.getThrowable())) { LOG.debugException(commandInvocationContext.getThrowable()); LOG.errorException(commandInvocationContext.getThrowable()); commandInvocationContext.trySetThrowable(exception); } finally { closeSessions(commandInvocationContext); commandInvocationContext.trySetThrowable(exception);
ProcessApplicationReference targetProcessApplication = getTargetProcessApplication(nextInvocation.execution); if(requiresContextSwitch(targetProcessApplication)) { if(!nextInvocation.operation.isAsyncCapable()) { invokeNext(); while (! queuedInvocations.isEmpty()) { invokeNext();
CommandInvocationContext commandInvocationContext = new CommandInvocationContext(command); Context.setCommandInvocationContext(commandInvocationContext); commandInvocationContext.trySetThrowable(t); context.close(commandInvocationContext); } else { commandInvocationContext.rethrow();
public void performOperationAsync(AtomicOperation executionOperation, ExecutionEntity execution) { performOperation(executionOperation, execution, true); }
public Object execute(CommandContext commandContext) { CommandExecutor commandExecutor = Context.getProcessEngineConfiguration().getCommandExecutorTxRequired(); try { commandExecutor.execute(innerCommand); fail("exception expected to pop up during execution of inner command"); } catch (IdentifiableRuntimeException e) { // happy path assertNull("the exception should not have been propagated to this command's context", Context.getCommandInvocationContext().getThrowable()); } return null; } });
public void rollback() { try { try { LOG.debugTransactionOperation("firing event rollback..."); fireTransactionEvent(TransactionState.ROLLINGBACK); } catch (Throwable exception) { LOG.exceptionWhileFiringEvent(TransactionState.ROLLINGBACK, exception); Context.getCommandInvocationContext().trySetThrowable(exception); } finally { LOG.debugTransactionOperation("rolling back the persistence session..."); getPersistenceProvider().rollback(); } } catch (Throwable exception) { LOG.exceptionWhileFiringEvent(TransactionState.ROLLINGBACK, exception); Context.getCommandInvocationContext().trySetThrowable(exception); } finally { LOG.debugFiringEventRolledBack(); fireTransactionEvent(TransactionState.ROLLED_BACK); } }
public Void call() throws Exception { performNext(); return null; }
if (commandInvocationContext.getThrowable() == null) { fireCommandContextClose(); flushSessions(); commandInvocationContext.trySetThrowable(exception); } finally { if (commandInvocationContext.getThrowable() == null) { transactionContext.commit(); commandInvocationContext.trySetThrowable(exception); if (commandInvocationContext.getThrowable() != null) { fireCommandFailed(commandInvocationContext.getThrowable()); if (shouldLogInfo(commandInvocationContext.getThrowable())) { LOG.infoException(commandInvocationContext.getThrowable()); else if (shouldLogFine(commandInvocationContext.getThrowable())) { LOG.debugException(commandInvocationContext.getThrowable()); LOG.errorException(commandInvocationContext.getThrowable()); commandInvocationContext.trySetThrowable(exception); } finally { closeSessions(commandInvocationContext); commandInvocationContext.trySetThrowable(exception);
ProcessApplicationReference targetProcessApplication = getTargetProcessApplication(nextInvocation.execution); if(requiresContextSwitch(targetProcessApplication)) { if(!nextInvocation.operation.isAsyncCapable()) { invokeNext(); while (! queuedInvocations.isEmpty()) { invokeNext();