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
- policy[1] chooses only the first policy
- roles[role = "PolicyHolder"] filters the array of roles
- .partyId[1] selects the first partyId in the array of roles
- 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
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 |