@Override public boolean isDetached() { return userTask.getExecutionId() == null; }
@Override public boolean isDetached() { return userTask.getExecutionId() == null; }
public void checkDeleteTask(TaskEntity task) { String taskId = task.getId(); // Note: Calling TaskService#deleteTask() to // delete a task which exists in context of // a process instance or case instance cannot // be deleted. In such a case TaskService#deleteTask() // throws an exception before invoking the // authorization check. String executionId = task.getExecutionId(); String caseExecutionId = task.getCaseExecutionId(); if (executionId == null && caseExecutionId == null) { getAuthorizationManager().checkAuthorization(DELETE, TASK, taskId); } }
public void checkDeleteTask(TaskEntity task) { String taskId = task.getId(); // Note: Calling TaskService#deleteTask() to // delete a task which exists in context of // a process instance or case instance cannot // be deleted. In such a case TaskService#deleteTask() // throws an exception before invoking the // authorization check. String executionId = task.getExecutionId(); String caseExecutionId = task.getCaseExecutionId(); if (executionId == null && caseExecutionId == null) { getAuthorizationManager().checkAuthorization(DELETE, TASK, taskId); } }
protected void deleteTask(String taskId, CommandContext commandContext) { TaskManager taskManager = commandContext.getTaskManager(); TaskEntity task = taskManager.findTaskById(taskId); if (task != null) { if(task.getExecutionId() != null) { throw new ProcessEngineException("The task cannot be deleted because is part of a running process"); } else if (task.getCaseExecutionId() != null) { throw new ProcessEngineException("The task cannot be deleted because is part of a running case instance"); } checkDeleteTask(task, commandContext); String reason = (deleteReason == null || deleteReason.length() == 0) ? TaskEntity.DELETE_REASON_DELETED : deleteReason; task.delete(reason, cascade); } else if (cascade) { Context .getCommandContext() .getHistoricTaskInstanceManager() .deleteHistoricTaskInstanceById(taskId); } }
protected void deleteTask(String taskId, CommandContext commandContext) { TaskManager taskManager = commandContext.getTaskManager(); TaskEntity task = taskManager.findTaskById(taskId); if (task != null) { if(task.getExecutionId() != null) { throw new ProcessEngineException("The task cannot be deleted because is part of a running process"); } else if (task.getCaseExecutionId() != null) { throw new ProcessEngineException("The task cannot be deleted because is part of a running case instance"); } checkDeleteTask(task, commandContext); String reason = (deleteReason == null || deleteReason.length() == 0) ? TaskEntity.DELETE_REASON_DELETED : deleteReason; task.delete(reason, cascade); } else if (cascade) { Context .getCommandContext() .getHistoricTaskInstanceManager() .deleteHistoricTaskInstanceById(taskId); } }
ExecutionEntity execution = executionsMap.get(task.getExecutionId()); task.setExecution(execution); execution.addTask(task);
ExecutionEntity execution = executionsMap.get(task.getExecutionId()); task.setExecution(execution); execution.addTask(task);
public UserOperationLogContextEntryBuilder inContextOf(TaskEntity task, List<PropertyChange> propertyChanges) { if (propertyChanges == null || propertyChanges.isEmpty()) { if (OPERATION_TYPE_CREATE.equals(entry.getOperationType())) { propertyChanges = Arrays.asList(PropertyChange.EMPTY_CHANGE); } } entry.setPropertyChanges(propertyChanges); ResourceDefinitionEntity definition = task.getProcessDefinition(); if (definition != null) { entry.setProcessDefinitionKey(definition.getKey()); entry.setDeploymentId(definition.getDeploymentId()); } else if (task.getCaseDefinitionId() != null) { definition = task.getCaseDefinition(); entry.setDeploymentId(definition.getDeploymentId()); } entry.setProcessDefinitionId(task.getProcessDefinitionId()); entry.setProcessInstanceId(task.getProcessInstanceId()); entry.setExecutionId(task.getExecutionId()); entry.setCaseDefinitionId(task.getCaseDefinitionId()); entry.setCaseInstanceId(task.getCaseInstanceId()); entry.setCaseExecutionId(task.getCaseExecutionId()); entry.setTaskId(task.getId()); ExecutionEntity execution = task.getExecution(); if (execution != null) { entry.setRootProcessInstanceId(execution.getRootProcessInstanceId()); } return this; }
public UserOperationLogContextEntryBuilder inContextOf(TaskEntity task, List<PropertyChange> propertyChanges) { if (propertyChanges == null || propertyChanges.isEmpty()) { if (OPERATION_TYPE_CREATE.equals(entry.getOperationType())) { propertyChanges = Arrays.asList(PropertyChange.EMPTY_CHANGE); } } entry.setPropertyChanges(propertyChanges); ResourceDefinitionEntity definition = task.getProcessDefinition(); if (definition != null) { entry.setProcessDefinitionKey(definition.getKey()); entry.setDeploymentId(definition.getDeploymentId()); } else if (task.getCaseDefinitionId() != null) { definition = task.getCaseDefinition(); entry.setDeploymentId(definition.getDeploymentId()); } entry.setProcessDefinitionId(task.getProcessDefinitionId()); entry.setProcessInstanceId(task.getProcessInstanceId()); entry.setExecutionId(task.getExecutionId()); entry.setCaseDefinitionId(task.getCaseDefinitionId()); entry.setCaseInstanceId(task.getCaseInstanceId()); entry.setCaseExecutionId(task.getCaseExecutionId()); entry.setTaskId(task.getId()); ExecutionEntity execution = task.getExecution(); if (execution != null) { entry.setRootProcessInstanceId(execution.getRootProcessInstanceId()); } return this; }
public void checkUpdateTask(TaskEntity task) { String taskId = task.getId(); String executionId = task.getExecutionId(); if (executionId != null) {
public void checkUpdateTask(TaskEntity task) { String taskId = task.getId(); String executionId = task.getExecutionId(); if (executionId != null) {
String taskId = task.getId(); String executionId = task.getExecutionId(); if (executionId != null) {
String taskId = task.getId(); String executionId = task.getExecutionId(); if (executionId != null) {
String executionId = task.getExecutionId(); if (executionId != null) {
String executionId = task.getExecutionId(); if (executionId != null) {
String executionId = task.getExecutionId(); if (executionId != null) {
String executionId = task.getExecutionId(); if (executionId != null) {
String executionId = taskEntity.getExecutionId();
String executionId = taskEntity.getExecutionId();