AssignmentData#
A plain object that books one resource on one task at a given rate. Pass these records in ProjectData.assignments to load a plan, or in the assignments.add bucket of a SchedulingChanges to add bookings later. An assignment changes resource load. Its offset and duration never move task dates.
Fields#
| Field | Type | Default | Description |
|---|---|---|---|
id |
Id | null |
generated | Unique among assignments. Without an id, the assignment gets a generated one; apply lists it in effects.generatedAssignments. Updates and removals address the assignment by this id. |
task |
Id |
required | The task being booked. Must name a task of the plan. task_id is accepted as an alias; task wins when both are present. |
resource |
Id |
required | The booked resource. Must name a resource of the plan. resource_id is accepted as an alias; resource wins when both are present. |
value |
number |
required | Booking rate in resource capacity units: 1 = 100 %. Must be finite and greater than 0. |
offset |
number | null |
0 |
Where the booked slice starts: worked time from the task start, in the task's duration_unit. Must be finite and at least 0. null reads as the default. |
duration |
number | null |
to the task end | Length of the booked slice: worked time, in the task's duration_unit. Must be finite and greater than 0. null reads as the default. |
Worked time for offset and duration is counted on the assignment's working calendar and skips non-working time and pauses, so the slice moves with the task's work. The slice is clipped to the task's work when load is booked, not when the record is read: an offset at or past the task's duration books nothing, and a slice follows a task that later gets shorter. Several assignments of one resource on one task each book their own slice, and overlapping slices add up.
An assignment on an unscheduled task stays in the project and books nothing until the task is scheduled again; the result reports it as a dropped-assignment note.
Invalid values (an unknown task or resource, a duplicate id, a bad value, offset or duration) throw an InputError with a path such as assignments[0].value when the plan is loaded, and come back as a rejected operation from apply. With validation: "repair" on the Project, an invalid offset or duration is cleared and a duplicate id replaces the earlier record, each reported as a repaired note. Unknown fields are ignored.
Used by#
Project#solve,Project#analyze,schedule:data.assignmentsholds the plan's bookingsProject#apply,Project#preview,Project#evaluate:changes.assignments.addadds bookingsProject#suggestAssignments: returns filled slots aschanges.assignments.addentries
Example#
const = ;
Related#
ProjectData- the plan that carriesassignmentsResourceData- the resource an assignment booksAssignmentUpdate- editing an existing assignment- Resources and assignments - capacity, assignments and overallocation
- Split assignment work - booking part of a task with
offsetandduration