protected void executeCloseListenersAfterSessionFlushed() { if (closeListeners != null) { try { for (CommandContextCloseListener listener : closeListeners) { listener.afterSessionsFlush(this); } } catch (Throwable exception) { exception(exception); } } }
@Override public void execute(CommandContext commandContext) { CommandExecutor commandExecutor = commandContext.getProcessEngineConfiguration().getCommandExecutor(); CommandConfig commandConfig = new CommandConfig(false, TransactionPropagation.REQUIRES_NEW); commandExecutor.execute(commandConfig, new Command<Void>() { public Void execute(CommandContext commandContext) { listener.notify(scope.getProcessInstanceId(), scope.getExecutionId(), scope.getTask(), scope.getExecutionVariables(), scope.getCustomPropertiesMap()); return null; } }); }
public String databaseSchemaUpgrade(final Connection connection, final String catalog, final String schema) { CommandConfig config = commandExecutor.getDefaultConfig().transactionNotSupported(); return commandExecutor.execute(config, new Command<String>() { public String execute(CommandContext commandContext) { DbSqlSessionFactory dbSqlSessionFactory = (DbSqlSessionFactory) commandContext.getSessionFactories().get(DbSqlSession.class); DbSqlSession dbSqlSession = new DbSqlSession(dbSqlSessionFactory, commandContext.getEntityCache(), connection, catalog, schema); commandContext.getSessions().put(DbSqlSession.class, dbSqlSession); return dbSqlSession.dbSchemaUpdate(); } }); }
public TablePage listPage(int firstResult, int maxResults) { this.firstResult = firstResult; this.maxResults = maxResults; return commandExecutor.execute(this); }
@Override public <T> T execute(CommandConfig config, Command<T> command) { if (calledInsideTransaction()) { log.trace("Called inside transaction, skipping the retry interceptor."); return next.execute(config, command); } else { return super.execute(config, command); } }
public void initCommandContextFactory() { if (commandContextFactory == null) { commandContextFactory = new CommandContextFactory(); } commandContextFactory.setProcessEngineConfiguration(this); }
public void initSchemaCommandConfig() { if (schemaCommandConfig == null) { schemaCommandConfig = new CommandConfig().transactionNotSupported(); } }
@Override public void initDefaultCommandConfig() { if (defaultCommandConfig == null) { defaultCommandConfig = new CommandConfig().setContextReusePossible(true); } }
public CommandConfig setContextReusePossible(boolean contextReusePossible) { CommandConfig config = new CommandConfig(this); config.contextReusePossible = contextReusePossible; return config; }
protected void executeCloseListenersCloseFailure() { if (closeListeners != null) { try { for (CommandContextCloseListener listener : closeListeners) { listener.closeFailure(this); } } catch (Throwable exception) { exception(exception); } } }
public void initCommandInvoker() { if (commandInvoker == null) { if (enableVerboseExecutionTreeLogging) { commandInvoker = new DebugCommandInvoker(); } else { commandInvoker = new CommandInvoker(); } } }
@SuppressWarnings("unchecked") public <T> T getGenericAttribute(String key) { if (attributes != null) { return (T) getAttribute(key); } return null; }
public AbstractOperation(CommandContext commandContext, ExecutionEntity execution) { this.commandContext = commandContext; this.execution = execution; this.agenda = commandContext.getAgenda(); }
@Override public void execute(CommandContext commandContext) { CommandExecutor commandExecutor = commandContext.getProcessEngineConfiguration().getCommandExecutor(); CommandConfig commandConfig = new CommandConfig(false, TransactionPropagation.REQUIRES_NEW); commandExecutor.execute(commandConfig, new Command<Void>() { public Void execute(CommandContext commandContext) { listener.notify(scope.getProcessInstanceId(), scope.getExecutionId(), scope.getFlowElement(), scope.getExecutionVariables(), scope.getCustomPropertiesMap()); return null; } }); }
public DeploymentBuilder createDeployment() { return commandExecutor.execute(new Command<DeploymentBuilder>() { @Override public DeploymentBuilder execute(CommandContext commandContext) { return new DeploymentBuilderImpl(RepositoryServiceImpl.this); } }); }
public CommandConfig transactionRequired() { CommandConfig config = new CommandConfig(this); config.propagation = TransactionPropagation.REQUIRED; return config; }
public CommandConfig transactionRequiresNew() { CommandConfig config = new CommandConfig(); config.contextReusePossible = false; config.propagation = TransactionPropagation.REQUIRES_NEW; return config; }