I asked about using complex objects in decision evaluation quiote some while ago: Redirecting to Google Groups. Sebastian Menski answered with this working example: GitHub - menski/dmn-rest-complex-object. I finally had some time to investiagte, as I needed this again today
I found the difference: I want to do the same WITHOUT using a BPMN process instance.
I used tis request with the example from Sebastian:
POST http://localhost:8080/engine-rest/decision-definition/key/testDecision/evaluate
{
"variables": {
"claim": {
"type": "Object",
"value": "{\"type\":\"Unfall\"}",
"valueInfo": {
"objectTypeName": "org.camunda.bpm.example.Claim",
"serializationDataFormat": "application/json"
}
}
}
}
This does not work
Caused by: java.lang.IllegalStateException: Object is not deserialized.
at org.camunda.bpm.engine.variable.impl.value.ObjectValueImpl.getValue(ObjectValueImpl.java:86)
at org.camunda.bpm.engine.impl.el.VariableContextElResolver.unpack(VariableContextElResolver.java:73)
at org.camunda.bpm.engine.impl.el.VariableContextElResolver.getValue(VariableContextElResolver.java:42)
at org.camunda.bpm.engine.impl.javax.el.CompositeELResolver.getValue(CompositeELResolver.java:231)
at org.camunda.bpm.engine.impl.juel.AstIdentifier.eval(AstIdentifier.java:81)
at org.camunda.bpm.engine.impl.juel.AstProperty.eval(AstProperty.java:52)
at org.camunda.bpm.engine.impl.juel.AstEval.eval(AstEval.java:50)
at org.camunda.bpm.engine.impl.juel.AstNode.getValue(AstNode.java:26)
at org.camunda.bpm.engine.impl.juel.TreeValueExpression.getValue(TreeValueExpression.java:114)
at org.camunda.bpm.engine.impl.dmn.el.ProcessEngineElExpression.getValue(ProcessEngineElExpression.java:43)
at org.camunda.bpm.dmn.engine.impl.evaluation.ExpressionEvaluationHandler.evaluateElExpression(ExpressionEvaluationHandler.java:118)
... 89 more
I tried to hand in some JSON comparable to How can pass multiple values to input variable in request body - #4 by thorben - but this seems not to be possible without adjusting my personal DMN where JUEL is used to access a Java object.
Might be that we are missing a context switch when evaluting DMN?