use of org.camunda.bpm.engine.impl.ProcessEngineImpl in project camunda-bpm-platform by camunda.
the class DbSchemaPrune method main.
public static void main(String[] args) {
ProcessEngineImpl processEngine = (ProcessEngineImpl) ProcessEngines.getDefaultProcessEngine();
CommandExecutor commandExecutor = processEngine.getProcessEngineConfiguration().getCommandExecutorTxRequired();
commandExecutor.execute(new Command<Object>() {
public Object execute(CommandContext commandContext) {
commandContext.getSession(PersistenceSession.class).dbSchemaPrune();
return null;
}
});
}
use of org.camunda.bpm.engine.impl.ProcessEngineImpl in project camunda-bpm-platform by camunda.
the class DbSchemaDrop method main.
public static void main(String[] args) {
ProcessEngineImpl processEngine = (ProcessEngineImpl) ProcessEngines.getDefaultProcessEngine();
CommandExecutor commandExecutor = processEngine.getProcessEngineConfiguration().getCommandExecutorTxRequired();
commandExecutor.execute(new Command<Object>() {
public Object execute(CommandContext commandContext) {
commandContext.getSession(PersistenceSession.class).dbSchemaDrop();
return null;
}
});
processEngine.close();
}
use of org.camunda.bpm.engine.impl.ProcessEngineImpl in project camunda-bpm-platform by camunda.
the class StringUtil method fromBytes.
/**
* converts a byte array into a string using the provided process engine's default charset as
* returned by {@link ProcessEngineConfigurationImpl#getDefaultCharset()}
*
* @param bytes the byte array
* @param processEngine the process engine
* @return a string representing the bytes
*/
public static String fromBytes(byte[] bytes, ProcessEngine processEngine) {
ProcessEngineConfigurationImpl processEngineConfiguration = ((ProcessEngineImpl) processEngine).getProcessEngineConfiguration();
Charset charset = processEngineConfiguration.getDefaultCharset();
return new String(bytes, charset);
}
use of org.camunda.bpm.engine.impl.ProcessEngineImpl in project camunda-bpm-platform by camunda.
the class StringUtil method toByteArray.
/**
* Gets the bytes from a string using the provided process engine's default charset
*
* @param string the string to get the bytes form
* @param processEngine the process engine to use
* @return the byte array
*/
public static byte[] toByteArray(String string, ProcessEngine processEngine) {
ProcessEngineConfigurationImpl processEngineConfiguration = ((ProcessEngineImpl) processEngine).getProcessEngineConfiguration();
Charset charset = processEngineConfiguration.getDefaultCharset();
return string.getBytes(charset);
}
use of org.camunda.bpm.engine.impl.ProcessEngineImpl in project camunda-bpm-platform by camunda.
the class DatabaseHistoryPropertyAutoTest method usesDefaultValueAuditWhenNoValueIsConfigured.
@Test
public void usesDefaultValueAuditWhenNoValueIsConfigured() {
final ProcessEngineConfigurationImpl config = config("true", ProcessEngineConfiguration.HISTORY_AUTO);
ProcessEngineImpl processEngine = buildEngine(config);
final Integer level = config.getCommandExecutorSchemaOperations().execute(new Command<Integer>() {
@Override
public Integer execute(CommandContext commandContext) {
return HistoryLevelSetupCommand.databaseHistoryLevel(commandContext);
}
});
assertThat(level, equalTo(HistoryLevel.HISTORY_LEVEL_AUDIT.getId()));
assertThat(processEngine.getProcessEngineConfiguration().getHistoryLevel(), equalTo(HistoryLevel.HISTORY_LEVEL_AUDIT));
}
Aggregations