Hi
After getting related entities
lv_children ?= lv_ent->get_related_entities( iv_relation_name = 'BuilRelationshipRel' ).
lv_size = lv_children->size( ).
If lv_size < 1.
Throw your error. and it means no relations exist for this BP.
else.
Implement your logic here to check the required relationships maintained or not.
endif.
Hope it helps
Thanks
Kumar.