LinkData#

A dependency between two tasks: which task drives which, through which pair of dates, and with how much lag. Input only: pass it in ProjectData.links, or add and edit links through a SchedulingChanges change set. No call returns it.

Fields#

Field Type Default Description
id Id required Link id. Must be unique among the links of the project.
source Id required The predecessor task.
target Id required The successor task.
type "fs" | "ss" | "ff" | "sf" | 0 | 1 | 2 | 3 | "0" | "1" | "2" | "3" "fs" Which date of source drives which date of target: "fs" finish-to-start, "ss" start-to-start, "ff" finish-to-finish, "sf" start-to-finish. The numbers 0-3 and the strings "0"-"3" are aliases, in that order. Letter codes are case-insensitive. null reads as "fs".
lag number | null 0 Offset between the two dates, in working time on the target task's calendar, measured in lag_unit. A negative value is a lead. null reads as 0.
lag_unit TimeUnit | null config.duration_unit Unit of lag: "minute", "hour" or "day". null reads as omitted.

Id is a string or a number; 0 and "0" name the same task. See Id.

Unknown fields on a link are ignored.

Validation#

  • A duplicate id throws InputError with kind: "validation" and a path like links[3].id.
  • A type outside the accepted values throws InputError with kind: "validation".
  • A link whose source or target is unknown or unscheduled isn't an error. The project drops it and reports a dropped-link note in ScheduleResult.notes.
  • A link between a summary and one of its own descendants is dropped the same way, unless SchedulingConfig.descendant_links is true.
  • A link from a task to itself is kept. It forms a one-task cycle, reported in ScheduleResult.cycles.

Used by#

Example#

const links = [
  { id: 1, source: 10, target: 11 },                           // finish-to-start, no lag
  { id: 2, source: 11, target: 12, type: "ss", lag: 2 },       // start 2 days after task 11 starts
  { id: 3, source: 12, target: 13, type: 2, lag: -4, lag_unit: "hour" }, // "ff", 4-hour lead
];