Hello,
i would like to make validation before delete task phase and if is validation is not correct i would like to prevent to delete it.
I tried to make a Rule for this action. But i’m not sure, when i make it correctly.
I created custom rule for shape.remove
import RuleProvider from 'diagram-js/lib/features/rules/RuleProvider';
export class CustomRulesProvider extends RuleProvider {
constructor(eventBus) {
super(eventBus);
}
init() {
super.addRule('shape.remove', function (context) {
const condition = null;
return condition ? true : false;
});
}
}
export const CustomRulesProviderModule = {
__init__: ['customRuleProvider'],
customRuleProvider: ['type', CustomRulesProvider],
};
And imported it to new modeler instance, where i had a few next modules and it is works fine. Problably is problem with my custom rule provider. Maybe bad event (‘shape.remove’) or something else ? Condition is for illustration, but this rule is not executed.
Thank you for your help.