Note#

A non-fatal note about the input of a scheduling call: a task, link or assignment that was left out of the plan, or a field that repair validation changed. Notes are listed in ScheduleResult.notes. Nothing is thrown for them.

Note is an abstract class with four nested static subclasses, one per variant. Read a note with instanceof patterns or switch pattern matching on the nested classes.

Declaration#

package org.dhtmlx.plen;

public abstract class Note extends ValueRecord {
    public Note()
    public Note copy()

    public static class DroppedLink extends Note { ... }
    public static class DroppedTask extends Note { ... }
    public static class DroppedAssignment extends Note { ... }
    public static class Repaired extends Note { ... }
}

The class isn't sealed, but the four nested classes are the only variants the library produces. A switch over a Note needs a default branch to compile.

Like every record, a note has public mutable fields, copy() (shallow; each subclass returns its own type), and structural equals / hashCode / toString from ValueRecord.

Variants#

Variant When it occurs
DroppedLink A link isn't part of the plan, for example because one of its tasks is unscheduled.
DroppedTask A task isn't part of the plan because it's unscheduled.
DroppedAssignment An assignment isn't part of the plan because its task is unscheduled.
Repaired Validation.REPAIR changed an input field.
public DroppedLink(Id link, String reason)
Field Type Description
link Id Id of the dropped link.
reason String Human-readable reason, e.g. target task "3" is unscheduled.

DroppedTask#

public DroppedTask(Id task, String reason)
Field Type Description
task Id Id of the dropped task.
reason String Human-readable reason: unscheduled.

A task is unscheduled when TaskData.unscheduled is true.

DroppedAssignment#

public DroppedAssignment(Id assignment, String reason)
Field Type Description
assignment Id Id of the dropped assignment.
reason String Human-readable reason, e.g. task "3" is unscheduled.

Repaired#

public Repaired(String path, String message)
Field Type Description
path String Input path of the changed field, in wire spelling, e.g. tasks[1].start_date.
message String What was wrong and how it was fixed.

Only a project created with Validation.REPAIR reports Repaired notes. The list of fixes and their paths is on Validation.

Example#

import java.util.List;
import org.dhtmlx.plen.*;

public class NoteExample {
    public static void main(String[] args) throws Exception {
        Moment monday = Moment.fromYmdHm(2026, 8, 10, 8, 0);

        ProjectData data = new ProjectData()
                .withTasks(List.of(
                        new TaskData(Id.num(1)).withStartDate(monday).withDuration(1.0),
                        new TaskData(Id.num(2)).withStartDate(monday).withDuration(1.0)
                                .withUnscheduled(true)))
                .withLinks(List.of(
                        new LinkData().withId(Id.num(10)).withSource(Id.num(1)).withTarget(Id.num(2))));

        ScheduleResult result = Engine.schedule(data, new SolveOptions());

        for (Note note : result.notes) {
            String line = switch (note) {
                case Note.DroppedLink n -> "link " + n.link + " dropped: " + n.reason;
                case Note.DroppedTask n -> "task " + n.task + " dropped: " + n.reason;
                case Note.DroppedAssignment n -> "assignment " + n.assignment + " dropped: " + n.reason;
                case Note.Repaired n -> "repaired " + n.path + ": " + n.message;
                default -> note.toString();
            };
            System.out.println(line);
        }
        // task 2 dropped: unscheduled
        // link 10 dropped: target task "2" is unscheduled
    }
}