I’m building processes that leverage DMN Decision Tables. To integrate DMN into the BPMN process, I’m using a Business Rule Task.
I’m letting Camunda default to its predefined mapper which sets the result variable to a resultList
, of type List<Map<String, Object>>
.
How can I access the values of this resultList: List<Map<String,Object>>
from within another DMN XML so it can be used as input?
It’s very easy to reference process variables if they are of primitive types (e.g., String, Integer) but I can’t seem to figure this out for a complex data structure like List<Map<String, Object>
.
For example, I can reference the guests
variable that is populated by the user when they fill in a User Task form like this:
<input id="guests" label="How many guests" camunda:inputVariable="guests">
<inputExpression id="LiteralExpression_0h5951a" typeRef="integer">
<text>guests</text>
</inputExpression>
</input>
What is the equivalent to access the first, or really any value in this list?
In the documentation I’ve found code examples that are giving me hints of how I could accomplish it but can’t seem to get it right.
In the example below (which I found in the documentation I linked above), decisionResult
is a List<Map<String, Object>>
, they get the first element of the List
and then to read the Map
s value they use .reason
as key:
<camunda:outputParameter name="reason">
${decisionResult.getSingleResult().reason}
</camunda:outputParameter>
I tried this but it doesn’t seem to work.