use of org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity in project camunda-bpm-platform by camunda.
the class ThrowEscalationEventActivityBehavior method leaveExecution.
protected void leaveExecution(ActivityExecution execution, final PvmActivity currentActivity, EscalationEventDefinition escalationEventDefinition) {
// execution tree could have been expanded by triggering a non-interrupting event
ExecutionEntity replacingExecution = ((ExecutionEntity) execution).getReplacedBy();
ExecutionEntity leavingExecution = (ExecutionEntity) (replacingExecution != null ? replacingExecution : execution);
leave(leavingExecution);
}
use of org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity in project camunda-bpm-platform by camunda.
the class UserTaskActivityBehavior method onParseMigratingInstance.
@Override
public void onParseMigratingInstance(MigratingInstanceParseContext parseContext, MigratingActivityInstance migratingInstance) {
ExecutionEntity execution = migratingInstance.resolveRepresentativeExecution();
for (TaskEntity task : execution.getTasks()) {
migratingInstance.addMigratingDependentInstance(new MigratingUserTaskInstance(task, migratingInstance));
parseContext.consume(task);
Collection<VariableInstanceEntity> variables = task.getVariablesInternal();
if (variables != null) {
for (VariableInstanceEntity variable : variables) {
// we don't need to represent task variables in the migrating instance structure because
// they are migrated by the MigratingTaskInstance as well
parseContext.consume(variable);
}
}
}
}
use of org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity in project camunda-bpm-platform by camunda.
the class AbstractCorrelateMessageCmd method checkAuthorization.
protected void checkAuthorization(CorrelationHandlerResult correlation) {
CommandContext commandContext = Context.getCommandContext();
for (CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) {
if (MessageCorrelationResultType.Execution.equals(correlation.getResultType())) {
ExecutionEntity execution = correlation.getExecutionEntity();
checker.checkUpdateProcessInstanceById(execution.getProcessInstanceId());
} else {
ProcessDefinitionEntity definition = correlation.getProcessDefinitionEntity();
checker.checkCreateProcessInstance(definition);
}
}
}
use of org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity in project camunda-bpm-platform by camunda.
the class AbstractDeleteProcessInstanceCmd method deleteProcessInstance.
protected void deleteProcessInstance(final CommandContext commandContext, String processInstanceId, final String deleteReason, final boolean skipCustomListeners, boolean externallyTerminated, final boolean skipIoMappings, boolean skipSubprocesses) {
ensureNotNull(BadUserRequestException.class, "processInstanceId is null", "processInstanceId", processInstanceId);
// fetch process instance
ExecutionManager executionManager = commandContext.getExecutionManager();
final ExecutionEntity execution = executionManager.findExecutionById(processInstanceId);
ensureNotNull(BadUserRequestException.class, "No process instance found for id '" + processInstanceId + "'", "processInstance", execution);
checkDeleteProcessInstance(execution, commandContext);
// delete process instance
commandContext.getExecutionManager().deleteProcessInstance(processInstanceId, deleteReason, false, skipCustomListeners, externallyTerminated, skipIoMappings, skipSubprocesses);
if (skipSubprocesses) {
List<ProcessInstance> superProcesslist = commandContext.getProcessEngineConfiguration().getRuntimeService().createProcessInstanceQuery().superProcessInstanceId(processInstanceId).list();
triggerHistoryEvent(superProcesslist);
}
final ExecutionEntity superExecution = execution.getSuperExecution();
if (superExecution != null) {
commandContext.runWithoutAuthorization(new Callable<Void>() {
public Void call() {
ProcessInstanceModificationBuilderImpl builder = (ProcessInstanceModificationBuilderImpl) new ProcessInstanceModificationBuilderImpl(commandContext, superExecution.getProcessInstanceId(), deleteReason).cancelActivityInstance(superExecution.getActivityInstanceId());
builder.execute(false, skipCustomListeners, skipIoMappings);
return null;
}
});
}
// create user operation log
commandContext.getOperationLogManager().logProcessInstanceOperation(UserOperationLogEntry.OPERATION_TYPE_DELETE, processInstanceId, null, null, Collections.singletonList(PropertyChange.EMPTY_CHANGE));
}
use of org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity in project camunda-bpm-platform by camunda.
the class AbstractVariableCmd method execute.
public Void execute(CommandContext commandContext) {
this.commandContext = commandContext;
AbstractVariableScope scope = getEntity();
executeOperation(scope);
ExecutionEntity contextExecution = getContextExecution();
if (contextExecution != null) {
contextExecution.dispatchDelayedEventsAndPerformOperation((Callback<PvmExecutionImpl, Void>) null);
}
if (!preventLogUserOperation) {
logVariableOperation(scope);
}
return null;
}
Aggregations