PreviewOptions#
Options for Project#preview. They set which part of the project is scheduled, which extra data the ScheduleResult carries, and which baseline the preview expects. Create one with new PreviewOptions() and set fields with the fluent withX setters. The defaults schedule the whole project and return only the changed tasks.
Declaration#
Constructors#
PreviewOptions()#
public
Creates options with every field at its default.
Fields#
| Field | Type | Default | Description |
|---|---|---|---|
subtree |
Subtree |
null |
Limits scheduling to one task's branch. null schedules the whole project. |
analytics |
AnalyticsOptions |
new AnalyticsOptions() (none requested) |
Requests slack and the critical path. Fills ScheduleResult.analytics. |
reasons |
boolean |
false |
Fills Mutation.reason on each update. |
baselineId |
String |
null |
The baseline the preview expects. null skips the check. |
profile |
ProfileQuery |
null |
Requests a load profile of the previewed dates. Fills ScheduleResult.profile. |
subtree#
public Subtree subtree ;
Limits scheduling to the scope that the Subtree value describes. Build the value with new Subtree(id).
analytics#
public AnalyticsOptions analytics ;
Turns on AnalyticsOptions.slack and AnalyticsOptions.criticalPath for the previewed dates. With both flags false (the default), ScheduleResult.analytics is null. With either flag set, it holds an Analytics value. Check its status before reading the data.
reasons#
public boolean reasons ;
When true, each Mutation in ScheduleResult.updates carries a Reason in its reason field. When false, reason is always null.
baselineId#
public String baselineId ;
A baseline token taken from the latest ScheduleResult.baselineId. When it isn't null and doesn't name the project's current baseline, Project#preview throws a ProjectException with code STALE_BASELINE. It stops a preview from running over a baseline that changed underneath the UI.
SchedulingChanges.baselineId is checked the same way, independently of this field.
profile#
public ProfileQuery profile ;
When set, ScheduleResult.profile holds the LoadProfile of the previewed dates over the range and resources that the ProfileQuery describes. When null, ScheduleResult.profile is null. An invalid query makes Project#preview throw an InputException.
Methods#
withSubtree, withAnalytics, withReasons, withBaselineId, withProfile#
public PreviewOptions
public PreviewOptions
public PreviewOptions
public PreviewOptions
public PreviewOptions
Each setter assigns its field and returns this instance for chaining.
Returns - this PreviewOptions.
deepClone#
public PreviewOptions
Returns a copy that shares no nested object (subtree, analytics, profile) with this instance.
Returns - a new PreviewOptions with the same values.
copy#
public PreviewOptions
Returns a shallow copy. The copy shares the subtree, analytics and profile objects with this instance.
Returns - a new PreviewOptions with the same field values.
equals, hashCode, toString#
public boolean
public int
public String
Inherited from ValueRecord. Two PreviewOptions are equal when their public fields are equal. toString() lists the fields in the form PreviewOptions{field=value, …}.
Example#
;
;
Related#
Project#preview- the call that takes itSubtree- limits the preview to one branchAnalyticsOptions- slack and critical path switchesProfileQuery- the load profile of the previewed dates- Previewing changes - baseline tokens and preview with load