@Test public void fromTaskData() { fromTaskData(INPUT_DATA, Collections.emptySet(), Collections.emptySet()); }
public static Task fromTaskData(TaskData taskData) { final Task task = new Task(taskData.getTaskId(), taskData.getProcessInstanceId(), taskData.getProcessId(), taskData.getContainerId(), taskData.getName(), taskData.getPriority(), taskData.getStatus(), taskData.getInputData()); if (taskData.getPotentialOwners() != null) { taskData.getPotentialOwners().forEach(potentialOwner -> { if (isUser(potentialOwner.getType())) { task.getPotentialOwners().add(new User(potentialOwner.getName().hashCode(), potentialOwner.getName())); } else { task.getPotentialOwners().add(new Group(potentialOwner.getName().hashCode(), potentialOwner.getName())); } }); } LabelValueExtractorRegistry.getInstance().applyLabelValueExtractors(TaskData.class, taskData, task::setLabelValues); return task; }
TaskUtil { public static Task fromTaskData(TaskData taskData) { final Task task = new Task(taskData.getTaskId(), taskData.getProcessInstanceId(), taskData.getProcessId(), taskData.getContainerId(), taskData.getName(), taskData.getPriority(), taskData.getStatus(), taskData.getInputData()); if (taskData.getPotentialOwners() != null) { taskData.getPotentialOwners().forEach(potentialOwner -> { if (isUser(potentialOwner.getType())) { task.getPotentialOwners().add(new User(potentialOwner.getName().hashCode(), potentialOwner.getName())); } else { task.getPotentialOwners().add(new Group(potentialOwner.getName().hashCode(), potentialOwner.getName())); } }); } LabelValueExtractorRegistry.getInstance().applyLabelValueExtractors(TaskData.class, taskData, task::setLabelValues); return task; } }
TaskUtil { public static Task fromTaskData(TaskData taskData) { final Task task = new Task(taskData.getTaskId(), taskData.getProcessInstanceId(), taskData.getProcessId(), taskData.getContainerId(), taskData.getName(), taskData.getPriority(), taskData.getStatus(), taskData.getInputData()); if (taskData.getPotentialOwners() != null) { taskData.getPotentialOwners().forEach(potentialOwner -> { if (isUser(potentialOwner.getType())) { task.getPotentialOwners().add(new User(potentialOwner.getName().hashCode(), potentialOwner.getName())); } else { task.getPotentialOwners().add(new Group(potentialOwner.getName().hashCode(), potentialOwner.getName())); } }); } LabelValueExtractorRegistry.getInstance().applyLabelValueExtractors(TaskData.class, taskData, task::setLabelValues); return task; } private  TaskUtil(); }
TaskUtil { public static Task fromTaskData(TaskData taskData) { final Task task = new Task(taskData.getTaskId(), taskData.getProcessInstanceId(), taskData.getProcessId(), taskData.getContainerId(), taskData.getName(), taskData.getPriority(), taskData.getStatus(), taskData.getInputData()); if (taskData.getPotentialOwners() != null) { taskData.getPotentialOwners().forEach(potentialOwner -> { if (isUser(potentialOwner.getType())) { task.getPotentialOwners().add(new User(potentialOwner.getName().hashCode(), potentialOwner.getName())); } else { task.getPotentialOwners().add(new Group(potentialOwner.getName().hashCode(), potentialOwner.getName())); } }); } LabelValueExtractorRegistry.getInstance().applyLabelValueExtractors(TaskData.class, taskData, task::setLabelValues); return task; } private  TaskUtil(); static Task fromTaskData(TaskData taskData); }
TaskUtil { public static Task fromTaskData(TaskData taskData) { final Task task = new Task(taskData.getTaskId(), taskData.getProcessInstanceId(), taskData.getProcessId(), taskData.getContainerId(), taskData.getName(), taskData.getPriority(), taskData.getStatus(), taskData.getInputData()); if (taskData.getPotentialOwners() != null) { taskData.getPotentialOwners().forEach(potentialOwner -> { if (isUser(potentialOwner.getType())) { task.getPotentialOwners().add(new User(potentialOwner.getName().hashCode(), potentialOwner.getName())); } else { task.getPotentialOwners().add(new Group(potentialOwner.getName().hashCode(), potentialOwner.getName())); } }); } LabelValueExtractorRegistry.getInstance().applyLabelValueExtractors(TaskData.class, taskData, task::setLabelValues); return task; } private  TaskUtil(); static Task fromTaskData(TaskData taskData);  }