Some resource entities, such as “Property”, have children resources. The children resource entities to Property would be Media, PowerProduction, PropertyGreen, and PropertyUnits.
We have added the function RESOURCE to allow a rule to operate across child resource entities. The function takes three or four parameters, cross operation Type, old or new value, and target field.
- Cross Operation Type: “COUNT_CHILDREN”, “IDENTICAL_ACROSS_CHILDREN”, “UNIQUE_ACROSS_CHILDREN”, and “SUM_FIELDS”.
- Old/New value: “NEW”, “OLD”, is the operation to be performs against the old child or new child resource.
- Child resource: PropertyUnits, PropertyGreen, PowerProduction, or Media
- Field name: Name of the child resource field the operation is to be performed on.
Examples
RESOURCE("COUNT_CHILDREN", "NEW", "Media") // Count the number of Media resource children
RESOURCE("SUM_FIELDS", "NEW", "PropertyUnits", "UnitTypeUnitsTotal") // Sum the contents of the UnitTypeUnitTotals field of all new PropertyUnits child resources
RESOURCE("UNIQUE_ACROSS_CHILDREN", "NEW", "Media", "Order") // Ensure the order field contents of all new Media resource children are unique (no duplicates)
RESOURCE("IDENTICAL_ACROSS_CHILDREN", "OLD", "Media", "MemberAOR") // Verify the all old media children have the same value in the MemberAOR field