JsonProject.analyze#
Computes analytics over dates without scheduling them. It reads either a supplied ProjectData snapshot or the current dates of the JsonProject, including edits that haven't been solved yet. Use it instead of solve when the dates are already final and only the critical path or slack is needed. It works on an unsolved project.
Signature#
data_json: string | null | undefined, options_json: string: string
Synchronous and read-only.
Request#
| Argument | Payload | Required | Description |
|---|---|---|---|
data_json |
ProjectData |
no | Dates to analyze. null or undefined analyzes the project's current dates. |
options_json |
AnalyzeOptions |
yes | Which analytics to compute. Send "{}" for none. |
AnalyzeOptions#
The options object for analyze. Unknown fields are rejected with a parse error. The object itself can't be null.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
analytics |
AnalyticsOptions | null |
no | no analytics | Requests criticalPath and slack. Fills analytics in the result. null is the same as leaving it out. |
Behavior#
- With
data_json, the data is validated and read but never installed. The project keeps its previous state, and its solved status doesn't change. When the project was created withvalidation: "repair", the data is repaired first and the repairs are reported innotes. - Without
data_json, the project's current dates are read, including unsolved edits fromapply. The project stays unsolved after the call if it was unsolved before. - Nothing is scheduled: dates are taken as they are.
Response#
An envelope with a ScheduleResult:
updatesandconflictsare always empty, andconvergedistrue.cycles,notesandoverallocationsdescribe the analyzed dates.analyticsis present only whenoptions_jsonrequests it. Check itsstatusbefore reading the data; seeScheduleResult.baselineIdis present only whendata_jsonis omitted and the project is solved with no unsolved edits. Otherwise the field is left out.
Errors#
kind |
When |
|---|---|
parse |
data_json or options_json isn't valid JSON, has a wrong type or an unknown field, or options_json is "null" |
validation |
The supplied data fails validation, e.g. a task with fewer than two of start_date, end_date and duration (path: tasks[0].start_date) |
analyze doesn't return project errors and doesn't throw for bad input. Error kinds are described in Error handling.
Example#
Get the critical path and slack of dates stored elsewhere, without scheduling them. Task build starts a day later than link l1 requires.
Request (data_json):
Request (options_json):
Response:
The call from a Node.js host:
const = ;
const = ;
const = ;
const = new;
Related#
ProjectData- the dates to analyzeScheduleResult- the result, withanalyticsAnalyticsOptions- the critical path and slack switchesJsonProject.solve- schedule and compute analytics in one call- Critical path and slack - what critical path and slack mean