array reference gives invalid expression error #81

Closed
williamwsmith opened this Issue Oct 9, 2013 · 0 comments

Comments

Projects
None yet
2 participants
@williamwsmith

Example of a simple rule below.
The console.log of the _domainValues[0] & [1] report correct values.
However when used in the constraint expression, the rules compiler reports
"Invalid expression". Any thoughts?

rule CheckAndAssertActualWeight {
    when {
            actualWeight_domain: ActualWeight_Domain {values: _domainValues};
            actualWeight_EnteredValue: ActualWeight_EnteredValue 
                (
                    actualWeight_EnteredValue.value >= _domainValues[0] &&
                    actualWeight_EnteredValue.value <= _domainValues[1]
                ) {value : _entered};
    }
    then {
        assert( new ActualWeight_Value({value:_entered}) );
        console.log("ActualWeight value assigned: %s", _entered);   
        console.log("ActualWeight domain %s %s.", _domainValues[0], _domainValues[1]);  
    }
}

doug-martin added a commit to doug-martin/nools that referenced this issue Oct 14, 2013

v0.2.0
* Nools now supports true modify!!!
   * This is a major leap forward for `nools` opening the door for more complex actions and expressions in the rules.
* Added support from for `from` conditions in the `rhs`.
* Fixed issue [#81](noolsjs#81).
* Fixed issue [#82](noolsjs#82).
* Added new `sudoku` web example.
* Added [Send More Money](http://en.wikipedia.org/wiki/Verbal_arithmetic) benchmark see [#78](noolsjs#78).

@doug-martin doug-martin referenced this issue Oct 14, 2013

Merged

v0.2.0 #83

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment