public void initDefaultCommandConfig() { if (defaultCommandConfig == null) { defaultCommandConfig = new CommandConfig(); } }
public CommandConfig transactionNotSupported() { CommandConfig config = new CommandConfig(); config.contextReusePossible = false; config.propagation = TransactionPropagation.NOT_SUPPORTED; return config; } }
public CommandConfig setContextReusePossible(boolean contextReusePossible) { CommandConfig config = new CommandConfig(this); config.contextReusePossible = contextReusePossible; return config; }
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; }
public void initSchemaCommandConfig() { if (schemaCommandConfig == null) { schemaCommandConfig = new CommandConfig().transactionNotSupported(); } }
@Override public void initDefaultCommandConfig() { if (defaultCommandConfig == null) { defaultCommandConfig = new CommandConfig().setContextReusePossible(true); } }
@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; } }); }
@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; } }); }
CommandConfig config = new CommandConfig().transactionNotSupported(); commandExecutor.execute(config, new Command<Object>() { public Object execute(CommandContext commandContext) {
@Override public void closed(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) { if (log.isTraceEnabled()) { log.trace("notifying job executor of new job"); } asyncExecutor.executeAsyncJob(job); return null; } }); }
public static void main(String[] args) { ProcessEngineImpl processEngine = (ProcessEngineImpl) ProcessEngines.getDefaultProcessEngine(); CommandExecutor commandExecutor = processEngine.getProcessEngineConfiguration().getCommandExecutor(); CommandConfig config = new CommandConfig().transactionNotSupported(); commandExecutor.execute(config, new Command<Object>() { public Object execute(CommandContext commandContext) { commandContext.getDbSqlSession().dbSchemaDrop(); return null; } }); } }
public static void main(String[] args) { ProcessEngineImpl processEngine = (ProcessEngineImpl) ProcessEngines.getDefaultProcessEngine(); CommandExecutor commandExecutor = processEngine.getProcessEngineConfiguration().getCommandExecutor(); CommandConfig config = new CommandConfig().transactionNotSupported(); commandExecutor.execute(config, new Command<Object>() { public Object execute(CommandContext commandContext) { commandContext.getDbSqlSession().dbSchemaUpdate(); return null; } }); }
CommandConfig commandConfig = new CommandConfig(false, TransactionPropagation.REQUIRES_NEW); commandExecutor.execute(commandConfig, new Command<Void>() { public Void execute(CommandContext commandContext) {
public CommandConfig transactionRequiresNew() { CommandConfig config = new CommandConfig(); config.contextReusePossible = false; config.propagation = TransactionPropagation.REQUIRES_NEW; return config; }
public CommandConfig transactionNotSupported() { CommandConfig config = new CommandConfig(); config.contextReusePossible = false; config.propagation = TransactionPropagation.NOT_SUPPORTED; return config; } }
public CommandConfig setContextReusePossible(boolean contextReusePossible) { CommandConfig config = new CommandConfig(this); config.contextReusePossible = contextReusePossible; return config; }
public void initSchemaCommandConfig() { if (schemaCommandConfig == null) { schemaCommandConfig = new CommandConfig().transactionNotSupported(); } }
public static void main(String[] args) { ProcessEngineImpl processEngine = (ProcessEngineImpl) ProcessEngines.getDefaultProcessEngine(); CommandExecutor commandExecutor = processEngine.getProcessEngineConfiguration().getCommandExecutor(); CommandConfig config = new CommandConfig().transactionNotSupported(); commandExecutor.execute(config, new Command<Object>() { public Object execute(CommandContext commandContext) { commandContext.getDbSqlSession().dbSchemaUpdate(); return null; } }); }
public static void main(String[] args) { ProcessEngineImpl processEngine = (ProcessEngineImpl) ProcessEngines.getDefaultProcessEngine(); CommandExecutor commandExecutor = processEngine.getProcessEngineConfiguration().getCommandExecutor(); CommandConfig config = new CommandConfig().transactionNotSupported(); commandExecutor.execute(config, new Command<Object>() { public Object execute(CommandContext commandContext) { commandContext.getDbSqlSession().dbSchemaDrop(); return null; } }); } }