Search in sources :

Example 91 with CommandContext

use of org.camunda.bpm.engine.impl.interceptor.CommandContext in project camunda-bpm-platform by camunda.

the class DecisionDefinitionEntity method loadDecisionDefinition.

/**
 * Returns the cached version if exists; does not update the entity from the database in that case
 */
protected DecisionDefinitionEntity loadDecisionDefinition(String decisionDefinitionId) {
    ProcessEngineConfigurationImpl configuration = Context.getProcessEngineConfiguration();
    DeploymentCache deploymentCache = configuration.getDeploymentCache();
    DecisionDefinitionEntity decisionDefinition = deploymentCache.findDecisionDefinitionFromCache(decisionDefinitionId);
    if (decisionDefinition == null) {
        CommandContext commandContext = Context.getCommandContext();
        DecisionDefinitionManager decisionDefinitionManager = commandContext.getDecisionDefinitionManager();
        decisionDefinition = decisionDefinitionManager.findDecisionDefinitionById(decisionDefinitionId);
        if (decisionDefinition != null) {
            decisionDefinition = deploymentCache.resolveDecisionDefinition(decisionDefinition);
        }
    }
    return decisionDefinition;
}
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 92 with CommandContext

use of org.camunda.bpm.engine.impl.interceptor.CommandContext in project camunda-bpm-platform by camunda.

the class ExternalTaskEntity method produceHistoricExternalTaskDeletedEvent.

protected void produceHistoricExternalTaskDeletedEvent() {
    CommandContext commandContext = Context.getCommandContext();
    commandContext.getHistoricExternalTaskLogManager().fireExternalTaskDeletedEvent(this);
}
Also used : CommandContext(org.camunda.bpm.engine.impl.interceptor.CommandContext)

Example 93 with CommandContext

use of org.camunda.bpm.engine.impl.interceptor.CommandContext in project camunda-bpm-platform by camunda.

the class ExternalTaskEntity method deleteFromExecutionAndRuntimeTable.

protected void deleteFromExecutionAndRuntimeTable() {
    getExecution().removeExternalTask(this);
    CommandContext commandContext = Context.getCommandContext();
    commandContext.getExternalTaskManager().delete(this);
    // Also delete the external tasks's error details byte array
    if (errorDetailsByteArrayId != null) {
        commandContext.getByteArrayManager().deleteByteArrayById(errorDetailsByteArrayId);
    }
}
Also used : CommandContext(org.camunda.bpm.engine.impl.interceptor.CommandContext)

Example 94 with CommandContext

use of org.camunda.bpm.engine.impl.interceptor.CommandContext in project camunda-bpm-platform by camunda.

the class ExternalTaskEntity method produceHistoricExternalTaskSuccessfulEvent.

protected void produceHistoricExternalTaskSuccessfulEvent() {
    CommandContext commandContext = Context.getCommandContext();
    commandContext.getHistoricExternalTaskLogManager().fireExternalTaskSuccessfulEvent(this);
}
Also used : CommandContext(org.camunda.bpm.engine.impl.interceptor.CommandContext)

Example 95 with CommandContext

use of org.camunda.bpm.engine.impl.interceptor.CommandContext in project camunda-bpm-platform by camunda.

the class ExternalTaskEntity method produceHistoricExternalTaskCreatedEvent.

protected void produceHistoricExternalTaskCreatedEvent() {
    CommandContext commandContext = Context.getCommandContext();
    commandContext.getHistoricExternalTaskLogManager().fireExternalTaskCreatedEvent(this);
}
Also used : CommandContext(org.camunda.bpm.engine.impl.interceptor.CommandContext)

Aggregations

CommandContext (org.camunda.bpm.engine.impl.interceptor.CommandContext)120 CommandExecutor (org.camunda.bpm.engine.impl.interceptor.CommandExecutor)31 List (java.util.List)17 ProcessEngineConfigurationImpl (org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl)17 JobEntity (org.camunda.bpm.engine.impl.persistence.entity.JobEntity)11 Deployment (org.camunda.bpm.engine.test.Deployment)11 ArrayList (java.util.ArrayList)10 ProcessDefinitionEntity (org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity)10 Date (java.util.Date)9 HistoricIncident (org.camunda.bpm.engine.history.HistoricIncident)8 DeploymentCache (org.camunda.bpm.engine.impl.persistence.deploy.cache.DeploymentCache)8 JobManager (org.camunda.bpm.engine.impl.persistence.entity.JobManager)8 Command (org.camunda.bpm.engine.impl.interceptor.Command)6 HistoricIncidentEntity (org.camunda.bpm.engine.impl.persistence.entity.HistoricIncidentEntity)6 After (org.junit.After)6 ProcessApplicationReference (org.camunda.bpm.application.ProcessApplicationReference)5 RepositoryService (org.camunda.bpm.engine.RepositoryService)5 ProcessEngineImpl (org.camunda.bpm.engine.impl.ProcessEngineImpl)5 ExecutionEntity (org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity)5 HistoricDecisionInstance (org.camunda.bpm.engine.history.HistoricDecisionInstance)4