use of org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl in project camunda-bpm-platform by camunda.
the class AbstractPersistenceSession method dbSchemaDrop.
public void dbSchemaDrop() {
ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
if (processEngineConfiguration.isDmnEnabled()) {
dbSchemaDropDmn();
if (processEngineConfiguration.isDbHistoryUsed()) {
dbSchemaDropDmnHistory();
}
}
if (processEngineConfiguration.isCmmnEnabled()) {
dbSchemaDropCmmn();
}
dbSchemaDropEngine();
if (processEngineConfiguration.isCmmnEnabled() && processEngineConfiguration.isDbHistoryUsed()) {
dbSchemaDropCmmnHistory();
}
if (processEngineConfiguration.isDbHistoryUsed()) {
dbSchemaDropHistory();
}
if (processEngineConfiguration.isDbIdentityUsed()) {
dbSchemaDropIdentity();
}
}
use of org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl in project camunda-bpm-platform by camunda.
the class DbEntityManager method initializeEntityCache.
protected void initializeEntityCache() {
final JobExecutorContext jobExecutorContext = Context.getJobExecutorContext();
final ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
if (processEngineConfiguration != null && processEngineConfiguration.isDbEntityCacheReuseEnabled() && jobExecutorContext != null) {
dbEntityCache = jobExecutorContext.getEntityCache();
if (dbEntityCache == null) {
dbEntityCache = new DbEntityCache(processEngineConfiguration.getDbEntityCacheKeyMapping());
jobExecutorContext.setEntityCache(dbEntityCache);
}
} else {
if (processEngineConfiguration != null) {
dbEntityCache = new DbEntityCache(processEngineConfiguration.getDbEntityCacheKeyMapping());
} else {
dbEntityCache = new DbEntityCache();
}
}
}
use of org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl in project camunda-bpm-platform by camunda.
the class DecisionRequirementsDefinitionEntity method loadDecisionRequirementsDefinition.
/**
* Returns the cached version if exists; does not update the entity from the database in that case
*/
protected DecisionRequirementsDefinitionEntity loadDecisionRequirementsDefinition(String decisionRequirementsDefinitionId) {
ProcessEngineConfigurationImpl configuration = Context.getProcessEngineConfiguration();
DeploymentCache deploymentCache = configuration.getDeploymentCache();
DecisionRequirementsDefinitionEntity decisionRequirementsDefinition = deploymentCache.findDecisionRequirementsDefinitionFromCache(decisionRequirementsDefinitionId);
if (decisionRequirementsDefinition == null) {
CommandContext commandContext = Context.getCommandContext();
DecisionRequirementsDefinitionManager manager = commandContext.getDecisionRequirementsDefinitionManager();
decisionRequirementsDefinition = manager.findDecisionRequirementsDefinitionById(decisionRequirementsDefinitionId);
if (decisionRequirementsDefinition != null) {
decisionRequirementsDefinition = deploymentCache.resolveDecisionRequirementsDefinition(decisionRequirementsDefinition);
}
}
return decisionRequirementsDefinition;
}
use of org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl in project camunda-bpm-platform by camunda.
the class DbIdentityServiceProvider method isUserLocked.
protected boolean isUserLocked(UserEntity user) {
ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
int maxAttempts = processEngineConfiguration.getLoginMaxAttempts();
int attempts = user.getAttempts();
if (attempts >= maxAttempts) {
return true;
}
Date lockExpirationTime = user.getLockExpirationTime();
Date currentTime = ClockUtil.getCurrentTime();
return lockExpirationTime != null && lockExpirationTime.after(currentTime);
}
use of org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl in project camunda-bpm-platform by camunda.
the class ExecutionEntity method fireHistoricActivityInstanceUpdate.
// helper ///////////////////////////////////////////////////////////////////
public void fireHistoricActivityInstanceUpdate() {
ProcessEngineConfigurationImpl configuration = Context.getProcessEngineConfiguration();
HistoryLevel historyLevel = configuration.getHistoryLevel();
if (historyLevel.isHistoryEventProduced(HistoryEventTypes.ACTIVITY_INSTANCE_UPDATE, this)) {
// publish update event for current activity instance (containing the id
// of the sub process/case)
HistoryEventProcessor.processHistoryEvents(new HistoryEventProcessor.HistoryEventCreator() {
@Override
public HistoryEvent createHistoryEvent(HistoryEventProducer producer) {
return producer.createActivityInstanceUpdateEvt(ExecutionEntity.this);
}
});
}
}
Aggregations