Skip to main content

schedule-tasks

PRO

The functionality is available in PRO Edition only

Description​

Triggers cascading updates of tasks in auto scheduling mode

The schedule-tasks action triggers recalculation of all tasks according to auto scheduling rules. It updates all dependent tasks based on end-to-start links, considering lag and project start constraints. Normally, this action is called automatically when tasks change (start, end, duration, or links), but it can also be invoked manually.

Usage​

"schedule-tasks": {
id?: string | number,
task?: ITask,
link?: string | number,
};

Parameters​

  • id - (optional) the ID of the task that triggered rescheduling. Pass 0 to recalculate the entire project; pass a specific task ID to start the cascade from that task
  • task - (optional) a task object to apply to the triggering task
  • link - (optional) the ID of the link that triggered auto-scheduling. Gantt sets this automatically when a link operation (add, update, or delete) causes rescheduling

Example​

<script>
import { Gantt } from "@svar/svelte-gantt";
import { Button } from "@svar-ui/svelte-core";
import { getData } from "../data";

const { tasks, links } = getData();

let api = $state();

function runSchedule() {
api.exec("schedule-tasks", { id: 0 });
}
</script>

<Button onclick={runSchedule}>Apply Auto Schedule</Button>
<Gantt bind:this={api} {tasks} {links} schedule={{ auto: true }} />

Related articles: