Our state of the art Gantt chart


Post by Wari »

Hi,

As mentioned on this issue viewtopic.php?f=52&t=12862 I'm interested on implementing a "not earlier than relative to parent task" feature.

As mentioned, the requirement is different than "not earlier than" constraint as:

1. Yes it is different because your "not earlier than" constraint is relative to a date, while what I am trying to implement is a "not earlier than" relative to a task. Thus, I want to be able to create this kind of constraint: "task A must start/finish not earlier than X days before the start/end of task B" but not "task A must start X days before the Xth of Y, 2019". There is no absolute date involved in my constraint.

If my child task starts 5 days after parent task, when I reschedule parent task, the child task should still start 5 days after the new parent start date.

Is this possible to achieve using the automatic scheduling system?
Otherwise, how can I accomplish it if I set tasks to be manually scheduled?

I'm using bryntum-gantt 4.0.0
Thank you in advance.


Post by arcady »

There is no such constraint out of the box.
Sounds close to task dependencies but parent-child dependencies are forbidden.
And it's forbidden because it naturally builds a cycle:

  1. parent start/end dates depend on children (as min/max of children start/end)
  2. children depend on their parent due to the depedency.

And your constraint will build the same cycle as well ..unless I'm missing something?


Post by Wari »

Hi,

1. parent start/end dates depend on children (as min/max of children start/end)

In my use case, the parent start-end dates don't depend on the children start/end, I added manuallyScheduled: true to the parent so it doesn't resize based on the children dates.


Post by arcady »

Ok if you 100% sure it won't build a cycle then why not.

Try investigating ConstrainedByParentMixin mixin (it's located in lib/Engine/quark/model/gantt/ConstrainedByParentMixin.ts file).

It does a similar thing in calculateEarlyStartDateConstraintIntervals method:

                if ((yield parentEvent.$.manuallyScheduled) && (yield this.$.direction) === Direction.Forward) {
                    intervals.push(DateInterval.new({
                        startDate   : yield parentEvent.$.startDate
                    }))
                }

The above snippet adds a restriction based on the parent event start date. In your case there will be some other date field.


Post Reply