cancel
Showing results for 
Search instead for 
Did you mean: 

Why is the field in the table due_date_ act_hi_taskinst are

kolmogorov_dikm
Champ in-the-making
Champ in-the-making
Why is the field in the table due_date_ act_hi_taskinst not contain a date after the completion of the task?

1) Create a task in the field due_date_ act_ru_task contains date

Task task = taskService.newTask();
task.setName(taskEntity.getName());
task.setDescription(taskEntity.getDescription());
task.setPriority(taskEntity.getPriority());
task.setDueDate(taskEntity.getDueDate());
task.setOwner(taskEntity.getOwner());
task.setAssignee(taskEntity.getAssignee());
taskService.saveTask(task);
2) complete the task

taskService.complete(taskId);

Activiti version 5.11
3 REPLIES 3

frederikherema1
Star Contributor
Star Contributor

public HistoricTaskInstanceEntity(TaskEntity task, ExecutionEntity execution) {
    this.id = task.getId();
    if (execution!=null) {
      this.processDefinitionId = execution.getProcessDefinitionId();
      this.processInstanceId = execution.getProcessInstanceId();
      this.executionId = execution.getId();
    }
    this.name = task.getName();
    this.parentTaskId = task.getParentTaskId();
    this.description = task.getDescription();
    this.owner = task.getOwner();
    this.assignee = task.getAssignee();
    this.startTime = ClockUtil.getCurrentTime();
    this.taskDefinitionKey = task.getTaskDefinitionKey();
    this.setPriority(task.getPriority());
  }

The initial due-date is not recorded, indeed. I'll change this on master. Only after due-date update, it is set (after task is created and saved, do an additional save to overcome this issue for now):


public void setDueDate(Date dueDate) {
    this.dueDate = dueDate;
   
    CommandContext commandContext = Context.getCommandContext();
    if (commandContext!=null) {
      commandContext
        .getHistoryManager()
        .recordTaskDueDateChange(id, dueDate);
    }
  }

kolmogorov_dikm
Champ in-the-making
Champ in-the-making