forked from deliveredtechnologies/rulebook
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/issue127 golden rule exception handling (deliveredtechnologie…
…s#135) * added ERROR_ON_FAILURE RuleChainActionType * updated GoldenRule to throw errors when RuleChainActionType is ERROR_ON_FAILURE * added RuleChainActionType actionType parameter to Rule annotation for POJO rules * updated RuleAdapter to allow errors to be thrown on ERROR_ON_FAILURE * updated corresponding tests * updated tests for RuleBookRunner * updated JavaDoc comments for builder that inclued ERROR_ON_FAILURE
- Loading branch information
1 parent
518a4c1
commit c802521
Showing
25 changed files
with
237 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,6 @@ | |
*/ | ||
public enum RuleChainActionType { | ||
STOP_ON_FAILURE, | ||
ERROR_ON_FAILURE, | ||
CONTINUE_ON_FAILURE | ||
} |
37 changes: 37 additions & 0 deletions
37
rulebook-core/src/main/java/com/deliveredtechnologies/rulebook/model/RuleException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.deliveredtechnologies.rulebook.model; | ||
|
||
/** | ||
* Runtime exception to wrap Rule exceptions. | ||
* This exception exists for two reasons: | ||
* <ol> | ||
* <li>It denotes that the exception happened in a Rule.</li> | ||
* <li>It allows exceptions to be thrown from a Rule without changing the interface.</li> | ||
* </ol> | ||
*/ | ||
public class RuleException extends RuntimeException { | ||
|
||
/** | ||
* Create a RuleException with an exception message. | ||
* @param message exception message | ||
*/ | ||
public RuleException(String message) { | ||
super(message); | ||
} | ||
|
||
/** | ||
* Create a RuleException with an exception message and a cause (the originating Throwable exception). | ||
* @param message exception message | ||
* @param cause the originating Throwable exception | ||
*/ | ||
public RuleException(String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
|
||
/** | ||
* Create a RuleException using the originating Throwable exception. | ||
* @param cause the originating Throwable exception | ||
*/ | ||
public RuleException(Throwable cause) { | ||
super(cause); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 0 additions & 43 deletions
43
rulebook-core/src/test/java/com/deliveredtechnologies/rulebook/model/runner/BadRuleBook.java
This file was deleted.
Oops, something went wrong.
38 changes: 0 additions & 38 deletions
38
...book-core/src/test/java/com/deliveredtechnologies/rulebook/model/runner/GoodRuleBook.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.