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.
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?
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)
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.