'JBPM Decision table to count values in an array
I am new to jBPM. I'm trying to set up a guided decision table via Business Central.
My request data looks like this:
{
"Person": {
"id":1234,
"numberOfDoses":null,
"vaccineDoses": [
{"manufacturer":"Pfizer", "doseDate":"2021-07-01"},
{"manufacturer":"Pfizer", "doseDate":"2022-01-01"},
{"manufacturer":"AstraZeneca", "doseDate":"2022-04-01"}
]
}
}
The response should be
{
"Person": {
"id":1234,
"numberOfDoses":2
"vaccineDoses": [
{"manufacturer":"Pfizer", "doseDate":"2021-07-01"},
{"manufacturer":"Pfizer", "doseDate":"2022-01-01"},
{"manufacturer":"AstraZeneca", "doseDate":"2022-04-01"}
]
}
}
I need to set up data model(s) and a guided decision table to count number of doses received in 2022. I have tried with two data models Vaccine and include Vaccine in Person as a list. Didn't work. Can someone shed some light on how to access sub fields and iterate through the array to count the number of doses?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
