Skip to content

Commit cd4da46

Browse files
authored
Merge pull request #264 from sartography/bugfix/dmn-equality-with-boolean
disambiguate DMN expressions
2 parents eea53c9 + 414a59e commit cd4da46

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

SpiffWorkflow/dmn/engine/DMNEngine.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ def evaluate(self, input_expr, match_expr, task):
9595
# If we get here, we need to check whether the match expression includes
9696
# an operator or if can use '=='
9797
needs_eq = self.needs_eq(script_engine, match_expr)
98-
expr = input_expr + ' == ' + match_expr if needs_eq else input_expr + match_expr
98+
# Disambiguate cases like a == 0 == True when we add '=='
99+
expr = f'({input_expr}) == ({match_expr})' if needs_eq else input_expr + match_expr
99100
return script_engine.evaluate(task, expr)
100101

101102
@staticmethod

0 commit comments

Comments
 (0)