Skip to content

Commit 1d7331e

Browse files
committed
change in the dmn flow to support static variable which can be used in dmn rules
1 parent d470404 commit 1d7331e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

product/src/main/kotlin/nl/nlportal/product/service/DmnService.kt

+6-6
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,10 @@ class DmnService(
108108
}
109109

110110
// handle the configured static variables
111-
if (beslisTabelConfiguration.variabelen.containsKey(BESLISTABLE_KEY_STATIC) && beslisTabelConfiguration.variabelen[BESLISTABLE_KEY_STATIC] != null) {
111+
beslisTabelConfiguration.variabelen[BESLISTABLE_KEY_STATIC]?.let {
112112
variablesMapping.putAll(
113113
mapBeslisTabelStaticVariables(
114-
beslisTabelConfiguration.variabelen[BESLISTABLE_KEY_STATIC]!!,
114+
it,
115115
),
116116
)
117117
}
@@ -179,20 +179,20 @@ class DmnService(
179179

180180
// check if the beslisTabelVariables contains a producttype configuration,
181181
// if yes map the variables with the json of the productType
182-
if (beslisTabelVariables.containsKey(BESLISTABLE_KEY_PRODUCT_TYPE) && beslisTabelVariables[BESLISTABLE_KEY_PRODUCT_TYPE] != null) {
182+
beslisTabelVariables[BESLISTABLE_KEY_PRODUCT_TYPE]?.let {
183183
variablesMapping.putAll(
184184
mapBeslisTabelVariablesWithSource(
185-
beslisTabelVariables[BESLISTABLE_KEY_PRODUCT_TYPE]!!,
185+
it,
186186
Mapper.get().writeValueAsString(productType),
187187
),
188188
)
189189
}
190190

191191
// handle the configured static variables
192-
if (beslisTabelVariables.containsKey(BESLISTABLE_KEY_STATIC) && beslisTabelVariables[BESLISTABLE_KEY_STATIC] != null) {
192+
beslisTabelVariables[BESLISTABLE_KEY_STATIC]?.let {
193193
variablesMapping.putAll(
194194
mapBeslisTabelStaticVariables(
195-
beslisTabelVariables[BESLISTABLE_KEY_STATIC]!!,
195+
it,
196196
),
197197
)
198198
}

0 commit comments

Comments
 (0)