Create Custom Function
create_custom_functionCreate a DS2 custom function from a method, compile-checked first, so rule expressions can call it; assign a category to organize it for use in decision rules.
Instructions
Create a DS2 custom function that rule expressions can call, after checking that it compiles.
The code is one DS2 method: method risk_band(double score) returns varchar(10); ... return 'LOW'; end;. Its name is the function's name.
A rule then uses it in an expression, e.g. an assignment
risk_band(credit_score). A new function takes a few seconds to be
visible to validate_decision_expression.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | The DS2 method. | |
| category | Yes | The function category, by name or ID; a name that does not exist yet is created. | |
| description | No | Optional description. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||