Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

array reference gives invalid expression error #81

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

array reference gives invalid expression error #81

williamwsmith opened this issue Oct 9, 2013 · 0 comments

Comments

@williamwsmith
Copy link

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
* 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 [noolsjs#81](noolsjs#81).
* Fixed issue [noolsjs#82](noolsjs#82).
* Added new `sudoku` web example.
* Added [Send More Money](http://en.wikipedia.org/wiki/Verbal_arithmetic) benchmark see [noolsjs#78](noolsjs#78).
@doug-martin doug-martin mentioned this issue Oct 14, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants