跳到主要内容

onAutoScheduleConflict

信息

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 conflict kind.

Example

gantt.attachEvent("onAutoScheduleConflict", function(conflict){
if (conflict.kind === "constraint-violation") {
console.warn(`Task ${conflict.taskId}: the ${conflict.constraintType} constraint could not be satisfied`);
}
});

Details

注释

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:

kindDescriptionFields
"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.

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.