DG
public static MyTaskDto fromEntity(Task task) {
MyTaskDto dto = new MyTaskDto();
dto.id = task.getId();
dto.name = task.getName();
dto.assignee = task.getAssignee();
dto.created = task.getCreateTime();
dto.due = task.getDueDate();
dto.followUp = task.getFollowUpDate();
if (task.getDelegationState() != null) {
dto.delegationState = task.getDelegationState().toString();
}
dto.description = task.getDescription();
dto.executionId = task.getExecutionId();
dto.owner = task.getOwner();
dto.parentTaskId = task.getParentTaskId();
dto.priority = task.getPriority();
dto.processDefinitionId = task.getProcessDefinitionId();
dto.processInstanceId = task.getProcessInstanceId();
dto.taskDefinitionKey = task.getTaskDefinitionKey();
dto.caseDefinitionId = task.getCaseDefinitionId();
dto.caseExecutionId = task.getCaseExecutionId();
dto.caseInstanceId = task.getCaseInstanceId();
dto.suspended = task.isSuspended();
dto.tenantId = task.getTenantId();
try {
dto.formKey = task.getFormKey();
}
catch (BadUserRequestException e) {
// ignore (initializeFormKeys was not called)
}
return dto;
}