Hello, I hope this is the correct section to post this question.
I need to restrict the ability of a task to change its percentDone to greater than 0 if its predecessors percentDone is not 100. In other words - task can not be started if it`s predecessor is not "done".
Is this kind of behavior supported out of the box by the scheduling engine? If not - could it be included with a custom mixin ?
There is no such logic out of the box unfortunately.
This can be achieved by overriding TaskModelcalculatePercentDone method. Something like this:
class Task extends TaskModel {
* calculatePercentDone() {
const defaultValue = yield * super.calculatePercentDone();
let predecessorsAreDone = true;
for (const dependency of (yield this.$.incomingDeps)) {
const fromEvent = yield dependency.$.fromEvent;
predecessorsAreDone = (yield fromEvent.$.percentDone) === 100 & predecessorsAreDone;
}
if (!predecessorsAreDone) {
return 0;
}
return defaultValue;
}
}
It does what you want but this is not the final/polished code of course.
As bare minimum it must also take task inactive and dependency active field states into account.