Design for Object cardinality in DMN

Hi ,
As per my project requirement, I need to compare data from parent object with a child object.For e.g, I have employee as my parent entity and his list of accounts as child entity, then i just want to compare data between employee object and account object.

As a simple example based on employee first name starts with “John” and account type is “Current Account”, i need to pass a boolean true or false as DMN output.

I am trying to figure out how to pass employee object along with list of its associated accounts to DMN engine to evaluate the rules and get this as an output.(Without using any Expression language inside the rule)

If i need to use for sure expression language to evaluate above said rule, any suggestions to make it generic so that if need add new elements to employee object or account object without any code change.

Below is the input object relationship passed to camunda DMN with parent and child relationship.
Employee object as parent and having list of Accounts and Projects

Application is sending the complete json request like below.

{
“firstName” : “XXX”

"accountDTOs": [
					{
						"accountNumber": "1233"
					},
					{
						"accountNumber" : "3456"
					}
				]
"projectDTOs":[
					{
						"projectName" : "test1"
					},
					{
						"projectName" : "test2"
					}
				]

}

How to apply the object cardinality through DMN rules

Employee:
{
employeeId
email
firstName
lastName
.
.

}
Account{
accountId
accountNumber

.
.
.

}
Project{
projectId
projectName
.
.
.

}

Rule 1: Employee name starts with “John” and account type =“Current account”(Where my hit policy is C Collect)
Rule 2: firstName= “XXX” and accountNumber=“1233” and projectName=“test1” :: Output score=80% and status=“Good”.

Thanks
Vemula

Hi @vemulabujji,

using the FEEL extension, you can write the following conditions

starts with(employee.firstName, "John")

some account in employee.accountDTOs satisfies account.type = "Current account"

Does this help you?

Best regards,
Philipp

Thanks Dear,

Can we get the any samples from github for these kind of requirements?

And how we can get the values from list?

Thanks
Vemula

Hi Dear,

Can I get any sample DMN and input Json for same example?