SchedulingChanges#
A set of edits to a project: added, updated and removed tasks, links, resources and assignments. Pass it to Project#apply to commit the edits, to Project#preview to see their effect, or in a Candidate to Project#evaluate. Create one with new SchedulingChanges() and fill its four groups. SuggestResult.changes also returns one.
Declaration#
Each group is a Changes value with add, update and remove lists. Fill them in place (changes.tasks.update.add(...)) or replace a whole group with a withX setter.
Constructors#
SchedulingChanges()#
public
Creates an empty change set: baselineId is null and every group is an empty Changes.
Fields#
| Field | Type | Default | Description |
|---|---|---|---|
baselineId |
String |
null |
Baseline token the edits were made against. null skips the baseline check. |
tasks |
Changes<TaskData, TaskUpdate> |
new Changes<>() |
Tasks to add, update and remove. |
links |
Changes<LinkAdd, LinkUpdate> |
new Changes<>() |
Links to add, update and remove. |
resources |
Changes<ResourceData, ResourceUpdate> |
new Changes<>() |
Resources to add, update and remove. |
assignments |
Changes<AssignmentData, AssignmentUpdate> |
new Changes<>() |
Assignments to add, update and remove. |
Calendars and the project config have no group. Changing them takes a full solve(data, …).
baselineId#
public String baselineId ;
Set it to the ScheduleResult.baselineId the user saw when making the edits. apply, preview and evaluate throw ProjectException with STALE_BASELINE when a non-null value doesn't name the project's current baseline.
tasks#
public Changes tasks ;
New tasks are full TaskData records. Updates are TaskUpdate records keyed by task id. Removals list task ids.
links#
public Changes links ;
New links are LinkAdd records. Updates are LinkUpdate records keyed by link id. Removals list link ids.
resources#
public Changes resources ;
New resources are full ResourceData records. Updates are ResourceUpdate records keyed by resource id. Removals list resource ids.
assignments#
public Changes assignments ;
New assignments are full AssignmentData records. Updates are AssignmentUpdate records keyed by assignment id. Removals list assignment ids.
The order in which the operations of all four groups run is part of Project#apply.
Methods#
withBaselineId, withTasks, withLinks, withResources, withAssignments#
public SchedulingChanges
public SchedulingChanges
public SchedulingChanges
public SchedulingChanges
public SchedulingChanges
Each setter assigns its field and returns this instance for chaining.
Returns - this SchedulingChanges.
rooted#
public SchedulingChanges
Clears every task parent that equals root: on added tasks it becomes null, on task updates it becomes Patch.nullValue(). Ids compare as normalized keys, so Id.num(0) matches Id.str("0"). The engine calls it with config.rootId before applying changes, so a parent set to the virtual root reaches the project as "no parent". Calling it yourself isn't needed.
Parameters
| Name | Type | Description |
|---|---|---|
root |
Id |
The parent id that means "no parent". |
Returns - a deep copy with the matching parents cleared, or this same instance when no task add or update has root as its parent. This instance is never modified.
deepClone#
public SchedulingChanges
Returns a copy that shares no group, list or record with this instance. Ids are shared; they're immutable.
Returns - a new SchedulingChanges with the same values.
copy#
public SchedulingChanges
Returns a shallow copy. The copy shares the four Changes groups with this instance, so adding to copy.tasks.update also changes the original.
Returns - a new SchedulingChanges with the same field values.
equals, hashCode, toString#
public boolean
public int
public String
Inherited from ValueRecord. Two SchedulingChanges are equal when their public fields are equal, nested records compared by value. toString() lists the fields.
Example#
;
;
Related#
Project#apply- commits a change setProject#preview- tries a change set without committing itApplyReport- whatapplyreturns- Data Updates - building and applying change sets
- Previewing Changes - previewing an edit with baseline tokens