onAutoScheduleConflict
Info
This functionality is available in the PRO edition only.
Description
Fires for each conflict found during auto scheduling
onAutoScheduleConflict: (conflict: object) => void;
Parameters
conflict- (required) object - the conflict found during scheduling. The set of fields depends on the conflictkind.
Example
gantt.attachEvent("onAutoScheduleConflict", function(conflict){
if (conflict.kind === "constraint-violation") {
console.warn(`Task ${conflict.taskId}: the ${conflict.constraintType} constraint could not be satisfied`);
}
});
Related samples
Details
Hinweis
This event is defined in the auto_scheduling extension, so you need to activate the auto_scheduling plugin. Read the details in the Auto Scheduling article.
The event fires once for every conflict that auto scheduling runs into. Auto scheduling still produces a result - the event lets you surface the conflicts in the UI or react to them.
The conflict.kind field defines the type of the conflict and the available fields:
kind | Description | Fields |
|---|---|---|
"constraint-violation" | A task's constraint could not be satisfied at its scheduled position. | taskId, constraintType, required (Date), actual (Date) |
"calendar-non-working" | A task landed on its own non-working time. Reported only when strict_calendar is enabled. | taskId, proposedDate (Date), snappedDate (Date) |
"unscheduled-dependency" | A task depends on a task that is not scheduled. | taskId, blockedBy |
Dependency loops are reported through the separate onAutoScheduleCircularLink event, not here.
Related API
- auto_scheduling
- auto_scheduling_move_projects
- auto_scheduling_use_progress
- findCycles
- isCircularLink
- onAfterAutoSchedule
- onAfterTaskAutoSchedule
- onBeforeAutoSchedule
- onBeforeTaskAutoSchedule
- onAutoScheduleCircularLink
- onAutoScheduleNoConverge
Related Guides
Change log
- added in version 10.0
Need help?
Got a question about the documentation? Reach out to our technical support team for help and guidance. For custom component solutions, visit the Services page.