use of org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl in project camunda-bpm-platform by camunda.
the class HistoryCleanupRestServiceImpl method getHistoryCleanupConfiguration.
public HistoryCleanupConfigurationDto getHistoryCleanupConfiguration() {
HistoryCleanupConfigurationDto configurationDto = new HistoryCleanupConfigurationDto();
Date startTime = ((ProcessEngineConfigurationImpl) processEngine.getProcessEngineConfiguration()).getHistoryCleanupBatchWindowStartTimeAsDate();
Date endTime = ((ProcessEngineConfigurationImpl) processEngine.getProcessEngineConfiguration()).getHistoryCleanupBatchWindowEndTimeAsDate();
if (startTime == null || endTime == null) {
return configurationDto;
}
Date now = ClockUtil.getCurrentTime();
Date startDate = HistoryCleanupHelper.getCurrentOrNextBatchWindowStartTime(now, startTime, endTime);
Date endDate = HistoryCleanupHelper.getNextBatchWindowEndTime(now, endTime);
configurationDto.setBatchWindowStartTime(startDate);
configurationDto.setBatchWindowEndTime(endDate);
return configurationDto;
}
use of org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl in project camunda-bpm-platform by camunda.
the class RegisterProcessApplicationCmd method execute.
public ProcessApplicationRegistration execute(CommandContext commandContext) {
commandContext.getAuthorizationManager().checkCamundaAdmin();
final ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
final ProcessApplicationManager processApplicationManager = processEngineConfiguration.getProcessApplicationManager();
return processApplicationManager.registerProcessApplicationForDeployments(deploymentsToRegister, reference);
}
use of org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl in project camunda-bpm-platform by camunda.
the class ReportDbMetricsCmd method execute.
public Void execute(CommandContext commandContext) {
ProcessEngineConfigurationImpl engineConfiguration = Context.getProcessEngineConfiguration();
if (!engineConfiguration.isMetricsEnabled()) {
throw new ProcessEngineException("Metrics reporting is disabled");
}
if (!engineConfiguration.isDbMetricsReporterActivate()) {
throw new ProcessEngineException("Metrics reporting to database is disabled");
}
DbMetricsReporter dbMetricsReporter = engineConfiguration.getDbMetricsReporter();
dbMetricsReporter.reportNow();
return null;
}
use of org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl in project camunda-bpm-platform by camunda.
the class GetDeployedStartFormCmd method checkAuthorization.
@Override
protected void checkAuthorization(CommandContext commandContext) {
ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
DeploymentCache deploymentCache = processEngineConfiguration.getDeploymentCache();
ProcessDefinitionEntity processDefinition = deploymentCache.findDeployedProcessDefinitionById(processDefinitionId);
for (CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) {
checker.checkReadProcessDefinition(processDefinition);
}
}
use of org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl in project camunda-bpm-platform by camunda.
the class GetRenderedStartFormCmd method execute.
public Object execute(CommandContext commandContext) {
ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
DeploymentCache deploymentCache = processEngineConfiguration.getDeploymentCache();
ProcessDefinitionEntity processDefinition = deploymentCache.findDeployedProcessDefinitionById(processDefinitionId);
ensureNotNull("Process Definition '" + processDefinitionId + "' not found", "processDefinition", processDefinition);
for (CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) {
checker.checkReadProcessDefinition(processDefinition);
}
StartFormHandler startFormHandler = processDefinition.getStartFormHandler();
if (startFormHandler == null) {
return null;
}
FormEngine formEngine = Context.getProcessEngineConfiguration().getFormEngines().get(formEngineName);
ensureNotNull("No formEngine '" + formEngineName + "' defined process engine configuration", "formEngine", formEngine);
StartFormData startForm = startFormHandler.createStartFormData(processDefinition);
Object renderedStartForm = null;
try {
renderedStartForm = formEngine.renderStartForm(startForm);
} catch (ScriptEvaluationException e) {
LOG.exceptionWhenStartFormScriptEvaluation(processDefinitionId, e);
}
return renderedStartForm;
}
Aggregations