You can use a boxed function to define functions in a DMN project. A Boxed Function is a parameterized boxed expression that may include a literal FEEL expression, a nested context expression, or another boxed expression of any type. Connect to JSON file types in DMN projects using the File node of an Activity Flow logic document. If your main orchestration for a DMN project is a DRD, you can create an Activity Flow with a File node and then drag and drop it into your DRD. Debug the project (or run it) to view the JSON file values in the parameter window and data viewer. You can use a boxed function to define functions in a DMN project. A Boxed Function is a parameterized boxed expression that may include a literal FEEL expression, a nested context expression, or another boxed expression of any type.

Boxed Functions offer a straightforward visual-tabular format for defining decision logic. The first column displays the function name, while the second column holds its corresponding value or expression.

Add to a Boxed Expression

While in a boxed expression document, drag and drop the boxed function from the toolbox into the document.

Set the arguments in the properties window.

Add entries to do calculations.

Return the result.

Add a Function to a DRD

After you define functions in a DMN project, they need to be implemented in the orchestration models. The boxed expression can then be used in a Decision Requirement Diagram. For more information on this see the FlexRule Resource Hub article on the DMN Decision Requirements Diagram.

FlexRule also has DMN functions. For an entire list and examples, see our articles on DMN Functions.

Summary

To use a Boxed Function, drag it from the toolbox into a boxed expression document, define parameters in the properties window, and enter logic rows to perform calculations and return results. These functions can then be integrated into a Decision Requirement Diagram (DRD). For more on using functions in DRDs or DMN in general, refer to the FlexRule Resource Hub.