-
Bug
-
Resolution: Done
-
Minor
-
7.45.0.Final
-
None
-
None
-
False
-
False
-
NEW
-
NEW
-
Undefined
-
-
---
-
---
-
When we call a DMN from a BPMN, we can pass in a Java object and it will map to a DMN type. However, when we return an object from a DMN and try to map it back to a Java option, we run into this exception:
{{Caused by: java.lang.ClassCastException: class java.util.HashMap cannot be cast to class com.myspace.exampleproject.MyDataObject (java.util.HashMap is in module java.base of loader 'bootstrap'; com.myspace.exampleproject.MyDataObject is in unnamed module of loader 'app')}}
The output from the DMN is a HashMap, so we should be able to map that back to a Java Object which would make it easier to work with in the BPMN.
I did some research, and I think this could be fixed here: https://github.com/kiegroup/jbpm/blob/master/jbpm-flow/src/main/java/org/jbpm/workflow/instance/node/RuleSetNodeInstance.java#L312
By handling a case such as this where the instanceof checks against a HashMap, and uses either reflection or the Jackson Object Mapper to do the type conversion.
I will start working on a fix, and open a PR soon. Any guidance is much appreciated!