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

Rule name is dropping when build Rule withFactType. #197

Open
mohdArshad9 opened this issue Sep 3, 2020 · 1 comment
Open

Rule name is dropping when build Rule withFactType. #197

mohdArshad9 opened this issue Sep 3, 2020 · 1 comment
Labels

Comments

@mohdArshad9
Copy link

If I am building a Rule .

RuleBuilder.create().withName("Rule1") .withResultType(Boolean.class) .withFactType("fact") .when(facts -> true) .then(facts -> { } ))

The rule name is dropping.In RuleBuilder.java line number 92 rule name is not copying from builder.

public <S> RuleBuilder<S, U> withFactType(Class<S> factType) { RuleBuilder<S, U> builder = new RuleBuilder<>(_ruleClass); builder._factType = factType; builder._resultType = _resultType; builder._actionType = _actionType; return builder; }

If we are building like this. It is working.

RuleBuilder.create() .withFactType("fact") .withName("Rule1") .withResultType(Boolean.class) .when(facts -> true) .then(facts -> { } ))

In RuleBuilder.java line number 106 rule name is copying from builder.So it is working.

public <S> RuleBuilder<T, S> withResultType(Class<S> resultType) { RuleBuilder<T, S> builder = new RuleBuilder<>(_ruleClass); builder._factType = _factType; builder._resultType = resultType; builder._actionType = _actionType; builder._name = _name; return builder; }

To avoid the maintaining order at rule building time.

Can I do a PR for it?

RuleBuilder.java line number 92.

public <S> RuleBuilder<S, U> withFactType(Class<S> factType) { RuleBuilder<S, U> builder = new RuleBuilder<>(_ruleClass); builder._factType = factType; builder._resultType = _resultType; builder._actionType = _actionType; builder._name = _name; return builder; }

@Clayton7510
Copy link
Collaborator

Yes, pls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants