DMN Complex Objects and Expressions to Process - Gnorion/BizVR GitHub Wiki

DMN Complex Objects and Expressions to Process

Given a data structure like this which might contain many policies

[
    {
        "policyId": "13493345",
        "title": "sometext",
        "roles": [
            {
                "partyId": 12345,
                "role": "PolicyHolder"
            },
            {
                "partyId": 349834,
                "role": "Payer"
            }
        ]
    }
]

Here's a sample expression that would process this

(policy[1].roles[role = "PolicyHolder"]).partyId[1] = 12345

Notes

  1. policy[1] chooses only the first policy
  2. roles[role = "PolicyHolder"] filters the array of roles
  3. .partyId[1] selects the first partyId in the array of roles
  4. If .partyId[1] = 12345 then the expression returns TRUE, otherwise FALSE

ITERATION

Or if you wanted to process every policy in the array

for i = 1 to count(policy)
    (policy[i].roles[role = "PolicyHolder"]).partyId[1] = x
end

https://forum.camunda.io/t/literal-expression-iterate-through-output-entries-of-the-preceding-dmn-table/36934

Expression Result
some allergy in allergyOrderDto.allergies satisfies list contains(["PEANUTS","ANOTHER_VAL","AND ANOTHER VAL"], allergy) true or false
count(allergyOrderDto.allergies[list contains(["PEANUTS","ANOTHER_VAL","AND ANOTHER VAL"], allergy)]) > 0 number