Our state of the art Gantt chart


Post by methode »

Hello,

considering the code below:


project.load({}).then(() => {
            const stm = gantt.project.stm;

        // let's track scheduling conflicts happened
        project.on('schedulingconflict', context => {
            // show notification to user
            Toast.show('Scheduling conflict has happened ..recent changes were reverted');
            // as the conflict resolution approach let's simply cancel the changes
            context.continueWithResolutionResult(EffectResolutionResult.Cancel);
        });

        stm.enable();
        stm.autoRecord = true;

    });

I'm trying to better understand and implement the EffectResolutionResult enum options.
I tried to, but I can't find docs on it. Can you explain the Cancel, Restart and Resume options?

I have the issue that when I got error from scheduler, the following operations on the scheduler task are allowed but if I reload the scheduler the last operations are not set. They are gone.

Which is the best option to catch errors or scheduler conflict in case autoSync is true? (my case).

Thank you


Post by nickolay »

Hello,

The EffectResolutionResult enum defines how to handle the scheduling conflict. As the name suggest, in case of conflict you can either "Cancel" the whole transaction (the most reasonable choice), or "Restart" the calculations (will lead to infinite loop, unless you've removed the reason of the conflict), or just "Resume" the calculation (will lead to inconsistent schedule).

The safest choice is "Cancel"


Post Reply