Here is my JSON Document
{
"location": {
"details": [
{
"country": "India",
"state": "haryana"
},
{
"country": "America",
"state": "LA"
},
{
"country": "India",
"state": "Maharashtra"
}
]
},
"organisation": {
"details": [
{
"name": "AON",
"country": "india"
},
{
"name": "AON",
"country": "America"
}
]
}
}
I have to apply a rule in Below format
If(
(location.details.country=='India' OR
location.details.state=='haryana')
AND
)
Till now i have researched and know that rules on the fields of the **same class can be applied in nested format like below**.
// Use this instead
Person( ( age > 50 && weight > 80 ) || height > 2 )
But i want to apply rules of different pojo class in the same nested condition as below
If(
(location.details.country=='India' OR
location.details.state=='haryana')
AND
AND
(location.details.country=='India' AND
organisation.details.country=='India')
)
//any level of nested between different pojo classes can be present
**Is this possible to do in drools?**
**And if possible then how to do it. Can anyone help?**