use of org.camunda.bpm.engine.impl.interceptor.CommandContext in project camunda-bpm-platform by camunda.
the class HistoricTaskInstanceReportImpl method duration.
@Override
public List<DurationReportResult> duration(PeriodUnit periodUnit) {
ensureNotNull(NotValidException.class, "periodUnit", periodUnit);
this.durationPeriodUnit = periodUnit;
CommandContext commandContext = Context.getCommandContext();
if (commandContext == null) {
return commandExecutor.execute(new Command<List<DurationReportResult>>() {
@Override
public List<DurationReportResult> execute(CommandContext commandContext) {
return executeDuration(commandContext);
}
});
} else {
return executeDuration(commandContext);
}
}
use of org.camunda.bpm.engine.impl.interceptor.CommandContext in project camunda-bpm-platform by camunda.
the class DbSchemaPrune method main.
public static void main(String[] args) {
ProcessEngineImpl processEngine = (ProcessEngineImpl) ProcessEngines.getDefaultProcessEngine();
CommandExecutor commandExecutor = processEngine.getProcessEngineConfiguration().getCommandExecutorTxRequired();
commandExecutor.execute(new Command<Object>() {
public Object execute(CommandContext commandContext) {
commandContext.getSession(PersistenceSession.class).dbSchemaPrune();
return null;
}
});
}
use of org.camunda.bpm.engine.impl.interceptor.CommandContext in project camunda-bpm-platform by camunda.
the class DbSchemaDrop method main.
public static void main(String[] args) {
ProcessEngineImpl processEngine = (ProcessEngineImpl) ProcessEngines.getDefaultProcessEngine();
CommandExecutor commandExecutor = processEngine.getProcessEngineConfiguration().getCommandExecutorTxRequired();
commandExecutor.execute(new Command<Object>() {
public Object execute(CommandContext commandContext) {
commandContext.getSession(PersistenceSession.class).dbSchemaDrop();
return null;
}
});
processEngine.close();
}
use of org.camunda.bpm.engine.impl.interceptor.CommandContext 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.interceptor.CommandContext in project camunda-bpm-platform by camunda.
the class ExternalTaskEntity method produceHistoricExternalTaskFailedEvent.
protected void produceHistoricExternalTaskFailedEvent() {
CommandContext commandContext = Context.getCommandContext();
commandContext.getHistoricExternalTaskLogManager().fireExternalTaskFailedEvent(this);
}
Aggregations