schedule#
Schedules a ProjectData snapshot once and returns the result envelope. The call is stateless: it creates a temporary project with strict validation, solves the data once and drops the project before returning. Nothing is kept between calls, and there's no handle to free. To keep a baseline and send edits later, use JsonProject.solve.
Signature#
data_json: string, options_json: string: string
Synchronous and CPU-bound. The same data_json and options_json always produce the same result. In the browser build, call it only after init() has resolved.
Request#
| Argument | Payload | Required | Description |
|---|---|---|---|
data_json |
ProjectData |
yes | The full snapshot to schedule. Always validated in strict mode; the rules are listed on ProjectData. |
options_json |
SolveOptions |
yes | What to schedule and what to report. "{}" schedules the whole project with default options. |
Response#
The success envelope carries a ScheduleResult. The envelope shape is described in Wire format.
The result's baselineId is set, but it names the baseline of the temporary project, so no later call can use it.
Errors#
| Error | When |
|---|---|
kind: "parse" |
data_json or options_json isn't valid JSON, has the wrong JSON type, misses a required field, or options_json has an unknown field. |
kind: "validation" |
A value the decoder rejects (path: null), or data_json fails strict validation (path names the field, e.g. tasks[0].start_date). |
schedule never returns kind: "project": each call starts from a fresh project. Errors come back in the returned envelope; the call doesn't throw for bad input. See Error handling for the error fields and for host-level failures such as calling before init() resolves.
Example#
Request (data_json):
Options (options_json): {}
Response:
Only build moved, so it's the only entry in updates. Pass {"includeUnchanged": true} as options_json to list every scheduled task.
Host call in Node:
const = ;
const = ;
const = ;
Related#
ProjectData- the snapshot to scheduleSolveOptions- scope and reporting optionsScheduleResult- the result payloadJsonProject.solve- the stateful counterpart that keeps a baseline- Scheduling a Project - one-shot and live scheduling