Hi - I have this process where I need to create auto-scheduling based on sort order. What I do to achieve this is I add temporary links in combination with existing links. However I’m getting odd results like this gap in the data when I want task 4 and 5 to be scheduled ASAP. Is this a bug that my older version of Gantt hasn’t resolved?
Hello Skoofy,
It can be that Task #4 has the SNET constraint, so it cannot start earlier that date. By default, the constraints are not displayed, so it may not be clear why the task doesn’t move to the end of its predecessor.
The dev team will fix that issue in the future and add a way to display constraints when the constraint logic is used.
Here is an example:
https://snippet.dhtmlx.com/imnsyx50
You can read about auto-scheduling modes in the following article:
https://docs.dhtmlx.com/gantt/desktop__auto_scheduling.html#timeconstraintsfortasks
https://docs.dhtmlx.com/gantt/desktop__auto_scheduling.html#versioncompatibility
If that doesn’t help you, probably the issue is related to the Gantt configuration, but it is hard to suggest what might be wrong as I don’t see your code.
In that case, please add your configuration to the following snippet and make sure that the issue is reproduced there:
Then, click on the Save
button and send me the link.
Or send me a ready demo with all the necessary JavaScript and CSS files so that I can reproduce the issue locally.
Is there a way I can simply set all constraints to ASAP to test this?
Hello Skoofy,
If you want to use the constraint logic, you will need to manually modify the constraints before the task is fully updated:
gantt.attachEvent("onBeforeTaskUpdate", function(id,updatedTask){
updatedTask.constraint_type = "asap";
});
Here is an example in the snippet:
https://snippet.dhtmlx.com/envc5o8x
After you drag a task, it will stay on that date. But as soon as you call the autoSchedule
method or drag its predecessor, the task will be auto-scheduled to the predecessor’s end_date.
A simpler way would be to not use the constraint logic at all:
https://docs.dhtmlx.com/gantt/desktop__auto_scheduling.html#versioncompatibility
Here is the snippet:
https://snippet.dhtmlx.com/sh7aqwhl
Thanks, ramil. I really had to wrangle this one to get it to suit my requirements.
I just wanted to let you know that I came across a small issue where I had unscheduled tasks as part of a main project. If these unscheduled tasks had no children when I fired autschedule() multiple times it would eventually return a start_date invalid error for those unscheduled tasks. As soon as they were removed everything would work fine. I ended up adding placeholder values for my unscheduled tasks and everything was fine. Just thought I’d let you know.
Hello Skoofy,
Thank you for the additional details. We are aware of the issue that Gantt tries to auto-schedule unscheduled tasks. So, when these tasks don’t have the date parameters, the function returns an error. The dev team will fix that bug in the future.
As a workaround, you can cancel auto-scheduling for these tasks in the onBeforeTaskAutoSchedule
event handler:
https://snippet.dhtmlx.com/86pac6cv
Hello Skoofy,
The dev team fixed the bug with the auto_scheduling
extension, so the linked unscheduled tasks are no longer auto-scheduled:
https://docs.dhtmlx.com/gantt/whatsnew.html#x8318x90x8319x:~:text=Prevent%20Auto%20Scheduling%20of%20linked%20unscheduled%20tasks
You can see that the bug is no longer reproduced in the following sample:
https://snippet.dhtmlx.com/6kx36srz