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

Support for the "COLLECT" hit policy. #267

Merged
merged 1 commit into from
Nov 22, 2022
Merged

Conversation

danfunk
Copy link
Collaborator

@danfunk danfunk commented Nov 21, 2022

  • DecisionTable constructor now expects a third argument (the HitPolicy)
  • DMNParser now checks for a hitPolicy attribute, but defaults ot "UNIQUE" as Camunda doesn't put another in there if Unique is selected.
  • DecisionTable deserializer will default to a hitPolicy of "UNIQUE" if not value is in the Json.
  • DMNEngine.decide() always returns an array of matched rules now.
  • DMNEngine.result() is a new method that returns the result (a dict to be added to the task.data) of running a decision table. * DecisionRunner (used in 100's of tests) makes the assumption that only one rule will match in it's "decide" function, but it has also has a new function called "result" which will give you the dict that is created when running a decision.
  • Moved logic out of the BusinessRuleTask so we aren't directly dealing with decisions and rules there, we deal with them in the DMNEngine.

* DecisionTable constructor now expects a third argument (the HitPolicy)
* DMNParser now checks for a hitPolicy attribute, but defaults ot "UNIQUE" as Camunda doesn't put another in there if Unique is selected.
* DecisionTable deserializer will default to a hitPolicy of "UNIQUE" if not value is in the Json.

* DMNEngine.decide() always returns an array of matches rules now.
* DMNEngine.result() is a new method that returns the result of running a decision table.  Which feels cleaner to me.
* DecisionRunner (used in 100's of tests) makes the assumption that only one rule will match in it's "decide" function, but it has anew function now called "result" which will give you the dict that is created when running a decision -- much cleaner I think.
* Moved logic out of the BusinessRuleTask so we aren't directly dealing with decisions and rules there, we deal with them in the DMNEngine.
@danfunk danfunk requested review from essweine and jbirddog November 21, 2022 20:25
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

83.8% 83.8% Coverage
0.0% 0.0% Duplication

@danfunk danfunk merged commit 46d3de2 into main Nov 22, 2022
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

Successfully merging this pull request may close these issues.

4 participants