Dependencystore is acting up

Our state of the art Gantt chart
Post Reply
User avatar
bjork
Posts: 25
Joined: Mon Apr 08, 2019 2:47 pm

Dependencystore is acting up

Post by bjork » Wed Oct 09, 2019 4:08 pm

I have a problem with the statemachine not sending actual id's but instead phantomId:s when undoing a successor removal. (can be found here: viewtopic.php?f=52&t=12367&p=65260#p65260)

I *might* have found the problem causing this. When loading dependencies everything looks good. However there is a problem when syncing dependencies. They end up in gantt.dependencies but NOT in the dependencyStore. Why is this? Is there something off in the way the backend handles the data? I can't find a reason for this strange behaviour. See the call chain below:

Load request from client:

Code: Select all

"{\"projectId\":\"21006\",\"requestId\":\"15706288241500\",\"revision\":1,\"type\":\"load\"}"
Load response from backend:

Code: Select all

{
    "dependencies": {
        "metaData": null,
        "removed": null,
        "rows": [],
        "total": 0
    },
    "message": "",
    "requestId": "15706288241500",
    "revision": 1,
    "success": true,
    "tasks": {
        "metaData": null,
        "removed": null,
        "rows": [{
                "duration": 89.95833333333333,
                "effort": 180,
                "hierarchy": "0000",
                "constraintDate": "2019-10-07T00:00:00",
                "constraintType": "startnoearlierthan",
                "durationUnit": "day",
                "effortDriven": false,
                "effortUnit": "",
                "endDate": "2020-01-04T22:00:00",
                "id": "1",
                "manuallyScheduled": false,
                "name": "Project1",
                "parentId": "0",
                "parentIndex": 0,
                "percentDone": 0,
                "referenceId": "21006",
                "referenceTypeId": 0,
                "referenceTypeName": "Project",
                "schedulingMode": "Normal",
                "showInTimeline": false,
                "startDate": "2019-10-07T00:00:00",
                "treeLevel": 0,
                "children": [{
                        "duration": 89.95833333333333,
                        "effort": 180,
                        "hierarchy": "0000/0000",
                        "constraintDate": "2019-10-06T22:00:00",
                        "constraintType": "startnoearlierthan",
                        "durationUnit": "day",
                        "effortDriven": false,
                        "effortUnit": "hour",
                        "endDate": "2020-01-04T22:00:00",
                        "id": "2",
                        "manuallyScheduled": false,
                        "name": "Phase1",
                        "parentId": "1",
                        "parentIndex": 0,
                        "percentDone": 0,
                        "referenceId": "",
                        "referenceTypeName": "",
                        "schedulingMode": "Normal",
                        "showInTimeline": false,
                        "startDate": "2019-10-06T22:00:00",
                        "treeLevel": 1,
                        "children": [{
                                "duration": 90,
                                "hierarchy": "0000/0000/0000",
                                "constraintDate": "2019-10-06T22:00:00",
                                "constraintType": "startnoearlierthan",
                                "durationUnit": "day",
                                "effortDriven": false,
                                "effortUnit": "hour",
                                "endDate": "2020-01-04T22:00:00",
                                "id": "3",
                                "manuallyScheduled": false,
                                "name": "Task1",
                                "parentId": "2",
                                "parentIndex": 0,
                                "percentDone": 0,
                                "referenceId": "",
                                "referenceTypeName": "",
                                "schedulingMode": "Normal",
                                "showInTimeline": false,
                                "startDate": "2019-10-06T22:00:00",
                                "treeLevel": 2,
                                "children": []
                            }
                        ]
                    }
                ]
            }
        ],
        "total": 0
    },
    "type": "load"
}

Code: Select all

var gantt = Ext.fly($0).component.getGantt()

gantt.dependencies
[] <----- nothing here, ok

gantt.dependencyStore.data
[] <----- nothing here, ok
Sync request from client:

Code: Select all

{
    "type": "sync",
    "requestId": "15706289539362",
    "revision": 1,
    "tasks": {
        "added": [{
                "cls": "",
                "effort": 89.95833333333333,
                "calendar": "_generatedClassDefEx1",
                "duration": 90,
                "phantomid": "_generatedClassDefEx49",
                "constraintdate": "2019-10-06T20:00:00.000Z",
                "constrainttype": "startnoearlierthan",
                "durationunit": "day",
                "iseffortdriven": false,
                "effortunit": "hour",
                "enddate": "2020-04-03T22:00:00.000Z",
                "manuallyscheduled": false,
                "elementname": "New task 1",
                "parentid": "2",
                "parentindex": 1,
                "percentdone": 0,
                "schedulingmode": "Normal",
                "showintimeline": false,
                "startdate": "2020-01-04T22:00:00.000Z"
            }
        ],
        "updated": [{
                "effort": 179.91666666666666,
                "duration": 180,
                "constraintdate": "2019-10-06T22:00:00.000Z",
                "enddate": "2020-04-03T22:00:00.000Z",
                "elementid": "2"
            }, {
                "effort": 179.91666666666666,
                "duration": 180,
                "enddate": "2020-04-03T22:00:00.000Z",
                "elementid": "1"
            }
        ]
    },
    "dependencies": {
        "added": [{
                "cls": "",
                "lag": 0,
                "phantomid": "_generatedClassDefEx1",
                "fromelementid": "3",
                "fromside": "right",
                "lagunit": "day",
                "toelementid": "_generatedClassDefEx49",
                "toside": "left",
                "dependencytypeid": 2
            }
        ]
    },
    "projectId": "21006"
}
Sync response from backend:

Code: Select all

{
    "dependencies": {
        "metaData": null,
        "removed": [],
        "rows": [{
                "comment": null,
                "lag": 0,
                "$PhantomId": "_generatedClassDefEx1",
                "bidirectional": null,
                "fromEvent": "3",
                "fromSide": "right",
                "id": "41",
                "lagUnit": "da",
                "toEvent": "39",
                "toSide": "left",
                "type": 2
            }
        ],
        "total": 0
    },
    "message": "",
    "requestId": "15706289539362",
    "revision": 1,
    "success": true,
    "tasks": {
        "metaData": null,
        "removed": [],
        "rows": [{
                "duration": 90,
                "effort": 89.95833333333333,
                "$PhantomId": "_generatedClassDefEx49",
                "constraintType": "startnoearlierthan",
                "durationUnit": "day",
                "effortUnit": "hour",
                "endDate": "2020-04-03T22:00:00",
                "id": "39",
                "name": "New task 1",
                "parentId": "2",
                "parentIndex": 1,
                "percentDone": 0,
                "schedulingMode": "Normal",
                "startDate": "2020-01-04T22:00:00"
            }, {
                "id": "1"
            }, {
                "id": "2"
            }
        ],
        "total": 0
    }
}

Code: Select all

gantt.dependencies
[ClassDefEx] <-------- ok, looks like the dependency was loaded correctly!

Code: Select all

gantt.dependencyStore.data
[] <---------- The store is empty, why?

User avatar
sergey.maltsev
Core Developer
Core Developer
Posts: 187
Joined: Mon Dec 24, 2018 9:15 am

Re: Dependencystore is acting up

Post by sergey.maltsev » Thu Oct 10, 2019 7:23 am

Hi, bjork!

Sorry, it is not quite clear for me what actions were done and what is expected as a result.

Could you please provide a runnable testcase for this so we can run and check?

It would be good if you could take a look at our Gantt php backend demo and make test on it's basis .
Demo can be found in examples/php folder in distribution package.

Post Reply