Skip to content

Commit

Permalink
- Add AlphaNodeOrderingOption.CUSTOM
Browse files Browse the repository at this point in the history
  • Loading branch information
tkobayas committed Jul 7, 2020
1 parent 01c6248 commit 9714db0
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,30 @@
/**
* An Enum for AlphaNodeOrdering option.
*
* drools.alphaNodeOrdering = <count|none>
* drools.alphaNodeOrdering = <count|custom|none>
*
* count : Reorder alpha nodes based on usage count
* none : Leave alpha node order as written in rules
* count : Reorder alpha nodes based on usage count
* custom : Custom class implementation. Experimental.
* none : Leave alpha node order as written in rules
*
* DEFAULT = none
*/
public enum AlphaNodeOrderingOption implements SingleValueKieBaseOption {

COUNT("count"),
CUSTOM("custom"),
NONE("none");

/**
* The property name for the AlphaNodeOrdering option
*/
public static final String PROPERTY_NAME = "drools.alphaNodeOrdering";

/**
* Experimental. Specify a custom AlphaNodeOrderingStrategy implementation with FQCN. Enabled when AlphaNodeOrderingOption.CUSTOM
*/
public static final String CUSTOM_CLASS_PROPERTY_NAME = "drools.alphaNodeOrdering.custom.class";

private String value;

AlphaNodeOrderingOption(String option) {
Expand All @@ -56,6 +63,8 @@ public String getValue() {
public static AlphaNodeOrderingOption determineAlphaNodeOrdering(String option) {
if (COUNT.getValue().equalsIgnoreCase(option)) {
return COUNT;
} else if (CUSTOM.getValue().equalsIgnoreCase(option)) {
return CUSTOM;
} else if (NONE.getValue().equalsIgnoreCase(option)) {
return NONE;
}
Expand Down

0 comments on commit 9714db0

Please sign in to comment.