Search in sources :

Example 16 with ProcessEngineConfigurationImpl

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();
    }
}
Also used : ProcessEngineConfigurationImpl(org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl)

Example 17 with ProcessEngineConfigurationImpl

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();
        }
    }
}
Also used : JobExecutorContext(org.camunda.bpm.engine.impl.jobexecutor.JobExecutorContext) DbEntityCache(org.camunda.bpm.engine.impl.db.entitymanager.cache.DbEntityCache) ProcessEngineConfigurationImpl(org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl)

Example 18 with ProcessEngineConfigurationImpl

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;
}
Also used : CommandContext(org.camunda.bpm.engine.impl.interceptor.CommandContext) DeploymentCache(org.camunda.bpm.engine.impl.persistence.deploy.cache.DeploymentCache) ProcessEngineConfigurationImpl(org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl)

Example 19 with ProcessEngineConfigurationImpl

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);
}
Also used : ProcessEngineConfigurationImpl(org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl) Date(java.util.Date)

Example 20 with ProcessEngineConfigurationImpl

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);
            }
        });
    }
}
Also used : HistoryLevel(org.camunda.bpm.engine.impl.history.HistoryLevel) HistoryEventProcessor(org.camunda.bpm.engine.impl.history.event.HistoryEventProcessor) HistoryEventProducer(org.camunda.bpm.engine.impl.history.producer.HistoryEventProducer) HistoryEvent(org.camunda.bpm.engine.impl.history.event.HistoryEvent) ProcessEngineConfigurationImpl(org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl)

Aggregations

ProcessEngineConfigurationImpl (org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl)161 Test (org.junit.Test)35 HistoryLevel (org.camunda.bpm.engine.impl.history.HistoryLevel)22 DeploymentCache (org.camunda.bpm.engine.impl.persistence.deploy.cache.DeploymentCache)18 ProcessEngine (org.camunda.bpm.engine.ProcessEngine)17 CommandContext (org.camunda.bpm.engine.impl.interceptor.CommandContext)17 HistoryEvent (org.camunda.bpm.engine.impl.history.event.HistoryEvent)13 HistoryEventProcessor (org.camunda.bpm.engine.impl.history.event.HistoryEventProcessor)12 HistoryEventProducer (org.camunda.bpm.engine.impl.history.producer.HistoryEventProducer)12 Before (org.junit.Before)11 CommandChecker (org.camunda.bpm.engine.impl.cfg.CommandChecker)8 ProcessDefinitionEntity (org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity)8 After (org.junit.After)8 Date (java.util.Date)7 PooledDataSource (org.apache.ibatis.datasource.pooled.PooledDataSource)7 ProcessApplicationReference (org.camunda.bpm.application.ProcessApplicationReference)7 DefaultDmnEngineConfiguration (org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration)7 IdentityService (org.camunda.bpm.engine.IdentityService)7 ProcessEngineImpl (org.camunda.bpm.engine.impl.ProcessEngineImpl)7 ProcessInstance (org.camunda.bpm.engine.runtime.ProcessInstance)6