I’m currently using flowable modeler and have been able to achieve most of my solution.
However, I have a use case in which I’m trying to use decision table. It is basically to validate the datta being passed from the POST API (custom API).
The object is as below:
{
“id”: “1”,
“entityName”: “ABC”,
“lastName”: “Ltd”,
“email”: “abc@abccom”,
“associatedParties”: [
{
“id”: “2”,
“name”: “test”,
“email”: “test@testcom”,
“age”: 19
},
Basically, I want to check in decision table that the ‘email’ under ‘associatedParties’ is not empty or not a ‘particular’ email in any of the index. Not been able to figure out this.
Could anyone please help accessing email under nested employee object(associatedParties) for any number of index in the list. i.e: I do not want to specify the index and it should apply to all the elements in the array/list
I’m looking for something like : {data.associatedParties.[*].email != ‘abc@abc.com’}
Sorry about that.
I’m programmatically deploying my DMNs, not sure if StandaloneDmnEngineConfiguration would be suitable.
Also, as I do not have XML based spring container- is there an example which I can follow which has the spring boot based example.
I was wondering if there was a solution out of the box for iterating array elements and validating their values.
Apologies again.
Update:
I have tried as you suggested, please see sam ecode below:
public class ListElementsValidator extends AbstractFlowableFunctionDelegate {
public ListElementsValidator() {
}
@Override
public String prefix() {
return "list:";
}
@Override
public String localName() {
return "validateElement";
}
@Override
public Class<?> functionClass() {
return ListValidatorUtils.class;
}
@Override
public Method functionMethod() {
return getSingleObjectParameterMethod("validateElement");
}
}
___-------------------------------------
public class ListValidatorUtils {
public static boolean validateElement() {
return true;
}
}
Can you please suggest me as to how to refer it in decision table. I tried a few combinations but when I run the process, it throws the following exception:
Error: DMN decision with key employer_dataset execution failed. Cause: Could not resolve function ‘list:validateElement’
Iterating over multi level nested objects is not support OOTB. But that can be added with these Custom Function Delegates (I mentioned in my previous reply)
Have a look at the source code for some examples on this.