Business Knowledge Model Context

A boxed context is a collection of context entries. Each context entry is a name-value pair or a result value. The icon on the top right corner of the Business Knowledge Model (BKM) element indicates that it is implemented as boxed context.

Figure 1.  Business Knowledge Model implemented as Boxed Context 

Open the BKM in DMN Expression view. 

The BKM defines four parameters and the body is implemented as Boxed Context, which contains three Context Entries: 
•	Local variable 'Monthly Fee' is evaluated by an 'if...else if...else' statement
•	Local variable 'Monthly Repayment' is evaluated by a built in function 'PMT'
The return value is formatted by the built in function 'decimal'

In order to edit the values for a Context Entry, the user can either type the entry in (if it is single line), or open the expression editor if multiple lines of code are required.

You can edit expressions for different languages. 
Since some statements require different syntax for different languages, Enterprise Architect provides overloaded expressions for languages for code generation.

Simulation
Switch to the 'Input Parameter Values for Simulation' tab and provide values for the parameters:

Validate and Run. The results will be rendered in the Context.

The simulation result is 1540.

Note: This Boxed Context uses the 'PMT' function to calculate monthly repayments. This function is defined in the DMN Library, which can be opened and included via the 'Run' option menu: