Constraints behaviour in Gantt

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

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

Hi Ramil Rakhimov,

Thanks for the update.

Provided workaround solution is contradicting the ASAP behaviour,

As per docs: As soon as possible - If this constraint is set to an independent task, the task starts at the same time that the project does. If this constraint is set to a dependent task, the task starts as soon as its predecessor tasks end.

Doc link: https://docs.dhtmlx.com/gantt/desktop__auto_scheduling.html#timeconstraintsfortasks

Workaround solution : ASAP task start date is not changing when we create a dependency on this task.

  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

  5. Create a task #4.1- constraint type - asap, start_date:2019-03-01

  6. Create a task #4.2- constraint type - Must start on, start_date:2019-03-01

  7. Create a task #5 - constraint type - asap, start_date:2019-03-01

  8. Create a dependency from #3 to #4 then #4.1 start date changes from 2019-03-01 to 2019-03-05 which is fine

Actual behaviour: Create a dependency from #4 to #5 then #4.1(Source) start date changing to 2019-03-07 which is wrong.

Expected behaviour: #4.1 start date must be 2019-03-05 .

When I created the first dependency then it’s working fine but when I create the second dependency then it’s not working as expected.

Hello Govardhan,
Please don’t post the same questions in different places. Let’s continue our discussion in the support system.