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

Facts defined in compile options not available via getDefined() #23

Closed
nprbst opened this issue Mar 18, 2013 · 2 comments
Closed

Facts defined in compile options not available via getDefined() #23

nprbst opened this issue Mar 18, 2013 · 2 comments
Assignees

Comments

@nprbst
Copy link

nprbst commented Mar 18, 2013

I think I should be able to do this:

custom-facts.js

module.exports = {
  CustomClass: function() {...}
}

custom-flow.js

var facts = require('custom-facts');

var flow = nools.compile('rules.nools', {
  defined: facts
});

custom = flow.getDefined('CustomClass');

But it seems that, event though the rules compile correctly, the classes are not available via getDefined(). It would be nice to have this work. I'd like to define my classes in coffeescript (in an separate file) and provide them to the rest of the app as if they were part of the rules file.

Or am I approaching this wrong?

@ghost ghost assigned doug-martin Mar 18, 2013
@doug-martin
Copy link
Contributor

I hadn't thought of this use case, typically if I have externally defined classes for the rules engine I will just require the module/file that contains them. However I can see where this would be useful.

I will see about adding this in the next release.

@nprbst
Copy link
Author

nprbst commented Mar 18, 2013

Thanks, Doug. I really appreciate the work you're doing with nools. It's becoming a great tool! I'd like to help, although I'm not a Rete-wizard. Please let me know what I can do...

@nprbst nprbst closed this as completed Mar 18, 2013
@nprbst nprbst reopened this Mar 18, 2013
doug-martin added a commit to doug-martin/nools that referenced this issue May 23, 2013
* Updated grunt
* Fixed nextTick issues for node v0.10 noolsjs#32
* Added ability to remove a defined flow from nools. noolsjs#31 noolsjs#22
* Added ability to use `getDefined` on externally defined fact types. noolsjs#23
* Fixed all jshint issues
* Rebuilt nools.js and nools.min.js
* Added more tests for new globals feature
doug-martin added a commit to doug-martin/nools that referenced this issue May 23, 2013
* Updated grunt
* Fixed nextTick issues for node v0.10 noolsjs#32
* Added ability to remove a defined flow from nools. noolsjs#31 noolsjs#22
* Added ability to use `getDefined` on externally defined fact types. noolsjs#23
* Fixed all jshint issues
* Rebuilt nools.js and nools.min.js
* Added more tests for new globals feature
@doug-martin doug-martin mentioned this issue May 23, 2013
doug-martin added a commit that referenced this issue May 23, 2013
* Updated grunt
* Fixed nextTick issues for node v0.10 #32
* Added ability to remove a defined flow from nools. #31 #22
* Added ability to use `getDefined` on externally defined fact types. #23
* Fixed all jshint issues
* Rebuilt nools.js and nools.min.js
* Added more tests for new globals feature
doug-martin added a commit that referenced this issue May 23, 2013
* Updated grunt
* Fixed nextTick issues for node v0.10 #32
* Added ability to remove a defined flow from nools. #31 #22
* Added ability to use `getDefined` on externally defined fact types. #23
* Fixed all jshint issues
* Rebuilt nools.js and nools.min.js
* Added more tests for new globals feature
doug-martin added a commit that referenced this issue May 23, 2013
* Updated grunt
* Fixed nextTick issues for node v0.10 #32
* Added ability to remove a defined flow from nools. #31 #22
* Added ability to use `getDefined` on externally defined fact types. #23
* Fixed all jshint issues
* Rebuilt nools.js and nools.min.js
* Added more tests for new globals feature
doug-martin added a commit that referenced this issue May 23, 2013
* Updated grunt
* Fixed nextTick issues for node v0.10 #32
* Added ability to remove a defined flow from nools. #31 #22
* Added ability to use `getDefined` on externally defined fact types. #23
* Fixed all jshint issues
* Rebuilt nools.js and nools.min.js
* Added more tests for new globals feature
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants