а

Constraints behaviour in Gantt


#1

Hi,

I am currently evaluating dhtmlx Gantt with respect to constraint types. When we create multiple dependencies on a task where it has asap and must start on constraint type child tasks auto scheduling is not working properly and below is my test scenario where I am seeing the issue:

  1. Created a Project #1 - constraint type - asap, start_date:2019-03-01
  2. Created a task #2 - constraint type - asap, start_date:2019-03-01
  3. Created a task #3 - constraint type - asap, start_date:2019-03-01
  4. Created a project type task #4- constraint type - asap, start_date:2019-03-01
    1. Create a task #4.1- constraint type - asap, start_date:2019-03-01
    2. Create a task #4.2- constraint type - Must start on, start_date:2019-03-01
  5. Create a task #5 - constraint type - asap, start_date:2019-03-01
  6. Create a dependency from #3 to #4 then #4.1 start date changes to 2019-03-05 which is fine
  7. Create a dependency from #4 to #5 then #4.1(Source) start date changing to 2019-03-07 which is wrong and expected behaviour is #4.1 start date should not change.

Can you please clarify on this?
sample code


#2

Hello Govardhan,
Thank you for sending the snippet. I reproduced the issue.
Looks like there is an issue with the ASAP constraint as Task #4.1 doesn’t move to the beginning of the project. That bug will be fixed in the future, but I cannot give you any ETA. Now, as a workaround, you can obtain the dates in the onAfterTaskAutoSchedule event handler:

gantt.attachEvent("onAfterTaskAutoSchedule",function(task, start, link, predecessor){ if (task.constraint_type == 'asap' && task.parent && !task.$source[0] && !task.$target[0]){ task.start_date = gantt.getTask(task.parent).start_date; task.end_date = gantt.calculateEndDate(task.start_date, task.duration); } });

http://snippet.dhtmlx.com/a52e0d928