Whole project moves back in time after adjustToCalendar

Support for v6.x of our Scheduling components


Post Reply
User avatar
Omega Code
Posts: 30
Joined: Wed Aug 14, 2019 11:27 am

Whole project moves back in time after adjustToCalendar

Post by Omega Code »

We are experiencing a problem with scheduling as whole project moves back in time after each adjustToCalendar.
It occurs only when there is (among child nodes) a constraint of type endtostart and store is configured with scheduleByConstraints:true.

whole project moves backwards when there is reversed constraint and scheduleByConstraints.png
whole project moves backwards when there is reversed constraint and scheduleByConstraints.png (27.08 KiB) Viewed 231 times

below is a working testcase:

LBTC_70734.zip
(4.85 MiB) Downloaded 16 times

(click "ADJUST" multiple times to see this behaviour)

Is this a bug? or what can be done about it?

Also if You could explain in more detail what does "scheduleByConstraints" actually do? as documentation isn't very clear to us about difference between true and false here..

Thanks in advance


User avatar
pmiklashevich
Core Developer
Core Developer
Posts: 3069
Joined: Fri Apr 01, 2016 11:08 am

Re: Whole project moves back in time after adjustToCalendar

Post by pmiklashevich »

Hello,

I've checked your testcase. You said you have end-to-start dependency, but in fact you have start-to-end dependency. So it means that the successor must end where the predecessor begins. So successor always goes first. And also you have no project start date specified. To understand the problem better I would recommend you to expand your nodes and zoom out a bit

Code: Select all

Ext.first('ganttpanel').expandAll()
Ext.first('ganttpanel').zoomOut()
Ext.first('ganttpanel').zoomOut()

Now you can see:

Снимок экрана 2020-07-16 в 18.35.41.png
Снимок экрана 2020-07-16 в 18.35.41.png (454.13 KiB) Viewed 221 times

I highlighted 17 Sep 2019.
This is the date where your first leaf task begins, so I expect you to configure your project to start at the same date:

Code: Select all

    "tasks"             : {
        "metaData" : {
            "projectStartDate" : "2019-09-17"
        },
        "rows" : [

adjustToCalendar schedules all the tasks (by default, no need to pass tasks) AS SOON AS POSSIBLE according to project calendar, starting from the project start date, skipping non working time (weekends for example) and taking into account constraints, parent-child relations, and dependencies. So basically you can call:

Code: Select all

handler : function (btn) {
    var store = me.crudManager.getTaskStore();
    if (!store.isLoaded()) {
        alert('first load data');
        return;
    }
    store.adjustToCalendar();
}

However we would recommend you another approach. We do not call adjustToCalendar, because we assume that you load scheduled data. But in case you decide that your data can be invalid (not scheduled), we recommend to subscribe to "load'" event and execute adjustToCalendar only after load. User don't need to re-schedule data all the time. When he adds or modify data, tasks will be rescheduled automatically. At the end that's what Gantt chart does. For example:

Code: Select all

    initComponent : function () {

    this.crudManager = this.createCrudManager();

    var gantt = new Gnt.examples.testcase.view.Gantt({
        crudManager : this.crudManager,
        viewPreset : 'weekAndDayLetter'
    });

    this.crudManager.on('load', function() {
        this.crudManager.getTaskStore().adjustToCalendar();
        gantt.expandAll();
    }, this);

    this.crudManager.load();

    Ext.apply(this, {
        items : [gantt]
    });

    this.callParent();
},

createCrudManager() {
    return new Gnt.data.CrudManager({
        autoLoad  : false,

You can read more about task scheduling here: https://www.bryntum.com/docs/gantt-for-extjs/#!/guide/gantt_scheduling

Pavel Miklashevich - Core Developer

User avatar
Omega Code
Posts: 30
Joined: Wed Aug 14, 2019 11:27 am

Re: Whole project moves back in time after adjustToCalendar

Post by Omega Code »

Thank You Pavel,
Settting metadata.projectStartDate did help us with this problem.

PS just to clarify:

  • we cannot adjsutToCalendar on load as it is not acceptable by our users (they want to control it)
  • our data is often invalid on first load (then users correct it manually and using adjustToCalendar selectively)
  • also we can't disalow users from adjusting selected nodes on demand (for any selected node with its cheildren, not for whole project/store - thus we pass nodes to function in testcase as well)

User avatar
pmiklashevich
Core Developer
Core Developer
Posts: 3069
Joined: Fri Apr 01, 2016 11:08 am

Re: Whole project moves back in time after adjustToCalendar

Post by pmiklashevich »

Users can adjust the data, it's not forbidden. But to let users to move tasks, change data, better to have the project scheduled. Otherwise when they first time change something, the propagation will be called and tasks (some of them at least ) will be rescheduled anyway. So we recommend to first make the data valid, and then allow your users to modify it. Nevertheless you can use a button. We cannot stop you from doing this, you know your application better :)

Pavel Miklashevich - Core Developer

Post Reply