Page 1 of 1

[REACT] -Disable 'Schedule cycle' alert

Posted: Wed Mar 29, 2023 8:13 am
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


Re: [REACT] -Disable 'Schedule cycle' alert

Posted: Wed Mar 29, 2023 8:25 am
by arcady

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


Re: [REACT] -Disable 'Schedule cycle' alert

Posted: Wed Mar 29, 2023 8:47 am
by skonakanchi

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


Re: [REACT] -Disable 'Schedule cycle' alert

Posted: Wed Mar 29, 2023 9:29 am
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.


Re: [REACT] -Disable 'Schedule cycle' alert

Posted: Wed Mar 29, 2023 9:37 am
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')
})

Re: [REACT] -Disable 'Schedule cycle' alert

Posted: Wed Mar 29, 2023 11:55 am
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.


Re: [REACT] -Disable 'Schedule cycle' alert

Posted: Wed Mar 29, 2023 1:20 pm
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.


Re: [REACT] -Disable 'Schedule cycle' alert

Posted: Thu Mar 30, 2023 3:22 pm
by arcady
const ganttConfig: Partial<GanttConfig> = {
    displaySchedulingIssueResolutionPopup: false,
    ...

Re: [REACT] -Disable 'Schedule cycle' alert

Posted: Tue Mar 05, 2024 11:15 am
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 25 times

Re: [REACT] -Disable 'Schedule cycle' alert

Posted: Tue Mar 05, 2024 11:38 am
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