SolveOptions#

Options for Project#solve and schedule. They set which part of the project is scheduled and what extra data the ScheduleResult carries. Every field is optional: {} schedules the whole project and reports only the changed tasks.

interface SolveOptions {
  subtree?: Subtree;
  analytics?: AnalyticsOptions;
  reasons?: boolean;
  includeUnchanged?: boolean;
}

Fields#

Field Type Default Description
subtree Subtree whole project Schedules only one task's subtree and the tasks that depend on it.
analytics AnalyticsOptions no analytics Requests critical path and slack. With criticalPath or slack set to true, the result carries analytics; check its status before reading the data.
reasons boolean false true adds a reason to each entry of the result's updates: why the task moved.
includeUnchanged boolean false true also reports unchanged tasks in the result's updates, so the result holds the full date list.

includeUnchanged#

With false, updates holds only the tasks the solve changed or that edits touched. With true, updates also holds every scheduled task that didn't change, each with start_date, end_date and duration set.

  • Every scheduled task is reported: leaves, summaries and milestones. Unscheduled tasks are never reported.
  • With subtree, every task in the subtree is reported, ancestors of subtree tasks included, plus the usual changed or touched updates outside the subtree.
  • On a project with cycles, every scheduled task is reported in model order (subtree is ignored), with its stored dates and durations.
  • leveling_delay and pauses never appear in these entries.

The extra entries don't affect the result's baselineId, which follows real date changes only. Every other result field is the same as with includeUnchanged: false.

Used by#

Project#preview takes PreviewOptions, which has the same subtree, analytics and reasons fields but no includeUnchanged.

Example#

const options = {
  subtree: { task: "design" },
  analytics: { criticalPath: true, slack: true },
  reasons: true,
  includeUnchanged: true,
};