An exception is thrown
Symptoms
In Decision Designer, when you run a decision model or a task model, an exception is thrown.
The following error message shows an example of a NullPointerException:
Run error
java.lang.NullPointerException
Exception java.lang.NullPointerException
in action of rule 'corporate score"
Bindings: [-200.0, decisions.techpreview_samples.loan_validation.loanvalidationdata.newtype1@d5a71066,200.01
in node 'Corporate Score'
in decision model 'LoanValidationDecisionModel-loanValidationDecisionModel'
in decision operation with execution id "'
Other types of exception can be thrown, such as ArithmeticException.
Causes
An exception occurred in the rule action. This kind of exception can occur, for instance, when the attribute of an object cannot be retrieved.
set decision to 'Bankruptcy Score' + 'Salary Score' + the credit score of Borrower ;Depending on the type of model that you are running, exceptions can either be thrown in the action part of the rule or the condition part of the rule:
| Rule part | Decision model | Task model |
|---|---|---|
| Rule condition | ✗ | ✓ |
| Rule action | ✓ | ✓ |
In decision models, exceptions in rule conditions are automatically processed through automatic exception handling. For more information, see A rule is not executed.
Resolving the problem
To avoid running into an exception, you can add a condition to your rule.
if the credit score of Borrower is not null
then set decision to 'Bankruptcy Score' + 'Salary Score' + the credit score of Borrower ;