Our pure JavaScript Scheduler component


Post by skonakanchi »

Hi team,

While pushing the dependencies from process model to project, bryntum gives a alert For invalid dependencies as below. How we can disable this pop and mark those dependencies as inactive dependencies automatically.

Thank you,
Swapna

Last edited by skonakanchi on Tue Apr 04, 2023 7:00 am, edited 1 time in total.

Post by arcady »

You can prepare your data and set active field of the dependency you want to deactivate to false.


Post by skonakanchi »

I don't want that popup (Scheduling cycle popup), Is there any way to stop that alert?


Post by arcady »

Yes you can disable the popup but you still will have to fix conflicts.

Disabling the popup: https://www.bryntum.com/products/gantt/docs/api/Gantt/view/Gantt#config-displaySchedulingIssueResolutionPopup

Events triggered when a conflict/cycle is detected:
https://www.bryntum.com/products/gantt/docs/api/Gantt/model/ProjectModel#event-schedulingConflict
https://www.bryntum.com/products/gantt/docs/api/Gantt/model/ProjectModel#event-cycle

So you will have to listen to the events and resolve found issues.


Post by arcady »

An example of a cycle handling listener:

project.on('cycle', ({ schedulingIssue, continueWithResolutionResult }) => {
    // related tasks
    schedulingIssue.getEvents()
    // related dependencies
    schedulingIssue.getDependencies()

    // suggested resolutions
    const resolutions = schedulingIssue.getResolutions()

    // use the very first resolution of suggested
    resolutions[0].resolve()

    // continue transaction
    continueWithResolutionResult('Resume')
})

Post by skonakanchi »

Thanks for your reply. But i am not getting exactly. where i need appy this event. I am providing my code snippet. please suggest me.

Last edited by skonakanchi on Tue Apr 04, 2023 6:59 am, edited 1 time in total.

Post by skonakanchi »

Hi Team ,
Than you Arcady, it was really help full. Now I am able to apply the deactivate the dependency using resolutions[1].resolve(). but 'Scheduling cycle' alert was still showing. How to close it automatically?

Thank you,
Swapna.


Post by arcady »

const ganttConfig: Partial<GanttConfig> = {
    displaySchedulingIssueResolutionPopup: false,
    ...

Post by rodel.ocfemia »

Hi,
I need to reopen this ticket. One of our gantt implementions has the logic to automatically resolve scheduling cycle dependencies then hide the scheduling popup window. When doing testing, this code is throwing error. How can we resolve this issue?

cycle: ({
                    schedulingIssue,
                    continueWithResolutionResult,
                  }: {
                    schedulingIssue: any;
                    continueWithResolutionResult: any;
                  }) => {
                    const resolutions = schedulingIssue.getResolutions();
                    // use the second resolution of suggested for inActivation
                    resolutions[1].resolve();
                    continueWithResolutionResult('Resume');
                    schedulingIssue.collapse();
                  },

Error:

Cannot read properties of undefined (reading 'remove')
TypeError: Cannot read properties of undefined (reading 'remove')
    at RemoveDependencyCycleEffectResolution.resolve (http://localhost:3001/static/js/bundle.js:193664:16)
    at ProjectModel3.cycle (http://localhost:3001/main.916e98d5012817e95c87.hot-update.js:114:26)
    at ProjectModel3.trigger (http://localhost:3001/static/js/bundle.js:11843:34)
    at http://localhost:3001/static/js/bundle.js:193914:16
    at new Promise (<anonymous>)
    at ProjectModel3.onSchedulingIssueCall (http://localhost:3001/static/js/bundle.js:193913:16)
    at ProjectModel3.onCycleSchedulingIssue (http://localhost:3001/static/js/bundle.js:193920:19)
    at [CycleSymbol] (http://localhost:3001/static/js/bundle.js:193640:27)
    at EngineTransaction.yieldAsync (http://localhost:3001/static/js/bundle.js:175076:38)
    at EngineTransaction.readAsync (http://localhost:3001/static/js/bundle.js:175087:58)

Attached testable code.

Scheduling Cylce - autoresolve.zip
(2.24 MiB) Downloaded 3 times

Post by arcady »

Hello,

  1. The resolution your code tries to call is a RemoveDependencyCycleEffectResolution class instance.
    Its resolve method has an argument - the dependency it should remove. So change your code respectively to pass there a dependency and it'll start working.
  2. schedulingIssuse has no collapse method
    schedulingIssue.collapse();

Best regards,
Arcady


Post Reply