Details
-
Bug
-
Resolution: Done
-
Major
-
None
-
7.4.1.Final, 7.5.0.Final
-
None
-
2018 Week 05-06
-
NEW
-
NEW
Description
When trying to evaluate a FEEL expression like:
personList[name = "John"]
by inserting into the DMNContext a Java Object, the DMN engine doesn't seem to be able to fetch the name field from the object. This doesn't happen if instead of Java Objects we insert a Map.
While trying to debug, it seems that the problem is happening in the following method of FilterExpressionNode.
private void evaluateExpressionInContext(EvaluationContext ctx, List results, Object v) { try { ctx.enterFrame(); // handle it as a predicate ctx.setValue( "item", v ); // if it is a Map, need to add all string keys as variables in the context if( v instanceof Map ) { Set<Map.Entry> set = ((Map) v).entrySet(); for( Map.Entry ce : set ) { if( ce.getKey() instanceof String ) { ctx.setValue( (String) ce.getKey(), ce.getValue() ); } } } Object r = this.filter.evaluate( ctx ); if( r instanceof Boolean && ((Boolean)r) == Boolean.TRUE ) { results.add( v ); } } finally { ctx.exitFrame(); } }
Also attatched java and DMN test files that showcases the issue.
Attachments
Issue Links
- relates to
-
RHDM-568 [GSS](7.0.z) Java Object in DMNContext not working properly with Filter function
- Closed