use of org.camunda.bpm.engine.impl.persistence.deploy.cache.DeploymentCache in project camunda-bpm-platform by camunda.
the class GetDeploymentDecisionRequirementsDefinitionCmd method execute.
public DecisionRequirementsDefinition execute(CommandContext commandContext) {
ensureNotNull("decisionRequirementsDefinitionId", decisionRequirementsDefinitionId);
DeploymentCache deploymentCache = Context.getProcessEngineConfiguration().getDeploymentCache();
DecisionRequirementsDefinitionEntity decisionRequirementsDefinition = deploymentCache.findDeployedDecisionRequirementsDefinitionById(decisionRequirementsDefinitionId);
for (CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) {
checker.checkReadDecisionRequirementsDefinition(decisionRequirementsDefinition);
}
return decisionRequirementsDefinition;
}
use of org.camunda.bpm.engine.impl.persistence.deploy.cache.DeploymentCache in project camunda-bpm-platform by camunda.
the class GetDeploymentDecisionDefinitionCmd method execute.
public DecisionDefinition execute(CommandContext commandContext) {
ensureNotNull("decisionDefinitionId", decisionDefinitionId);
DeploymentCache deploymentCache = Context.getProcessEngineConfiguration().getDeploymentCache();
DecisionDefinitionEntity decisionDefinition = deploymentCache.findDeployedDecisionDefinitionById(decisionDefinitionId);
for (CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) {
checker.checkReadDecisionDefinition(decisionDefinition);
}
return decisionDefinition;
}
use of org.camunda.bpm.engine.impl.persistence.deploy.cache.DeploymentCache 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;
}
use of org.camunda.bpm.engine.impl.persistence.deploy.cache.DeploymentCache in project camunda-bpm-platform by camunda.
the class SignalEventHandler method handleStartEvent.
protected void handleStartEvent(EventSubscriptionEntity eventSubscription, Map<String, Object> payload, String businessKey, CommandContext commandContext) {
String processDefinitionId = eventSubscription.getConfiguration();
ensureNotNull("Configuration of signal start event subscription '" + eventSubscription.getId() + "' contains no process definition id.", processDefinitionId);
DeploymentCache deploymentCache = Context.getProcessEngineConfiguration().getDeploymentCache();
ProcessDefinitionEntity processDefinition = deploymentCache.findDeployedProcessDefinitionById(processDefinitionId);
if (processDefinition == null || processDefinition.isSuspended()) {
// ignore event subscription
LOG.debugIgnoringEventSubscription(eventSubscription, processDefinitionId);
} else {
ActivityImpl signalStartEvent = processDefinition.findActivity(eventSubscription.getActivityId());
PvmProcessInstance processInstance = processDefinition.createProcessInstance(businessKey, signalStartEvent);
processInstance.start(payload);
}
}
use of org.camunda.bpm.engine.impl.persistence.deploy.cache.DeploymentCache in project camunda-bpm-platform by camunda.
the class DeploymentManager method deleteDecisionRequirementDeployment.
protected void deleteDecisionRequirementDeployment(String deploymentId) {
ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
if (processEngineConfiguration.isDmnEnabled()) {
DecisionRequirementsDefinitionManager manager = getDecisionRequirementsDefinitionManager();
List<DecisionRequirementsDefinition> decisionRequirementsDefinitions = manager.findDecisionRequirementsDefinitionByDeploymentId(deploymentId);
// delete decision requirements definitions from db
manager.deleteDecisionRequirementsDefinitionsByDeploymentId(deploymentId);
DeploymentCache deploymentCache = processEngineConfiguration.getDeploymentCache();
for (DecisionRequirementsDefinition decisionRequirementsDefinition : decisionRequirementsDefinitions) {
String decisionDefinitionId = decisionRequirementsDefinition.getId();
// remove decision requirements definitions from cache:
deploymentCache.removeDecisionRequirementsDefinition(decisionDefinitionId);
}
}
}
Aggregations