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

Unexpected results in 4.1 A Hello World Example? #90

Closed
kentjones opened this issue Sep 11, 2017 · 3 comments
Closed

Unexpected results in 4.1 A Hello World Example? #90

kentjones opened this issue Sep 11, 2017 · 3 comments

Comments

@kentjones
Copy link

kentjones commented Sep 11, 2017

hellowordrule.txt
example4.1.txt
Hi Clayton,

Running the Hello World example using bogus facts the rulebook.getResults().isPresent() is true. Should the results be false? I was expecting a Null value.

Running the Hello World example using RuleBookBuilder using bogus facts the rulebook.getResults().isPresent() is false. Which is what I expected.

Love the RuleBook. Keep up the good work.

cheers,
Kent

@Clayton7510 Clayton7510 self-assigned this Sep 12, 2017
@Clayton7510
Copy link
Collaborator

Clayton7510 commented Sep 12, 2017

Kent,

The RuleBookRunner that decorates a RuleBook and allows POJO Rule packages to be used as RuleBooks essentially creates an empty Result. The reason why it does that is so Results can be injected into POJO Rules. If there is no Result, then it can't very well be chained.

However, just because there is a good reason for why Results with POJO rules always exist, doesn't make that good expected behavior. So, I think you're right that this is something which should be corrected. I'll tag it as a bug and look at getting this corrected. Thanks for bringing it up!

Thanks,

Clayton

@Clayton7510
Copy link
Collaborator

Clayton7510 commented Sep 13, 2017

The fix is in 0.8.1-SNAPSHOT now. I put some tests in there just to verify the scenarios where the Result of a RuleBookRunner should and should not be present. I'll probably push a patch release this weekend.

@Clayton7510
Copy link
Collaborator

This was fixed in v0.8.1, now pushed to Maven Central.

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