Project::preview#
Applies hypothetical changes to a copy of the solved baseline of a Project and schedules the copy. The project isn't modified. Use it to show what an edit would do before committing it with apply.
Signature#
Takes &self. Synchronous and CPU-only.
Parameters#
| Name | Type | Description |
|---|---|---|
changes |
&SchedulingChanges |
The edits to try |
options |
&PreviewOptions |
Subtree, analytics, reasons, baseline check and an optional load profile |
Behavior#
updatesare relative to the baseline. An empty change set gives emptyupdates.- The result's
baseline_idis the baseline the preview read, so it's accepted by a followingpreview. - The change set isn't partially accepted: one rejected operation fails the whole call.
options.baseline_idandchanges.baseline_idare checked separately.Noneskips a check.
Returns#
A ScheduleResult for the previewed state.
Errors#
| Error | When |
|---|---|
Error::Project(ProjectError::NoBaseline) |
The project is unsolved, including after apply |
Error::Project(ProjectError::StaleBaseline) |
options.baseline_id or changes.baseline_id doesn't name the current baseline |
Error::Input |
An operation in changes is rejected (the error reports the first one), or the profile query is invalid |
Note
A start date that falls on non-working time is kept unsnapped when the task has no predecessor. The end is computed forward from it on the working calendar.
Example#
Preview a drag of task b and check that the project keeps its dates.
use ;
Related#
Project- the type and its other methodsPreviewOptions- subtree, analytics, reasons, baseline check and load profileSchedulingChanges- the change setScheduleResult- the returned result- Previewing Changes - previews, baseline tokens, load previews and clones