@Override public void detachState() { userTask.getExecution().removeTask(userTask); userTask.setExecution(null); }
@Override public void detachState() { userTask.getExecution().removeTask(userTask); userTask.setExecution(null); }
protected void moveTasksTo(ExecutionEntity other) { // update the related tasks for (TaskEntity task : getTasksInternal()) { task.setExecution(other); // update the related local task variables Collection<VariableInstanceEntity> variables = task.getVariablesInternal(); for (VariableInstanceEntity variable : variables) { variable.setExecution(other); } other.addTask(task); } getTasksInternal().clear(); }
protected void moveTasksTo(ExecutionEntity other) { // update the related tasks for (TaskEntity task : getTasksInternal()) { task.setExecution(other); // update the related local task variables Collection<VariableInstanceEntity> variables = task.getVariablesInternal(); for (VariableInstanceEntity variable : variables) { variable.setExecution(other); } other.addTask(task); } getTasksInternal().clear(); }
@Override public void attachState(MigratingScopeInstance owningInstance) { ExecutionEntity representativeExecution = owningInstance.resolveRepresentativeExecution(); representativeExecution.addTask(userTask); for (VariableInstanceEntity variable : userTask.getVariablesInternal()) { variable.setExecution(representativeExecution); } userTask.setExecution(representativeExecution); }
@Override public void attachState(MigratingScopeInstance owningInstance) { ExecutionEntity representativeExecution = owningInstance.resolveRepresentativeExecution(); representativeExecution.addTask(userTask); for (VariableInstanceEntity variable : userTask.getVariablesInternal()) { variable.setExecution(representativeExecution); } userTask.setExecution(representativeExecution); }
/** creates and initializes a new persistent task. */ public static TaskEntity createAndInsert(VariableScope execution) { TaskEntity task = create(); if (execution instanceof ExecutionEntity) { ExecutionEntity executionEntity = (ExecutionEntity) execution; task.setExecution(executionEntity); task.skipCustomListeners = executionEntity.isSkipCustomListeners(); task.insert(executionEntity); return task; } else if (execution instanceof CaseExecutionEntity) { task.setCaseExecution((DelegateCaseExecution) execution); } task.insert(null); return task; }
/** creates and initializes a new persistent task. */ public static TaskEntity createAndInsert(VariableScope execution) { TaskEntity task = create(); if (execution instanceof ExecutionEntity) { ExecutionEntity executionEntity = (ExecutionEntity) execution; task.setExecution(executionEntity); task.skipCustomListeners = executionEntity.isSkipCustomListeners(); task.insert(executionEntity); return task; } else if (execution instanceof CaseExecutionEntity) { task.setCaseExecution((DelegateCaseExecution) execution); } task.insert(null); return task; }
protected void removeTasks(String reason) { if (reason == null) { reason = TaskEntity.DELETE_REASON_DELETED; } for (TaskEntity task : getTasks()) { if (isReplacedByParent()) { if (task.getExecution() == null || task.getExecution() != replacedBy) { // All tasks should have been moved when "replacedBy" has been set. // Just in case tasks where added, // wo do an additional check here and move it task.setExecution(replacedBy); this.getReplacedBy().addTask(task); } } else { task.delete(reason, false, skipCustomListeners); } } }
protected void removeTasks(String reason) { if (reason == null) { reason = TaskEntity.DELETE_REASON_DELETED; } for (TaskEntity task : getTasks()) { if (isReplacedByParent()) { if (task.getExecution() == null || task.getExecution() != replacedBy) { // All tasks should have been moved when "replacedBy" has been set. // Just in case tasks where added, // wo do an additional check here and move it task.setExecution(replacedBy); this.getReplacedBy().addTask(task); } } else { task.delete(reason, false, skipCustomListeners); } } }
for (TaskEntity task : tasks) { ExecutionEntity execution = executionsMap.get(task.getExecutionId()); task.setExecution(execution); execution.addTask(task);
for (TaskEntity task : tasks) { ExecutionEntity execution = executionsMap.get(task.getExecutionId()); task.setExecution(execution); execution.addTask(task);
@Override public void detachState() { userTask.getExecution().removeTask(userTask); userTask.setExecution(null); }
public void testTaskEntitySerialization() throws Exception { TaskEntity task = new TaskEntity(); task.setDelegationState(DelegationState.RESOLVED); task.setExecution(new ExecutionEntity()); task.setProcessInstance(new ExecutionEntity()); task.setTaskDefinition(new TaskDefinition(null)); task.setAssignee("kermit"); task.setCreateTime(new Date()); task.setDescription("Test description"); task.setDueDate(new Date()); task.setName("myTask"); task.setEventName("end"); task.setDeleted(false); task.setDelegationStateString(DelegationState.RESOLVED.name()); byte[] data = writeObject(task); task = (TaskEntity) readObject(data); assertEquals("kermit", task.getAssignee()); assertEquals("myTask", task.getName()); assertEquals("end", task.getEventName()); }
protected void moveTasksTo(ExecutionEntity other) { // update the related tasks for (TaskEntity task : getTasksInternal()) { task.setExecution(other); // update the related local task variables Collection<VariableInstanceEntity> variables = task.getVariablesInternal(); for (VariableInstanceEntity variable : variables) { variable.setExecution(other); } other.addTask(task); } getTasksInternal().clear(); }
@Override public void attachState(MigratingScopeInstance owningInstance) { ExecutionEntity representativeExecution = owningInstance.resolveRepresentativeExecution(); representativeExecution.addTask(userTask); for (VariableInstanceEntity variable : userTask.getVariablesInternal()) { variable.setExecution(representativeExecution); } userTask.setExecution(representativeExecution); }
/** creates and initializes a new persistent task. */ public static TaskEntity createAndInsert(VariableScope execution) { TaskEntity task = create(); if (execution instanceof ExecutionEntity) { ExecutionEntity executionEntity = (ExecutionEntity) execution; task.setExecution(executionEntity); task.skipCustomListeners = executionEntity.isSkipCustomListeners(); task.insert(executionEntity); return task; } else if (execution instanceof CaseExecutionEntity) { task.setCaseExecution((DelegateCaseExecution) execution); } task.insert(null); return task; }
protected void removeTasks(String reason) { if (reason == null) { reason = TaskEntity.DELETE_REASON_DELETED; } for (TaskEntity task : getTasks()) { if (isReplacedByParent()) { if (task.getExecution() == null || task.getExecution() != replacedBy) { // All tasks should have been moved when "replacedBy" has been set. // Just in case tasks where added, // wo do an additional check here and move it task.setExecution(replacedBy); this.getReplacedBy().addTask(task); } } else { task.delete(reason, false, skipCustomListeners); } } }
for (TaskEntity task : tasks) { ExecutionEntity execution = executionsMap.get(task.getExecutionId()); task.setExecution(execution); execution.addTask(task);
public void testTaskEntitySerialization() throws Exception { TaskEntity task = new TaskEntity(); task.setDelegationState(DelegationState.RESOLVED); task.setExecution(new ExecutionEntity()); task.setProcessInstance(new ExecutionEntity()); task.setTaskDefinition(new TaskDefinition(null)); task.setAssignee("kermit"); task.setCreateTime(new Date()); task.setDescription("Test description"); task.setDueDate(new Date()); task.setName("myTask"); task.setEventName("end"); task.setDeleted(false); task.setDelegationStateString(DelegationState.RESOLVED.name()); byte[] data = writeObject(task); task = (TaskEntity) readObject(data); assertEquals("kermit", task.getAssignee()); assertEquals("myTask", task.getName()); assertEquals("end", task.getEventName()); }