diff --git a/src/js/rulesAssistant.js b/src/js/rulesAssistant.js index 855c872d11ccae5328f3620951666c7f5d0b3324..df9badcf3b0fe6d141eff1e2c4dd7bf373fe3334 100644 --- a/src/js/rulesAssistant.js +++ b/src/js/rulesAssistant.js @@ -200,8 +200,20 @@ window.ruleAppliesP = function ruleAppliesP(cond, slave) { flag = false; break; case "between": // between two values of a slave's attribute + let slaveAttribute = slave[cond.data.attribute]; + if (slaveAttribute === undefined && cond.data.attribute.includes(".")) { + slaveAttribute = cond.data.attribute + .split(".") + .reduce( + (reduceSlave, attribute) => + (reduceSlave && reduceSlave[attribute] !== undefined) + ? reduceSlave[attribute] + : undefined, + slave + ); + } flag = between( - slave[cond.data.attribute], + slaveAttribute, cond.data.value[0], cond.data.value[1]); break;