use of org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity in project camunda-bpm-platform by camunda.
the class ModificationBatchJobHandler method postProcessJob.
@Override
protected void postProcessJob(ModificationBatchConfiguration configuration, JobEntity job) {
CommandContext commandContext = Context.getCommandContext();
ProcessDefinitionEntity processDefinitionEntity = commandContext.getProcessEngineConfiguration().getDeploymentCache().findDeployedProcessDefinitionById(configuration.getProcessDefinitionId());
job.setDeploymentId(processDefinitionEntity.getDeploymentId());
}
use of org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity in project camunda-bpm-platform by camunda.
the class RestartProcessInstancesBatchCmd method execute.
@Override
public Batch execute(CommandContext commandContext) {
List<AbstractProcessInstanceModificationCommand> instructions = builder.getInstructions();
Collection<String> processInstanceIds = collectProcessInstanceIds();
ensureNotEmpty(BadUserRequestException.class, "Restart instructions cannot be empty", "instructions", instructions);
ensureNotEmpty(BadUserRequestException.class, "Process instance ids cannot be empty", "processInstanceIds", processInstanceIds);
ensureNotContainsNull(BadUserRequestException.class, "Process instance ids cannot be null", "processInstanceIds", processInstanceIds);
commandContext.getAuthorizationManager().checkAuthorization(Permissions.CREATE, Resources.BATCH);
ProcessDefinitionEntity processDefinition = getProcessDefinition(commandContext, builder.getProcessDefinitionId());
;
ensureNotNull(BadUserRequestException.class, "Process definition cannot be null", processDefinition);
ensureTenantAuthorized(commandContext, processDefinition);
writeUserOperationLog(commandContext, processDefinition, processInstanceIds.size(), true);
ArrayList<String> ids = new ArrayList<String>();
ids.addAll(processInstanceIds);
BatchEntity batch = createBatch(commandContext, instructions, ids, processDefinition);
batch.createSeedJobDefinition();
batch.createMonitorJobDefinition();
batch.createBatchJobDefinition();
batch.fireHistoricStartEvent();
batch.createSeedJob();
return batch;
}
use of org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity in project camunda-bpm-platform by camunda.
the class RestartProcessInstancesJobHandler method postProcessJob.
@Override
protected void postProcessJob(RestartProcessInstancesBatchConfiguration configuration, JobEntity job) {
CommandContext commandContext = Context.getCommandContext();
ProcessDefinitionEntity processDefinitionEntity = commandContext.getProcessEngineConfiguration().getDeploymentCache().findDeployedProcessDefinitionById(configuration.getProcessDefinitionId());
job.setDeploymentId(processDefinitionEntity.getDeploymentId());
}
use of org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity in project camunda-bpm-platform by camunda.
the class AbstractCorrelateMessageCmd method instantiateProcess.
protected ProcessInstance instantiateProcess(CommandContext commandContext, CorrelationHandlerResult correlationResult) {
ProcessDefinitionEntity processDefinitionEntity = correlationResult.getProcessDefinitionEntity();
ActivityImpl messageStartEvent = processDefinitionEntity.findActivity(correlationResult.getStartEventActivityId());
ExecutionEntity processInstance = processDefinitionEntity.createProcessInstance(builder.getBusinessKey(), messageStartEvent);
processInstance.start(builder.getPayloadProcessInstanceVariables());
return processInstance;
}
use of org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity in project camunda-bpm-platform by camunda.
the class UpdateProcessDefinitionHistoryTimeToLiveCmd method execute.
public Void execute(CommandContext commandContext) {
checkAuthorization(commandContext);
ensureNotNull(BadUserRequestException.class, "processDefinitionId", processDefinitionId);
if (historyTimeToLive != null) {
ensureGreaterThanOrEqual(BadUserRequestException.class, "", "historyTimeToLive", historyTimeToLive, 0);
}
ProcessDefinitionEntity processDefinitionEntity = commandContext.getProcessDefinitionManager().findLatestProcessDefinitionById(processDefinitionId);
logUserOperation(commandContext, processDefinitionEntity);
processDefinitionEntity.setHistoryTimeToLive(historyTimeToLive);
return null;
}
Aggregations