Hello @ajinkya ,
welcome to this moderated Azure community forum.
This pattern is a typical business rule seen in Digital Twins.
Over a certain relationship, one or more properties of the parent change when a child changes.
For example: if a room is measuring a fire (very high temperature), the complete floor must be marked as having a fire.
The easiest solution is:
- There is a relationship between rooms and floors
- The child Room has a 'FiredDetected' property
- The parent Floor has a 'FiredDetected' property
- When a room.FireDetected property changes, a property change event is emitted
- There room.FireDetected property change is picked up by custom code
- That custom code finds the parent Floor via the relationship (via a graph query)
- For this parent Floor, all (sibling) Room children are checked (via a graph query) for their 'FiredDetected' property
- The parent Floor 'FiredDetected' property is set to true when any room has a fire detected. Else, the property is set to false
- Set the color of the floor according to the Floor 'FiredDetected' property
Notice this can be repeated for 'any floor within a building' has a fire detected.
Regarding creating the business rules, this can be coded using Azure Functions or via low code solution using Logic Apps.
Because a lot of property change events are triggered, you need to be smart to prevent unnecessary function execution (normally, the function to change a Building property is not interested in Room property changes).
If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress. All community members with similar issues will benefit by doing so. Your contribution is highly appreciated.